-
Notifications
You must be signed in to change notification settings - Fork 3
/
README
65 lines (49 loc) · 2.71 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
============================================================================
This program converts OSM XML to ESRI Shape Files.
You can define the layout of the shape files which will be created in the osm2shp.cfg file. After changing this file you have to run 'make' again.
Note that this program creates UTF-8 shape files by default but you can specify
-DLATIN1 when compiling to switch to LATIN-1.
This program does not support relations and therefore no multipolygons either.
This progam is capable of producing very large shape files so be careful what
you feed it. Unfortunately, neither reading from stdin nor reading compressed
or binary formats is supported so you really have to have a .osm file for input.
Written by Frederik Ramm <[email protected]>, public domain
Improved by Stephan Plepelits <[email protected]>, public domain
============================================================================
Syntax of the osm2shp.cfg-file:
The osm2shp.cfg contains several blocks, each of them defining a shape file.
Empty lines and lines starting with a # will be ignored.
* file <format> "<name>"
Every new block starts with a "file" line:
- The first parameter defines the format of the shapefile. Possible values:
point, line, polygon
- The second parameter defines the name in quotation marks
Example:
file point "places"
Defines a file of points with the name places
* where key "<key>" [key "<key>"]
Every block can have one or more where-lines. Each where line defines whether an osm object should be added to the shapefile or not.
- The first parameter has to be 'key'
- The second parameter defines a key in quotation marks
You can repeat the parameters to add more keys (they will be linked by or)
If you add several where-lines or one where line with several keys does not
matter.
Example:
where key "landuse" key "leisure"
Add all object which have a key "landuse" or a key "leisure"
* column type "<name>" [key "<key>"]
Defines a column to the shapefile.
- The first parameter defines the type of the column, possible values: string,
int, float
- The second parameter defines the name of the column in quotation marks
- optionally you can define one or several key-parameters. The value of the
column <name> will be one of those keys (the first key-parameter has highest
priority). If no key-parameters are supplied, the value of key <name> will be
used.
Example:
column string "name"
If the osm object has a key "name" it will be copied to the column "name".
column string "type" key "landuse" key "leisure"
If the object has a key "landuse" or a key "leisure" one of those values will
be copied to the shapefile, whereas the column in the shapefile is called
"type". "landuse" has higher priority than "leisure".