Hex Artifact Content
Not logged in

Artifact a639d9ef16f258854d43b7114d1f6a86a5baaa90:

Wiki page [ReadOSM] by sandro 2012-07-04 12:14:21.
0000: 44 20 32 30 31 32 2d 30 37 2d 30 34 54 31 32 3a  D 2012-07-04T12:
0010: 31 34 3a 32 31 2e 38 30 36 0a 4c 20 52 65 61 64  14:21.806.L Read
0020: 4f 53 4d 0a 50 20 64 62 36 62 31 64 38 35 36 61  OSM.P db6b1d856a
0030: 36 34 36 33 64 33 32 33 34 65 38 39 61 37 30 38  6463d3234e89a708
0040: 63 35 66 36 61 31 39 32 63 32 63 62 34 39 0a 55  c5f6a192c2cb49.U
0050: 20 73 61 6e 64 72 6f 0a 57 20 32 36 38 30 0a 3c   sandro.W 2680.<
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 3c 2f 62 3e 20 28 3c 69 3e 72 65 6c 65  0.0</b> (<i>rele
0750: 61 73 65 64 20 6f 6e 20 32 30 31 32 2d 30 35 2d  ased on 2012-05-
0760: 30 35 29 3c 2f 69 3e 3c 75 6c 3e 0d 0a 3c 6c 69  05)</i><ul>..<li
0770: 3e 64 6f 77 6e 6c 6f 61 64 20 3c 61 20 68 72 65  >download <a hre
0780: 66 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 67 61  f="http://www.ga
0790: 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d 73  ia-gis.it/gaia-s
07a0: 69 6e 73 2f 72 65 61 64 6f 73 6d 2d 31 2e 30 2e  ins/readosm-1.0.
07b0: 30 2e 74 61 72 2e 67 7a 22 3e 72 65 61 64 6f 73  0.tar.gz">reados
07c0: 6d 2d 31 2e 30 2e 30 2e 74 61 72 2e 67 7a 3c 2f  m-1.0.0.tar.gz</
07d0: 61 3e 20 28 74 61 72 62 61 6c 6c 2c 20 2e 74 61  a> (tarball, .ta
07e0: 72 2e 67 7a 29 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e  r.gz)</li>..<li>
07f0: 64 6f 77 6e 6c 6f 61 64 20 3c 61 20 68 72 65 66  download <a href
0800: 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 67 61 69  ="http://www.gai
0810: 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d 73 69  a-gis.it/gaia-si
0820: 6e 73 2f 72 65 61 64 6f 73 6d 2d 31 2e 30 2e 30  ns/readosm-1.0.0
0830: 2e 7a 69 70 22 3e 72 65 61 64 6f 73 6d 2d 31 2e  .zip">readosm-1.
0840: 30 2e 30 2e 7a 69 70 3c 2f 61 3e 20 28 7a 69 70  0.0.zip</a> (zip
0850: 66 69 6c 65 2c 20 2e 7a 69 70 29 3c 2f 6c 69 3e  file, .zip)</li>
0860: 0d 0a 3c 6c 69 3e 62 72 6f 77 73 65 20 3c 61 20  ..<li>browse <a 
0870: 68 72 65 66 3d 22 68 74 74 70 3a 2f 2f 77 77 77  href="http://www
0880: 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 69  .gaia-gis.it/gai
0890: 61 2d 73 69 6e 73 2f 72 65 61 64 6f 73 6d 2d 73  a-sins/readosm-s
08a0: 6f 75 72 63 65 73 22 3e 6f 6c 64 65 72 20 76 65  ources">older ve
08b0: 72 73 69 6f 6e 73 3c 2f 61 3e 3c 2f 6c 69 3e 3c  rsions</a></li><
08c0: 2f 75 6c 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e  /ul>..</td></tr>
08d0: 0d 0a 3c 74 72 3e 3c 74 64 3e 44 6f 78 79 67 65  ..<tr><td>Doxyge
08e0: 6e 20 3c 62 3e 64 6f 63 75 6d 65 6e 74 61 74 69  n <b>documentati
08f0: 6f 6e 3c 2f 62 3e 3a 3c 75 6c 3e 0d 0a 3c 6c 69  on</b>:<ul>..<li
0900: 3e 3c 61 20 68 72 65 66 3d 22 68 74 74 70 3a 2f  ><a href="http:/
0910: 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74  /www.gaia-gis.it
0920: 2f 67 61 69 61 2d 73 69 6e 73 2f 72 65 61 64 6f  /gaia-sins/reado
0930: 73 6d 2d 31 2e 30 2e 30 2d 64 6f 78 79 2d 64 6f  sm-1.0.0-doxy-do
0940: 63 2f 69 6e 64 65 78 2e 68 74 6d 6c 22 3e 6f 6e  c/index.html">on
0950: 6c 69 6e 65 3c 2f 61 3e 20 48 54 4d 4c 20 64 6f  line</a> HTML do
0960: 63 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 61 20 68  c</li>..<li><a h
0970: 72 65 66 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e  ref="http://www.
0980: 67 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 61  gaia-gis.it/gaia
0990: 2d 73 69 6e 73 2f 72 65 61 64 6f 73 6d 2d 31 2e  -sins/readosm-1.
09a0: 30 2e 30 2d 64 6f 78 79 2d 64 6f 63 2e 74 61 72  0.0-doxy-doc.tar
09b0: 2e 67 7a 22 3e 64 6f 77 6e 6c 6f 61 64 3c 2f 61  .gz">download</a
09c0: 3e 20 48 54 4d 4c 20 74 61 72 62 61 6c 6c 20 28  > HTML tarball (
09d0: 74 61 72 2e 67 7a 29 3c 2f 6c 69 3e 0d 0a 3c 6c  tar.gz)</li>..<l
09e0: 69 3e 3c 61 20 68 72 65 66 3d 22 68 74 74 70 3a  i><a href="http:
09f0: 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69  //www.gaia-gis.i
0a00: 74 2f 67 61 69 61 2d 73 69 6e 73 2f 72 65 61 64  t/gaia-sins/read
0a10: 6f 73 6d 2d 31 2e 30 2e 30 2d 64 6f 78 79 2d 64  osm-1.0.0-doxy-d
0a20: 6f 63 2e 7a 69 70 22 3e 64 6f 77 6e 6c 6f 61 64  oc.zip">download
0a30: 3c 2f 61 3e 20 48 54 4d 4c 20 7a 69 70 66 69 6c  </a> HTML zipfil
0a40: 65 20 28 7a 69 70 29 3c 2f 6c 69 3e 0d 0a 3c 6c  e (zip)</li>..<l
0a50: 69 3e 3c 61 20 68 72 65 66 3d 22 68 74 74 70 3a  i><a href="http:
0a60: 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69  //www.gaia-gis.i
0a70: 74 2f 67 61 69 61 2d 73 69 6e 73 2f 72 65 61 64  t/gaia-sins/read
0a80: 6f 73 6d 2d 31 2e 30 2e 30 2d 64 6f 63 2e 70 64  osm-1.0.0-doc.pd
0a90: 66 22 3e 50 44 46 20 64 6f 63 75 6d 65 6e 74 3c  f">PDF document<
0aa0: 2f 61 3e 3c 2f 6c 69 3e 3c 2f 75 6c 3e 0d 0a 3c  /a></li></ul>..<
0ab0: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62  /td></tr>..</tab
0ac0: 6c 65 3e 3c 2f 74 64 3e 0d 0a 3c 2f 74 72 3e 3c  le></td>..</tr><
0ad0: 2f 74 61 62 6c 65 3e 0a 5a 20 66 30 61 64 36 61  /table>.Z f0ad6a
0ae0: 39 65 66 31 39 65 31 63 31 61 31 38 61 62 39 61  9ef19e1c1a18ab9a
0af0: 35 34 38 66 30 34 30 65 65 66 0a                 548f040eef.