Artifact
d39b0ef7fa3bee1dbab998e5fa4af43270bdd759:
Wiki page
[ReadOSM] by
sandro
2015-06-25 08:46:37.
0000: 44 20 32 30 31 35 2d 30 36 2d 32 35 54 30 38 3a D 2015-06-25T08:
0010: 34 36 3a 33 37 2e 33 34 36 0a 4c 20 52 65 61 64 46:37.346.L Read
0020: 4f 53 4d 0a 50 20 63 62 33 63 65 38 61 66 36 37 OSM.P cb3ce8af67
0030: 32 32 33 64 33 30 64 39 66 65 39 64 33 37 62 61 223d30d9fe9d37ba
0040: 65 35 34 37 37 39 63 65 64 39 35 33 39 39 0a 55 e54779ced95399.U
0050: 20 73 61 6e 64 72 6f 0a 57 20 32 39 30 35 0a 3c sandro.W 2905.<
0060: 74 61 62 6c 65 20 63 65 6c 6c 73 70 61 63 69 6e table cellspacin
0070: 67 3d 22 31 30 22 20 63 65 6c 6c 70 61 64 64 69 g="10" cellpaddi
0080: 6e 67 3d 22 33 30 22 3e 3c 74 72 3e 0d 0a 3c 74 ng="30"><tr>..<t
0090: 64 20 62 67 63 6f 6c 6f 72 3d 22 23 66 30 66 30 d bgcolor="#f0f0
00a0: 66 38 22 20 77 69 64 74 68 3d 22 35 30 25 22 3e f8" width="50%">
00b0: 0d 0a 52 65 61 64 4f 53 4d 20 69 73 20 61 6e 20 ..ReadOSM is an
00c0: 3c 62 3e 3c 69 3e 6f 70 65 6e 20 73 6f 75 72 63 <b><i>open sourc
00d0: 65 3c 69 3e 3c 2f 62 3e 20 6c 69 62 72 61 72 79 e<i></b> library
00e0: 20 74 6f 20 65 78 74 72 61 63 74 20 76 61 6c 69 to extract vali
00f0: 64 20 64 61 74 61 20 66 72 6f 6d 20 77 69 74 68 d data from with
0100: 69 6e 20 61 6e 20 4f 70 65 6e 20 53 74 72 65 65 in an Open Stree
0110: 74 20 4d 61 70 20 69 6e 70 75 74 20 66 69 6c 65 t Map input file
0120: 2e 20 53 75 63 68 20 4f 53 4d 20 66 69 6c 65 73 . Such OSM files
0130: 20 63 6f 6d 65 20 69 6e 20 74 77 6f 20 64 69 66 come in two dif
0140: 66 65 72 65 6e 74 20 66 6f 72 6d 61 74 73 3a 3c ferent formats:<
0150: 75 6c 3e 0d 0a 3c 6c 69 3e 66 69 6c 65 73 20 69 ul>..<li>files i
0160: 64 65 6e 74 69 66 69 65 64 20 62 79 20 74 68 65 dentified by the
0170: 20 3c 62 3e 2e 6f 73 6d 3c 2f 62 3e 20 73 75 66 <b>.osm</b> suf
0180: 66 69 78 20 73 69 6d 70 6c 79 20 61 72 65 20 70 fix simply are p
0190: 6c 61 69 6e 20 58 4d 4c 20 66 69 6c 65 73 2e 3c lain XML files.<
01a0: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 66 69 6c 65 73 20 /li>..<li>files
01b0: 69 64 65 6e 74 69 66 69 65 64 20 62 79 20 74 68 identified by th
01c0: 65 20 3c 62 3e 2e 6f 73 6d 2e 70 62 66 3c 2f 62 e <b>.osm.pbf</b
01d0: 3e 20 73 75 66 66 69 78 20 64 6f 65 73 20 63 6f > suffix does co
01e0: 6e 74 61 69 6e 74 20 74 68 65 20 73 61 6d 65 20 ntaint the same
01f0: 69 64 65 6e 74 69 63 61 6c 20 64 61 74 61 2c 20 identical data,
0200: 62 75 74 20 61 64 6f 70 74 69 6e 67 20 74 68 65 but adopting the
0210: 20 47 6f 6f 67 6c 65 27 73 20 50 72 6f 74 6f 63 Google's Protoc
0220: 6f 6c 20 42 75 66 66 65 72 20 73 65 72 69 61 6c ol Buffer serial
0230: 69 7a 61 74 69 6f 6e 20 66 6f 72 6d 61 74 20 61 ization format a
0240: 6e 64 20 74 68 75 73 20 72 65 71 75 69 72 69 6e nd thus requirin
0250: 67 20 6d 75 63 68 20 6c 65 73 73 20 73 74 6f 72 g much less stor
0260: 61 67 65 20 73 70 61 63 65 2e 3c 2f 6c 69 3e 0d age space.</li>.
0270: 0a 3c 2f 75 6c 3e 3c 62 72 3e 0d 0a 54 68 65 20 .</ul><br>..The
0280: 52 65 61 64 4f 53 4d 20 64 65 73 69 67 6e 20 67 ReadOSM design g
0290: 6f 61 6c 73 20 61 72 65 3a 3c 75 6c 3e 0d 0a 3c oals are:<ul>..<
02a0: 6c 69 3e 74 6f 20 62 65 20 73 69 6d 70 6c 65 20 li>to be simple
02b0: 61 6e 64 20 6c 69 67 68 74 77 65 69 67 68 74 3c and lightweight<
02c0: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74 6f 20 62 65 20 /li>..<li>to be
02d0: 73 74 61 62 6c 65 2c 20 72 6f 62 75 73 74 20 61 stable, robust a
02e0: 6e 64 20 65 66 66 69 63 69 65 6e 74 3c 2f 6c 69 nd efficient</li
02f0: 3e 0d 0a 3c 6c 69 3e 74 6f 20 62 65 20 65 61 73 >..<li>to be eas
0300: 69 6c 79 20 61 6e 64 20 75 6e 69 76 65 72 73 61 ily and universa
0310: 6c 6c 79 20 70 6f 72 74 61 62 6c 65 3c 2f 6c 69 lly portable</li
0320: 3e 0d 0a 3c 6c 69 3e 6d 61 6b 69 6e 67 20 74 68 >..<li>making th
0330: 65 20 77 68 6f 6c 65 20 70 61 72 73 69 6e 67 20 e whole parsing
0340: 70 72 6f 63 65 73 73 20 6f 66 20 62 6f 74 68 20 process of both
0350: 3c 62 3e 2e 6f 73 6d 3c 2f 62 3e 20 6f 72 20 3c <b>.osm</b> or <
0360: 62 3e 2e 6f 73 6d 2e 70 62 66 3c 2f 62 3e 20 66 b>.osm.pbf</b> f
0370: 69 6c 65 73 20 63 6f 6d 70 6c 65 74 65 6c 79 20 iles completely
0380: 74 72 61 6e 73 70 61 72 65 6e 74 20 66 72 6f 6d transparent from
0390: 20 74 68 65 20 61 70 70 6c 69 63 61 74 69 6f 6e the application
03a0: 20 6f 77 6e 20 70 65 72 73 70 65 63 74 69 76 65 own perspective
03b0: 2e 3c 2f 6c 69 3e 3c 2f 75 6c 3e 0d 0a 0d 0a 52 .</li></ul>....R
03c0: 65 61 64 4f 53 4d 20 69 73 20 73 74 72 75 63 74 eadOSM is struct
03d0: 75 72 61 6c 6c 79 20 73 69 6d 70 6c 65 20 61 6e urally simple an
03e0: 64 20 71 75 69 74 65 20 6c 69 67 68 74 2d 77 65 d quite light-we
03f0: 69 67 68 74 20 28 74 79 70 69 63 61 6c 6c 79 20 ight (typically
0400: 61 62 6f 75 74 20 32 30 4b 20 6f 66 20 6f 62 6a about 20K of obj
0410: 65 63 74 20 63 6f 64 65 2c 20 73 74 72 69 70 70 ect code, stripp
0420: 65 64 29 2e 20 0d 0a 0d 0a 52 65 61 64 4f 53 4d ed). ....ReadOSM
0430: 20 69 73 20 6c 69 63 65 6e 73 65 64 20 75 6e 64 is licensed und
0440: 65 72 20 74 68 65 20 3c 61 20 68 72 65 66 3d 22 er the <a href="
0450: 68 74 74 70 3a 2f 2f 77 77 77 2e 6d 6f 7a 69 6c http://www.mozil
0460: 6c 61 2e 6f 72 67 2f 4d 50 4c 2f 62 6f 69 6c 65 la.org/MPL/boile
0470: 72 70 6c 61 74 65 2d 31 2e 31 2f 6d 70 6c 2d 74 rplate-1.1/mpl-t
0480: 72 69 2d 6c 69 63 65 6e 73 65 2d 68 74 6d 6c 22 ri-license-html"
0490: 3e 4d 50 4c 20 74 72 69 2d 6c 69 63 65 6e 73 65 >MPL tri-license
04a0: 3c 2f 61 3e 20 74 65 72 6d 73 3b 20 79 6f 75 20 </a> terms; you
04b0: 61 72 65 20 66 72 65 65 20 74 6f 20 63 68 6f 6f are free to choo
04c0: 73 65 20 74 68 65 20 62 65 73 74 2d 66 69 74 20 se the best-fit
04d0: 6c 69 63 65 6e 73 65 20 62 65 74 77 65 65 6e 3a license between:
04e0: 3c 75 6c 3e 0d 0a 3c 6c 69 3e 74 68 65 20 3c 61 <ul>..<li>the <a
04f0: 20 68 72 65 66 3d 22 68 74 74 70 3a 2f 2f 77 77 href="http://ww
0500: 77 2e 6d 6f 7a 69 6c 6c 61 2e 6f 72 67 2f 4d 50 w.mozilla.org/MP
0510: 4c 2f 4d 50 4c 2d 31 2e 31 2e 68 74 6d 6c 22 3e L/MPL-1.1.html">
0520: 4d 50 4c 20 31 2e 31 3c 2f 61 3e 3c 2f 6c 69 3e MPL 1.1</a></li>
0530: 0d 0a 3c 6c 69 3e 74 68 65 20 3c 61 20 68 72 65 ..<li>the <a hre
0540: 66 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 67 6e f="http://www.gn
0550: 75 2e 6f 72 67 2f 6c 69 63 65 6e 73 65 73 2f 67 u.org/licenses/g
0560: 70 6c 2d 32 2e 30 2e 68 74 6d 6c 23 54 4f 43 31 pl-2.0.html#TOC1
0570: 22 3e 47 50 4c 20 76 32 2e 30 3c 2f 61 3e 20 6f ">GPL v2.0</a> o
0580: 72 20 61 6e 79 20 73 75 62 73 65 71 75 65 6e 74 r any subsequent
0590: 20 76 65 72 73 69 6f 6e 3c 2f 6c 69 3e 0d 0a 3c version</li>..<
05a0: 6c 69 3e 74 68 65 20 3c 61 20 68 72 65 66 3d 22 li>the <a href="
05b0: 68 74 74 70 3a 2f 2f 77 77 77 2e 67 6e 75 2e 6f http://www.gnu.o
05c0: 72 67 2f 6c 69 63 65 6e 73 65 73 2f 6c 67 70 6c rg/licenses/lgpl
05d0: 2d 32 2e 31 2e 68 74 6d 6c 22 3e 4c 47 50 4c 20 -2.1.html">LGPL
05e0: 76 32 2e 31 3c 2f 61 3e 20 6f 72 20 61 6e 79 20 v2.1</a> or any
05f0: 73 75 62 73 65 71 75 65 6e 74 20 76 65 72 73 69 subsequent versi
0600: 6f 6e 3c 2f 6c 69 3e 3c 2f 75 6c 3e 0d 0a 3c 2f on</li></ul>..</
0610: 74 64 3e 0d 0a 3c 74 64 3e 0d 0a 3c 74 61 62 6c td>..<td>..<tabl
0620: 65 20 63 65 6c 6c 70 61 64 64 69 6e 67 3d 22 32 e cellpadding="2
0630: 30 22 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 53 74 72 0">..<tr><td>Str
0640: 69 63 74 6c 79 20 72 65 6c 61 74 65 64 20 3c 62 ictly related <b
0650: 3e 70 72 6f 6a 65 63 74 73 3c 2f 62 3e 3a 3c 75 >projects</b>:<u
0660: 6c 3e 0d 0a 3c 6c 69 3e 3c 61 20 68 72 65 66 3d l>..<li><a href=
0670: 22 2f 66 6f 73 73 69 6c 2f 73 70 61 74 69 61 6c "/fossil/spatial
0680: 69 74 65 2d 74 6f 6f 6c 73 22 3e 73 70 61 74 69 ite-tools">spati
0690: 61 6c 69 74 65 2d 74 6f 6f 6c 73 3c 2f 61 3e 3c alite-tools</a><
06a0: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 62 61 63 6b 20 74 /li>..<li>back t
06b0: 6f 20 74 68 65 20 3c 61 20 68 72 65 66 3d 22 68 o the <a href="h
06c0: 74 74 70 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 ttp://www.gaia-g
06d0: 69 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e 73 22 is.it/gaia-sins"
06e0: 3e 47 61 69 61 2d 53 49 4e 53 3c 2f 61 3e 20 68 >Gaia-SINS</a> h
06f0: 6f 6d 65 20 70 61 67 65 3c 2f 6c 69 3e 3c 2f 75 ome page</li></u
0700: 6c 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a l>..</td></tr>..
0710: 3c 74 72 3e 3c 74 64 3e 3c 62 3e 53 6f 75 72 63 <tr><td><b>Sourc
0720: 65 73 3c 2f 62 3e 3a 20 63 75 72 72 65 6e 74 20 es</b>: current
0730: 76 65 72 73 69 6f 6e 20 69 73 20 3c 62 3e 31 2e version is <b>1.
0740: 30 2e 30 65 3c 2f 62 3e 20 28 3c 69 3e 72 65 6c 0.0e</b> (<i>rel
0750: 65 61 73 65 64 20 6f 6e 20 32 30 31 35 2d 30 36 eased on 2015-06
0760: 2d 32 35 29 3c 2f 69 3e 3c 75 6c 3e 0d 0a 3c 6c -25)</i><ul>..<l
0770: 69 3e 64 6f 77 6e 6c 6f 61 64 20 3c 61 20 68 72 i>download <a hr
0780: 65 66 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 67 ef="http://www.g
0790: 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d aia-gis.it/gaia-
07a0: 73 69 6e 73 2f 72 65 61 64 6f 73 6d 2d 31 2e 30 sins/readosm-1.0
07b0: 2e 30 65 2e 74 61 72 2e 67 7a 22 3e 72 65 61 64 .0e.tar.gz">read
07c0: 6f 73 6d 2d 31 2e 30 2e 30 65 2e 74 61 72 2e 67 osm-1.0.0e.tar.g
07d0: 7a 3c 2f 61 3e 20 28 74 61 72 62 61 6c 6c 2c 20 z</a> (tarball,
07e0: 2e 74 61 72 2e 67 7a 29 3c 2f 6c 69 3e 0d 0a 3c .tar.gz)</li>..<
07f0: 6c 69 3e 64 6f 77 6e 6c 6f 61 64 20 3c 61 20 68 li>download <a h
0800: 72 65 66 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e ref="http://www.
0810: 67 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 gaia-gis.it/gaia
0820: 2d 73 69 6e 73 2f 72 65 61 64 6f 73 6d 2d 31 2e -sins/readosm-1.
0830: 30 2e 30 65 2e 7a 69 70 22 3e 72 65 61 64 6f 73 0.0e.zip">reados
0840: 6d 2d 31 2e 30 2e 30 65 2e 7a 69 70 3c 2f 61 3e m-1.0.0e.zip</a>
0850: 20 28 7a 69 70 66 69 6c 65 2c 20 2e 7a 69 70 29 (zipfile, .zip)
0860: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 62 72 6f 77 73 </li>..<li>brows
0870: 65 20 3c 61 20 68 72 65 66 3d 22 68 74 74 70 3a e <a href="http:
0880: 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 //www.gaia-gis.i
0890: 74 2f 67 61 69 61 2d 73 69 6e 73 2f 72 65 61 64 t/gaia-sins/read
08a0: 6f 73 6d 2d 73 6f 75 72 63 65 73 22 3e 6f 6c 64 osm-sources">old
08b0: 65 72 20 76 65 72 73 69 6f 6e 73 3c 2f 61 3e 3c er versions</a><
08c0: 2f 6c 69 3e 3c 2f 75 6c 3e 0d 0a 3c 2f 74 64 3e /li></ul>..</td>
08d0: 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 44 </tr>..<tr><td>D
08e0: 6f 78 79 67 65 6e 20 3c 62 3e 64 6f 63 75 6d 65 oxygen <b>docume
08f0: 6e 74 61 74 69 6f 6e 3c 2f 62 3e 3a 3c 75 6c 3e ntation</b>:<ul>
0900: 0d 0a 3c 6c 69 3e 3c 61 20 68 72 65 66 3d 22 68 ..<li><a href="h
0910: 74 74 70 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 ttp://www.gaia-g
0920: 69 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e 73 2f is.it/gaia-sins/
0930: 72 65 61 64 6f 73 6d 2d 31 2e 30 2e 30 62 2d 64 readosm-1.0.0b-d
0940: 6f 78 79 2d 64 6f 63 2f 69 6e 64 65 78 2e 68 74 oxy-doc/index.ht
0950: 6d 6c 22 3e 6f 6e 6c 69 6e 65 3c 2f 61 3e 20 48 ml">online</a> H
0960: 54 4d 4c 20 6f 76 65 72 76 69 65 77 20 64 6f 63 TML overview doc
0970: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 61 20 68 72 </li>..<li><a hr
0980: 65 66 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 67 ef="http://www.g
0990: 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d aia-gis.it/gaia-
09a0: 73 69 6e 73 2f 72 65 61 64 6f 73 6d 2d 31 2e 30 sins/readosm-1.0
09b0: 2e 30 62 2d 64 6f 78 79 2d 64 6f 63 2e 74 61 72 .0b-doxy-doc.tar
09c0: 2e 67 7a 22 3e 64 6f 77 6e 6c 6f 61 64 3c 2f 61 .gz">download</a
09d0: 3e 20 48 54 4d 4c 20 6f 76 65 72 76 69 65 77 20 > HTML overview
09e0: 74 61 72 62 61 6c 6c 20 28 74 61 72 2e 67 7a 29 tarball (tar.gz)
09f0: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 61 20 68 72 </li>..<li><a hr
0a00: 65 66 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 67 ef="http://www.g
0a10: 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d aia-gis.it/gaia-
0a20: 73 69 6e 73 2f 72 65 61 64 6f 73 6d 2d 31 2e 30 sins/readosm-1.0
0a30: 2e 30 62 2d 64 6f 78 79 2d 64 6f 63 2e 7a 69 70 .0b-doxy-doc.zip
0a40: 22 3e 64 6f 77 6e 6c 6f 61 64 3c 2f 61 3e 20 48 ">download</a> H
0a50: 54 4d 4c 20 6f 76 65 72 76 69 65 77 20 7a 69 70 TML overview zip
0a60: 66 69 6c 65 20 28 7a 69 70 29 3c 2f 6c 69 3e 0d file (zip)</li>.
0a70: 0a 3c 6c 69 3e 3c 61 20 68 72 65 66 3d 22 68 74 .<li><a href="ht
0a80: 74 70 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 tp://www.gaia-gi
0a90: 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e 73 2f 72 s.it/gaia-sins/r
0aa0: 65 61 64 6f 73 6d 2d 31 2e 30 2e 30 62 2d 64 6f eadosm-1.0.0b-do
0ab0: 63 2e 70 64 66 22 3e 50 44 46 3c 2f 61 3e 20 20 c.pdf">PDF</a>
0ac0: 6f 66 20 66 75 6c 6c 20 64 6f 63 75 6d 65 6e 74 of full document
0ad0: 61 74 69 6f 6e 3c 2f 6c 69 3e 3c 2f 75 6c 3e 0d ation</li></ul>.
0ae0: 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 .</td></tr>..<tr
0af0: 3e 3c 74 64 20 62 67 63 6f 6c 6f 72 3d 22 23 65 ><td bgcolor="#e
0b00: 30 66 66 39 30 22 3e 3c 62 3e 4c 75 61 3c 2f 62 0ff90"><b>Lua</b
0b10: 3e 20 62 69 6e 64 69 6e 67 20 61 76 61 69 6c 61 > binding availa
0b20: 62 6c 65 20 66 72 6f 6d 20 3c 61 20 68 72 65 66 ble from <a href
0b30: 3d 22 68 74 74 70 73 3a 2f 2f 67 69 74 68 75 62 ="https://github
0b40: 2e 63 6f 6d 2f 67 65 6f 66 66 6c 65 79 6c 61 6e .com/geoffleylan
0b50: 64 2f 6c 75 61 2d 72 65 61 64 6f 73 6d 22 3e 68 d/lua-readosm">h
0b60: 74 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f ttps://github.co
0b70: 6d 2f 67 65 6f 66 66 6c 65 79 6c 61 6e 64 2f 6c m/geoffleyland/l
0b80: 75 61 2d 72 65 61 64 6f 73 6d 3c 2f 61 3e 0d 0a ua-readosm</a>..
0b90: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 </td></tr>..</ta
0ba0: 62 6c 65 3e 3c 2f 74 64 3e 0d 0a 3c 2f 74 72 3e ble></td>..</tr>
0bb0: 3c 2f 74 61 62 6c 65 3e 0a 5a 20 66 36 61 63 64 </table>.Z f6acd
0bc0: 33 63 38 62 35 32 33 65 35 65 36 32 34 36 64 66 3c8b523e5e6246df
0bd0: 66 30 66 38 64 64 38 39 61 63 30 0a f0f8dd89ac0.