source: subversion/utils/osm2pgsql/readme.txt @ 2159

Last change on this file since 2159 was 1655, checked in by jonb, 14 years ago

Initial high level description of code and algorithm.

File size: 1.5 KB
Line 
1osm2pgsql
2=========
3
4Converts OSM planet.osm data to SQL suitable for loading into
5a PostgreSQL database and then rendered into tiles by Mapnik.
6
7The format of the database is optimised for ease of rendering
8by mapnik. It may be less suitable for other general purpose
9processing.
10
11For a broader view of the whole tile rendering tool chain see
12http://wiki.openstreetmap.org/index.php/Slippy_Map
13
14Any questions should be directed at the osm dev list
15http://wiki.openstreetmap.org/index.php/Mailing_lists
16
17
18
19Operation
20=========
21
221) Outputs SQL statements to create a new planet_osm table.
23
242) Runs an XML parser on the input file (typically planet.osm)
25and processes the nodes, segments and ways.
26
273) If a node has a tag declaring one of the attributes below then
28 it is emitted in the SQL as a POINT. If it has no such tag then
29the position is noted, but not added to the SQL.
30
31        name, place, landuse, waterway, highway,
32        railway, amenity, tourism, learning     
33
344) Segments are not output in the XML, they are used purely to
35locate the nodes during way processing.
36
375) Ways are read in and the segments are examined to determine
38contiguous sequences by WKT(). Each sequence is emitted as a
39line of SQL. If way consists of several dis-joint sequences of
40segments then multiple lines will be generated with the 
41osm_id of the original way.
42
436) Ways with the tags landuse or leisure are emitted as using
44a POLYGON() geometry. Other ways are represented by using a
45LINESTRING().
46
477) Finally, more SQL is output to add a suitable index
48and analyse the table to aid efficient querying.
Note: See TracBrowser for help on using the repository browser.