Hex Artifact Content
Not logged in

Artifact 46d9d8126757c90080d1c3150fc0082eff64a3c0:

Wiki page [ReadOSM] by sandro 2020-08-02 10:23:59.
0000: 44 20 32 30 32 30 2d 30 38 2d 30 32 54 31 30 3a  D 2020-08-02T10:
0010: 32 33 3a 35 39 2e 30 30 33 0a 4c 20 52 65 61 64  23:59.003.L Read
0020: 4f 53 4d 0a 50 20 63 34 65 39 38 33 39 30 64 38  OSM.P c4e98390d8
0030: 37 30 31 35 62 66 31 65 34 63 39 32 30 38 35 61  7015bf1e4c92085a
0040: 63 33 36 34 61 64 66 32 66 31 34 64 65 65 0a 55  c364adf2f14dee.U
0050: 20 73 61 6e 64 72 6f 0a 57 20 32 39 30 31 0a 3c   sandro.W 2901.<
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: 31 2e 30 61 3c 2f 62 3e 20 28 3c 69 3e 72 65 6c  1.0a</b> (<i>rel
0750: 65 61 73 65 64 20 6f 6e 20 32 30 32 30 2d 30 38  eased on 2020-08
0760: 2d 30 32 29 3c 2f 69 3e 3c 75 6c 3e 0d 0a 3c 6c  -02)</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 31  sins/readosm-1.1
07b0: 2e 30 61 2e 74 61 72 2e 67 7a 22 3e 72 65 61 64  .0a.tar.gz">read
07c0: 6f 73 6d 2d 31 2e 31 2e 30 61 2e 74 61 72 2e 67  osm-1.1.0a.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: 31 2e 30 61 2e 7a 69 70 22 3e 72 65 61 64 6f 73  1.0a.zip">reados
0840: 6d 2d 31 2e 31 2e 30 61 2e 7a 69 70 3c 2f 61 3e  m-1.1.0a.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 31 2e 30 2d 64 6f  readosm-1.1.0-do
0940: 78 79 2d 64 6f 63 2f 69 6e 64 65 78 2e 68 74 6d  xy-doc/index.htm
0950: 6c 22 3e 6f 6e 6c 69 6e 65 3c 2f 61 3e 20 48 54  l">online</a> HT
0960: 4d 4c 20 6f 76 65 72 76 69 65 77 20 64 6f 63 3c  ML overview doc<
0970: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 61 20 68 72 65  /li>..<li><a hre
0980: 66 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 67 61  f="http://www.ga
0990: 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d 73  ia-gis.it/gaia-s
09a0: 69 6e 73 2f 72 65 61 64 6f 73 6d 2d 31 2e 31 2e  ins/readosm-1.1.
09b0: 30 2d 64 6f 78 79 2d 64 6f 63 2e 74 61 72 2e 67  0-doxy-doc.tar.g
09c0: 7a 22 3e 64 6f 77 6e 6c 6f 61 64 3c 2f 61 3e 20  z">download</a> 
09d0: 48 54 4d 4c 20 6f 76 65 72 76 69 65 77 20 74 61  HTML overview ta
09e0: 72 62 61 6c 6c 20 28 74 61 72 2e 67 7a 29 3c 2f  rball (tar.gz)</
09f0: 6c 69 3e 0d 0a 3c 6c 69 3e 3c 61 20 68 72 65 66  li>..<li><a href
0a00: 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 67 61 69  ="http://www.gai
0a10: 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d 73 69  a-gis.it/gaia-si
0a20: 6e 73 2f 72 65 61 64 6f 73 6d 2d 31 2e 31 2e 30  ns/readosm-1.1.0
0a30: 2d 64 6f 78 79 2d 64 6f 63 2e 7a 69 70 22 3e 64  -doxy-doc.zip">d
0a40: 6f 77 6e 6c 6f 61 64 3c 2f 61 3e 20 48 54 4d 4c  ownload</a> HTML
0a50: 20 6f 76 65 72 76 69 65 77 20 7a 69 70 66 69 6c   overview zipfil
0a60: 65 20 28 7a 69 70 29 3c 2f 6c 69 3e 0d 0a 3c 6c  e (zip)</li>..<l
0a70: 69 3e 3c 61 20 68 72 65 66 3d 22 68 74 74 70 3a  i><a href="http:
0a80: 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69  //www.gaia-gis.i
0a90: 74 2f 67 61 69 61 2d 73 69 6e 73 2f 72 65 61 64  t/gaia-sins/read
0aa0: 6f 73 6d 2d 31 2e 31 2e 30 2d 64 6f 63 2e 70 64  osm-1.1.0-doc.pd
0ab0: 66 22 3e 50 44 46 3c 2f 61 3e 20 20 6f 66 20 66  f">PDF</a>  of f
0ac0: 75 6c 6c 20 64 6f 63 75 6d 65 6e 74 61 74 69 6f  ull documentatio
0ad0: 6e 3c 2f 6c 69 3e 3c 2f 75 6c 3e 0d 0a 3c 2f 74  n</li></ul>..</t
0ae0: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64  d></tr>..<tr><td
0af0: 20 62 67 63 6f 6c 6f 72 3d 22 23 65 30 66 66 39   bgcolor="#e0ff9
0b00: 30 22 3e 3c 62 3e 4c 75 61 3c 2f 62 3e 20 62 69  0"><b>Lua</b> bi
0b10: 6e 64 69 6e 67 20 61 76 61 69 6c 61 62 6c 65 20  nding available 
0b20: 66 72 6f 6d 20 3c 61 20 68 72 65 66 3d 22 68 74  from <a href="ht
0b30: 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d  tps://github.com
0b40: 2f 67 65 6f 66 66 6c 65 79 6c 61 6e 64 2f 6c 75  /geoffleyland/lu
0b50: 61 2d 72 65 61 64 6f 73 6d 22 3e 68 74 74 70 73  a-readosm">https
0b60: 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 67 65  ://github.com/ge
0b70: 6f 66 66 6c 65 79 6c 61 6e 64 2f 6c 75 61 2d 72  offleyland/lua-r
0b80: 65 61 64 6f 73 6d 3c 2f 61 3e 0d 0a 3c 2f 74 64  eadosm</a>..</td
0b90: 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e  ></tr>..</table>
0ba0: 3c 2f 74 64 3e 0d 0a 3c 2f 74 72 3e 3c 2f 74 61  </td>..</tr></ta
0bb0: 62 6c 65 3e 0a 5a 20 62 63 36 32 64 35 66 36 65  ble>.Z bc62d5f6e
0bc0: 36 61 62 39 38 35 61 32 61 65 62 31 37 62 64 37  6ab985a2aeb17bd7
0bd0: 64 32 64 62 39 62 32 0a                          d2db9b2.