Hex Artifact Content
Not logged in

Artifact 16a6e76c00e416e64f1e6bc8d258a6eb09b454c7:

Wiki page [spatialite_osm_net] by sandro 2012-05-03 19:11:57.
0000: 44 20 32 30 31 32 2d 30 35 2d 30 33 54 31 39 3a  D 2012-05-03T19:
0010: 31 31 3a 35 37 2e 31 34 35 0a 4c 20 73 70 61 74  11:57.145.L spat
0020: 69 61 6c 69 74 65 5f 6f 73 6d 5f 6e 65 74 0a 55  ialite_osm_net.U
0030: 20 73 61 6e 64 72 6f 0a 57 20 34 39 30 37 0a 62   sandro.W 4907.b
0040: 61 63 6b 20 74 6f 20 74 68 65 20 3c 61 20 68 72  ack to the <a hr
0050: 65 66 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e  ef="https://www.
0060: 67 61 69 61 2d 67 69 73 2e 69 74 2f 66 6f 73 73  gaia-gis.it/foss
0070: 69 6c 2f 73 70 61 74 69 61 6c 69 74 65 2d 74 6f  il/spatialite-to
0080: 6f 6c 73 2f 77 69 6b 69 3f 6e 61 6d 65 3d 4f 53  ols/wiki?name=OS
0090: 4d 2b 74 6f 6f 6c 73 22 3e 4f 53 4d 20 74 6f 6f  M+tools">OSM too
00a0: 6c 73 3c 2f 61 3e 20 6d 61 69 6e 20 70 61 67 65  ls</a> main page
00b0: 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 68 33 3e 73 70  <br><br>..<h3>sp
00c0: 61 74 69 61 6c 69 74 65 5f 6f 73 6d 5f 66 69 6c  atialite_osm_fil
00d0: 74 65 72 3c 2f 68 33 3e 0d 0a 3c 62 3e 3c 69 3e  ter</h3>..<b><i>
00e0: 3c 75 3e 53 79 6e 74 61 78 3a 3c 2f 75 3e 3c 2f  <u>Syntax:</u></
00f0: 69 3e 3c 2f 62 3e 0d 0a 3c 74 61 62 6c 65 20 62  i></b>..<table b
0100: 6f 72 64 65 72 3d 22 31 22 3e 3c 74 72 3e 3c 74  order="1"><tr><t
0110: 64 3e 3c 70 72 65 3e 0d 0a 75 73 61 67 65 3a 20  d><pre>..usage: 
0120: 73 70 61 74 69 61 6c 69 74 65 5f 6f 73 6d 5f 6e  spatialite_osm_n
0130: 65 74 20 41 52 47 4c 49 53 54 0d 0a 3d 3d 3d 3d  et ARGLIST..====
0140: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0150: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0160: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d  ================
0170: 3d 3d 3d 3d 3d 3d 3d 3d 3d 3d 0d 0a 2d 68 20 6f  ==========..-h o
0180: 72 20 2d 2d 68 65 6c 70 20 20 20 20 20 20 20 20  r --help        
0190: 20 20 20 20 20 20 20 20 20 20 20 20 70 72 69 6e              prin
01a0: 74 20 74 68 69 73 20 68 65 6c 70 20 6d 65 73 73  t this help mess
01b0: 61 67 65 0d 0a 2d 6f 20 6f 72 20 2d 2d 6f 73 6d  age..-o or --osm
01c0: 2d 70 61 74 68 20 70 61 74 68 6e 61 6d 65 20 20  -path pathname  
01d0: 20 20 20 20 20 74 68 65 20 4f 53 4d 2d 58 4d 4c       the OSM-XML
01e0: 20 66 69 6c 65 20 70 61 74 68 0d 0a 20 20 20 20   file path..    
01f0: 20 20 20 20 20 20 20 20 20 20 20 20 20 62 6f 74               bot
0200: 68 20 4f 53 4d 2d 58 4d 4c 20 28 2a 2e 6f 73 6d  h OSM-XML (*.osm
0210: 29 20 61 6e 64 20 4f 53 4d 2d 50 72 6f 74 6f 42  ) and OSM-ProtoB
0220: 75 66 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20  uf..            
0230: 20 20 20 20 20 28 2a 2e 6f 73 6d 2e 70 62 66 29       (*.osm.pbf)
0240: 20 61 72 65 20 69 6e 64 69 66 66 65 72 65 6e 63   are indifferenc
0250: 74 6c 79 20 73 75 70 70 6f 72 74 65 64 2e 0d 0a  tly supported...
0260: 2d 64 20 6f 72 20 2d 2d 64 62 2d 70 61 74 68 20  -d or --db-path 
0270: 20 70 61 74 68 6e 61 6d 65 20 20 20 20 20 20 20   pathname       
0280: 74 68 65 20 53 70 61 74 69 61 4c 69 74 65 20 44  the SpatiaLite D
0290: 42 20 70 61 74 68 0d 0a 2d 54 20 6f 72 20 2d 2d  B path..-T or --
02a0: 74 61 62 6c 65 20 20 20 20 74 61 62 6c 65 5f 6e  table    table_n
02b0: 61 6d 65 20 20 20 20 20 74 68 65 20 64 62 20 74  ame     the db t
02c0: 61 62 6c 65 20 74 6f 20 62 65 20 66 65 65 64 65  able to be feede
02d0: 64 0d 0a 0d 0a 79 6f 75 20 63 61 6e 20 73 70 65  d....you can spe
02e0: 63 69 66 79 20 74 68 65 20 66 6f 6c 6c 6f 77 69  cify the followi
02f0: 6e 67 20 6f 70 74 69 6f 6e 73 20 61 73 20 77 65  ng options as we
0300: 6c 6c 0d 0a 2d 63 73 20 6f 72 20 2d 2d 63 61 63  ll..-cs or --cac
0310: 68 65 2d 73 69 7a 65 20 20 20 20 6e 75 6d 20 20  he-size    num  
0320: 20 20 20 20 44 42 20 63 61 63 68 65 20 73 69 7a      DB cache siz
0330: 65 20 28 68 6f 77 20 6d 61 6e 79 20 70 61 67 65  e (how many page
0340: 73 29 0d 0a 2d 6d 20 6f 72 20 2d 2d 69 6e 2d 6d  s)..-m or --in-m
0350: 65 6d 6f 72 79 20 20 20 20 20 20 20 20 20 20 20  emory           
0360: 20 20 20 20 75 73 69 6e 67 20 49 4e 2d 4d 45 4d      using IN-MEM
0370: 4f 52 59 20 64 61 74 61 62 61 73 65 0d 0a 2d 32  ORY database..-2
0380: 20 6f 72 20 2d 2d 75 6e 64 69 72 65 63 74 69 6f   or --undirectio
0390: 6e 61 6c 20 20 20 20 20 20 20 20 20 20 20 64 6f  nal           do
03a0: 75 62 6c 65 20 61 72 63 73 0d 0a 2d 2d 72 6f 61  uble arcs..--roa
03b0: 64 73 20 20 20 20 20 20 20 20 20 20 20 20 20 20  ds              
03c0: 20 20 20 20 20 20 20 20 20 20 20 65 78 74 72 61             extra
03d0: 63 74 20 72 6f 61 64 73 20 28 64 65 66 61 75 6c  ct roads (defaul
03e0: 74 29 0d 0a 2d 2d 72 61 69 6c 77 61 79 73 20 20  t)..--railways  
03f0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
0400: 20 20 20 20 65 78 74 72 61 63 74 20 72 61 69 6c      extract rail
0410: 77 61 79 73 0d 0a 20 20 20 20 20 20 20 20 20 20  ways..          
0420: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                  
0430: 20 20 20 20 20 20 28 6d 75 74 75 61 6c 6c 79 20        (mutually 
0440: 65 78 63 6c 75 73 69 76 65 29 0d 0a 74 65 6d 70  exclusive)..temp
0450: 6c 61 74 65 2d 66 69 6c 65 20 73 70 65 63 69 66  late-file specif
0460: 69 63 20 6f 70 74 69 6f 6e 73 3a 0d 0a 2d 6f 74  ic options:..-ot
0470: 20 6f 72 20 2d 2d 6f 75 74 2d 74 65 6d 70 6c 61   or --out-templa
0480: 74 65 20 20 70 61 74 68 20 20 20 20 20 63 72 65  te  path     cre
0490: 61 74 65 73 20 61 20 64 65 66 61 75 6c 74 20 74  ates a default t
04a0: 65 6d 70 6c 61 74 65 2d 66 69 6c 65 0d 0a 2d 74  emplate-file..-t
04b0: 66 20 6f 72 20 2d 2d 74 65 6d 70 6c 61 74 65 2d  f or --template-
04c0: 66 69 6c 65 20 70 61 74 68 20 20 20 20 20 75 73  file path     us
04d0: 69 6e 67 20 61 20 74 65 6d 70 6c 61 74 65 2d 66  ing a template-f
04e0: 69 6c 65 0d 0a 3c 2f 70 72 65 3e 3c 2f 74 64 3e  ile..</pre></td>
04f0: 3c 2f 74 72 3e 3c 2f 74 61 62 6c 65 3e 3c 62 72  </tr></table><br
0500: 3e 0d 0a 3c 62 3e 3c 69 3e 3c 75 3e 45 78 61 6d  >..<b><i><u>Exam
0510: 70 6c 65 3a 3c 2f 75 3e 3c 2f 69 3e 3c 2f 62 3e  ple:</u></i></b>
0520: 0d 0a 3c 74 61 62 6c 65 20 62 6f 72 64 65 72 3d  ..<table border=
0530: 22 31 22 3e 3c 74 72 3e 3c 74 64 3e 3c 70 72 65  "1"><tr><td><pre
0540: 3e 0d 0a 24 20 73 70 61 74 69 61 6c 69 74 65 5f  >..$ spatialite_
0550: 6f 73 6d 5f 6e 65 74 20 2d 6f 20 6d 79 5f 63 6f  osm_net -o my_co
0560: 75 6e 74 72 79 2e 6f 73 6d 2e 70 62 66 20 2d 64  untry.osm.pbf -d
0570: 20 6d 79 5f 63 6f 75 6e 74 72 79 2e 73 71 6c 69   my_country.sqli
0580: 74 65 20 2d 54 20 72 6f 61 64 73 0d 0a 53 51 4c  te -T roads..SQL
0590: 69 74 65 20 76 65 72 73 69 6f 6e 3a 20 33 2e 37  ite version: 3.7
05a0: 2e 31 31 0d 0a 53 70 61 74 69 61 4c 69 74 65 20  .11..SpatiaLite 
05b0: 76 65 72 73 69 6f 6e 3a 20 33 2e 31 2e 30 0d 0a  version: 3.1.0..
05c0: 50 61 72 73 69 6e 67 20 69 6e 70 75 74 3a 20 50  Parsing input: P
05d0: 61 73 73 20 31 20 28 4e 6f 64 65 73 20 61 6e 64  ass 1 (Nodes and
05e0: 20 57 61 79 73 29 20 2e 2e 2e 0d 0a 50 61 72 73   Ways) .....Pars
05f0: 69 6e 67 20 69 6e 70 75 74 3a 20 50 61 73 73 20  ing input: Pass 
0600: 32 20 28 41 72 63 73 20 6f 66 20 74 68 65 20 47  2 (Arcs of the G
0610: 72 61 70 68 29 20 2e 2e 2e 0d 0a 43 72 65 61 74  raph) .....Creat
0620: 69 6e 67 20 68 65 6c 70 65 72 20 74 61 62 6c 65  ing helper table
0630: 20 27 72 6f 61 64 73 5f 6e 6f 64 65 73 27 20 2e   'roads_nodes' .
0640: 2e 2e 20 77 61 69 74 20 70 6c 65 61 73 65 20 2e  .. wait please .
0650: 2e 2e 0d 0a 20 20 20 20 20 20 20 20 48 65 6c 70  ....        Help
0660: 65 72 20 74 61 62 6c 65 20 27 72 6f 61 64 73 5f  er table 'roads_
0670: 6e 6f 64 65 73 27 20 73 75 63 63 65 73 66 75 6c  nodes' succesful
0680: 6c 79 20 63 72 65 61 74 65 64 0d 0a 44 72 6f 70  ly created..Drop
0690: 70 69 6e 67 20 74 65 6d 70 6f 72 61 72 79 20 74  ping temporary t
06a0: 61 62 6c 65 20 27 6f 73 6d 5f 74 6d 70 5f 6e 6f  able 'osm_tmp_no
06b0: 64 65 73 27 20 2e 2e 2e 20 77 61 69 74 20 70 6c  des' ... wait pl
06c0: 65 61 73 65 20 2e 2e 2e 0d 0a 20 20 20 20 20 20  ease .....      
06d0: 20 20 44 72 6f 70 70 65 64 20 74 61 62 6c 65 20    Dropped table 
06e0: 27 6f 73 6d 5f 74 6d 70 5f 6e 6f 64 65 73 27 0d  'osm_tmp_nodes'.
06f0: 0a 44 72 6f 70 70 69 6e 67 20 74 65 6d 70 6f 72  .Dropping tempor
0700: 61 72 79 20 74 61 62 6c 65 20 27 67 72 61 70 68  ary table 'graph
0710: 5f 6e 6f 64 65 73 27 20 2e 2e 2e 20 77 61 69 74  _nodes' ... wait
0720: 20 70 6c 65 61 73 65 20 2e 2e 2e 0d 0a 20 20 20   please .....   
0730: 20 20 20 20 20 44 72 6f 70 70 65 64 20 74 61 62       Dropped tab
0740: 6c 65 20 27 67 72 61 70 68 5f 6e 6f 64 65 73 27  le 'graph_nodes'
0750: 0d 0a 56 41 43 55 55 4d 69 6e 67 20 74 68 65 20  ..VACUUMing the 
0760: 44 42 20 2e 2e 2e 20 77 61 69 74 20 70 6c 65 61  DB ... wait plea
0770: 73 65 20 2e 2e 2e 0d 0a 20 20 20 20 20 20 20 20  se .....        
0780: 41 6c 6c 20 64 6f 6e 65 3a 20 4f 53 4d 20 67 72  All done: OSM gr
0790: 61 70 68 20 77 61 73 20 73 75 63 63 65 73 66 75  aph was succesfu
07a0: 6c 6c 79 20 6c 6f 61 64 65 64 0d 0a 24 0d 0a 3c  lly loaded..$..<
07b0: 2f 70 72 65 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 3c  /pre></td></tr><
07c0: 2f 74 61 62 6c 65 3e 3c 62 72 3e 0d 0a 74 68 65  /table><br>..the
07d0: 20 61 62 6f 76 65 20 73 68 6f 77 6e 20 63 6f 6d   above shown com
07e0: 6d 61 6e 64 20 6d 75 73 74 20 62 65 20 69 6e 76  mand must be inv
07f0: 6f 6b 65 64 20 66 72 6f 6d 20 74 68 65 20 73 68  oked from the sh
0800: 65 6c 6c 3a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 3c 62  ell:<ul>..<li><b
0810: 3e 2d 6f 20 6d 79 5f 63 6f 75 6e 74 72 79 2e 6f  >-o my_country.o
0820: 73 6d 2e 70 62 66 3c 2f 62 3e 20 73 65 6c 65 63  sm.pbf</b> selec
0830: 74 73 20 74 68 65 20 4f 53 4d 20 69 6e 70 75 74  ts the OSM input
0840: 20 66 69 6c 65 20 28 69 6e 20 74 68 69 73 20 63   file (in this c
0850: 61 73 65 2c 20 6f 66 20 74 68 65 20 4f 53 4d 2d  ase, of the OSM-
0860: 70 72 6f 74 6f 62 75 66 20 66 6f 72 6d 61 74 29  protobuf format)
0870: 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 2d  .</li>..<li><b>-
0880: 64 20 6d 79 5f 63 6f 75 6e 74 72 79 2e 73 71 6c  d my_country.sql
0890: 69 74 65 3c 2f 62 3e 20 73 65 6c 65 63 74 73 20  ite</b> selects 
08a0: 74 68 65 20 53 70 61 74 69 61 4c 69 74 65 27 73  the SpatiaLite's
08b0: 20 44 42 2d 66 69 6c 65 20 74 6f 20 62 65 20 63   DB-file to be c
08c0: 72 65 61 74 65 64 20 61 6e 64 20 70 6f 70 75 6c  reated and popul
08d0: 61 74 65 64 2e 3c 2f 6c 69 3e 20 0d 0a 3c 6c 69  ated.</li> ..<li
08e0: 3e 3c 62 3e 2d 54 20 72 6f 61 64 73 3c 2f 62 3e  ><b>-T roads</b>
08f0: 20 73 70 65 63 69 66 69 65 73 20 74 68 65 20 74   specifies the t
0900: 61 62 6c 65 20 70 72 65 66 69 78 20 74 6f 20 62  able prefix to b
0910: 65 20 75 73 65 64 20 66 6f 72 20 74 68 65 20 47  e used for the G
0920: 72 61 70 68 2f 4e 65 74 77 6f 72 6b 20 74 6f 20  raph/Network to 
0930: 62 65 20 63 72 65 61 74 65 64 2e 3c 2f 6c 69 3e  be created.</li>
0940: 0d 0a 3c 6c 69 3e 79 6f 75 20 63 61 6e 20 65 76  ..<li>you can ev
0950: 65 6e 74 75 61 6c 6c 79 20 61 64 64 20 61 6e 79  entually add any
0960: 20 6f 74 68 65 72 20 44 42 2d 72 65 6c 61 74 65   other DB-relate
0970: 64 20 6f 70 74 69 6d 69 7a 61 74 69 6f 6e 20 73  d optimization s
0980: 77 69 74 63 68 2c 20 69 66 20 79 6f 75 20 74 68  witch, if you th
0990: 69 6e 6b 20 69 74 20 77 69 6c 6c 20 62 65 20 75  ink it will be u
09a0: 73 65 66 75 6c 2e 3c 62 72 3e 0d 0a 57 61 6e 74  seful.<br>..Want
09b0: 20 74 6f 20 6c 65 61 72 6e 20 6d 6f 72 65 20 3f   to learn more ?
09c0: 20 72 65 61 64 20 74 68 65 20 3c 61 20 68 72 65   read the <a hre
09d0: 66 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67  f="https://www.g
09e0: 61 69 61 2d 67 69 73 2e 69 74 2f 66 6f 73 73 69  aia-gis.it/fossi
09f0: 6c 2f 73 70 61 74 69 61 6c 69 74 65 2d 74 6f 6f  l/spatialite-too
0a00: 6c 73 2f 77 69 6b 69 3f 6e 61 6d 65 3d 64 62 2d  ls/wiki?name=db-
0a10: 6f 70 74 69 6d 69 7a 61 74 69 6f 6e 22 3e 44 42  optimization">DB
0a20: 20 6f 70 74 69 6d 69 7a 61 74 69 6f 6e 3c 2f 61   optimization</a
0a30: 3e 20 73 68 6f 72 74 20 6e 6f 74 65 0d 0a 3c 2f  > short note..</
0a40: 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 62 72 3e 0d 0a  li>..</ul><br>..
0a50: 3c 75 3e 50 6c 65 61 73 65 20 6e 6f 74 65 3a 3c  <u>Please note:<
0a60: 2f 75 3e 20 73 6f 6d 65 74 69 6d 65 73 20 79 6f  /u> sometimes yo
0a70: 75 20 63 61 6e 20 6e 6f 74 69 63 65 20 6d 61 6e  u can notice man
0a80: 79 20 3c 69 3e 55 6e 72 65 73 6f 6c 76 65 64 2d  y <i>Unresolved-
0a90: 4e 6f 64 65 3c 2f 69 3e 20 6f 72 20 3c 69 3e 55  Node</i> or <i>U
0aa0: 6e 72 65 73 6f 6c 76 65 64 2d 57 61 79 3c 2f 69  nresolved-Way</i
0ab0: 3e 20 77 61 72 6e 69 6e 67 20 6d 65 73 73 61 67  > warning messag
0ac0: 65 73 3a 20 64 6f 6e 74 20 62 65 20 74 6f 6f 20  es: dont be too 
0ad0: 6d 75 63 68 20 77 6f 72 72 69 65 64 2e 3c 62 72  much worried.<br
0ae0: 3e 0d 0a 54 68 69 73 20 73 69 6d 70 6c 79 20 6d  >..This simply m
0af0: 65 61 6e 73 20 74 68 61 74 20 79 6f 75 72 20 4f  eans that your O
0b00: 53 4d 20 69 6e 70 75 74 20 66 69 6c 65 20 64 6f  SM input file do
0b10: 65 73 20 61 63 74 75 61 6c 6c 79 20 63 6f 6e 74  es actually cont
0b20: 61 69 6e 73 20 73 65 76 65 72 61 6c 20 62 72 6f  ains several bro
0b30: 6b 65 6e 20 63 72 6f 73 73 2d 72 65 66 65 72 65  ken cross-refere
0b40: 6e 63 65 73 20 28 69 2e 65 2e 20 69 6e 76 61 6c  nces (i.e. inval
0b50: 69 64 20 63 6f 6d 70 6c 65 78 20 4d 61 70 20 6f  id complex Map o
0b60: 62 6a 65 63 74 73 29 2e 3c 62 72 3e 0d 0a 54 68  bjects).<br>..Th
0b70: 69 73 20 6f 6e 65 20 69 73 20 61 20 71 75 69 74  is one is a quit
0b80: 65 20 63 6f 6d 6d 6f 6e 20 73 69 74 75 61 74 69  e common situati
0b90: 6f 6e 2c 20 62 75 74 20 69 74 27 73 20 72 61 74  on, but it's rat
0ba0: 68 65 72 20 69 6e 6e 6f 63 75 6f 75 73 20 28 69  her innocuous (i
0bb0: 6e 76 61 6c 69 64 20 6f 62 6a 65 63 74 73 20 77  nvalid objects w
0bc0: 69 6c 6c 20 62 65 20 73 69 6d 70 6c 79 20 69 67  ill be simply ig
0bd0: 6e 6f 72 65 64 2c 20 66 75 6c 6c 79 20 70 72 65  nored, fully pre
0be0: 73 65 72 76 69 6e 67 20 61 6e 79 20 6f 74 68 65  serving any othe
0bf0: 72 20 76 61 6c 69 64 20 6f 62 6a 65 63 74 29 2e  r valid object).
0c00: 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 62 3e 3c 69 3e  <br><br>..<b><i>
0c10: 3c 75 3e 41 6e 6f 74 68 65 72 20 65 78 61 6d 70  <u>Another examp
0c20: 6c 65 3a 3c 2f 75 3e 3c 2f 69 3e 3c 2f 62 3e 0d  le:</u></i></b>.
0c30: 0a 3c 74 61 62 6c 65 20 62 6f 72 64 65 72 3d 22  .<table border="
0c40: 31 22 3e 3c 74 72 3e 3c 74 64 3e 3c 70 72 65 3e  1"><tr><td><pre>
0c50: 0d 0a 24 20 20 73 70 61 74 69 61 6c 69 74 65 5f  ..$  spatialite_
0c60: 6f 73 6d 5f 6e 65 74 20 2d 6f 20 6d 79 5f 63 6f  osm_net -o my_co
0c70: 75 6e 74 72 79 2e 6f 73 6d 2e 70 62 66 20 2d 64  untry.osm.pbf -d
0c80: 20 6d 79 5f 63 6f 75 6e 74 72 79 2e 73 71 6c 69   my_country.sqli
0c90: 74 65 20 2d 54 20 72 61 69 6c 73 20 2d 2d 72 61  te -T rails --ra
0ca0: 69 6c 77 61 79 73 0d 0a 53 51 4c 69 74 65 20 76  ilways..SQLite v
0cb0: 65 72 73 69 6f 6e 3a 20 33 2e 37 2e 31 31 0d 0a  ersion: 3.7.11..
0cc0: 53 70 61 74 69 61 4c 69 74 65 20 76 65 72 73 69  SpatiaLite versi
0cd0: 6f 6e 3a 20 33 2e 31 2e 30 0d 0a 50 61 72 73 69  on: 3.1.0..Parsi
0ce0: 6e 67 20 69 6e 70 75 74 3a 20 50 61 73 73 20 31  ng input: Pass 1
0cf0: 20 28 4e 6f 64 65 73 20 61 6e 64 20 57 61 79 73   (Nodes and Ways
0d00: 29 20 2e 2e 2e 0d 0a 50 61 72 73 69 6e 67 20 69  ) .....Parsing i
0d10: 6e 70 75 74 3a 20 50 61 73 73 20 32 20 28 41 72  nput: Pass 2 (Ar
0d20: 63 73 20 6f 66 20 74 68 65 20 47 72 61 70 68 29  cs of the Graph)
0d30: 20 2e 2e 2e 0d 0a 43 72 65 61 74 69 6e 67 20 68   .....Creating h
0d40: 65 6c 70 65 72 20 74 61 62 6c 65 20 27 72 61 69  elper table 'rai
0d50: 6c 73 5f 6e 6f 64 65 73 27 20 2e 2e 2e 20 77 61  ls_nodes' ... wa
0d60: 69 74 20 70 6c 65 61 73 65 20 2e 2e 2e 0d 0a 20  it please ..... 
0d70: 20 20 20 20 20 20 20 48 65 6c 70 65 72 20 74 61         Helper ta
0d80: 62 6c 65 20 27 72 61 69 6c 73 5f 6e 6f 64 65 73  ble 'rails_nodes
0d90: 27 20 73 75 63 63 65 73 66 75 6c 6c 79 20 63 72  ' succesfully cr
0da0: 65 61 74 65 64 0d 0a 44 72 6f 70 70 69 6e 67 20  eated..Dropping 
0db0: 74 65 6d 70 6f 72 61 72 79 20 74 61 62 6c 65 20  temporary table 
0dc0: 27 6f 73 6d 5f 74 6d 70 5f 6e 6f 64 65 73 27 20  'osm_tmp_nodes' 
0dd0: 2e 2e 2e 20 77 61 69 74 20 70 6c 65 61 73 65 20  ... wait please 
0de0: 2e 2e 2e 0d 0a 20 20 20 20 20 20 20 20 44 72 6f  .....        Dro
0df0: 70 70 65 64 20 74 61 62 6c 65 20 27 6f 73 6d 5f  pped table 'osm_
0e00: 74 6d 70 5f 6e 6f 64 65 73 27 0d 0a 44 72 6f 70  tmp_nodes'..Drop
0e10: 70 69 6e 67 20 74 65 6d 70 6f 72 61 72 79 20 74  ping temporary t
0e20: 61 62 6c 65 20 27 67 72 61 70 68 5f 6e 6f 64 65  able 'graph_node
0e30: 73 27 20 2e 2e 2e 20 77 61 69 74 20 70 6c 65 61  s' ... wait plea
0e40: 73 65 20 2e 2e 2e 0d 0a 20 20 20 20 20 20 20 20  se .....        
0e50: 44 72 6f 70 70 65 64 20 74 61 62 6c 65 20 27 67  Dropped table 'g
0e60: 72 61 70 68 5f 6e 6f 64 65 73 27 0d 0a 56 41 43  raph_nodes'..VAC
0e70: 55 55 4d 69 6e 67 20 74 68 65 20 44 42 20 2e 2e  UUMing the DB ..
0e80: 2e 20 77 61 69 74 20 70 6c 65 61 73 65 20 2e 2e  . wait please ..
0e90: 2e 0d 0a 20 20 20 20 20 20 20 20 41 6c 6c 20 64  ...        All d
0ea0: 6f 6e 65 3a 20 4f 53 4d 20 67 72 61 70 68 20 77  one: OSM graph w
0eb0: 61 73 20 73 75 63 63 65 73 66 75 6c 6c 79 20 6c  as succesfully l
0ec0: 6f 61 64 65 64 0d 0a 24 0d 0a 3c 2f 70 72 65 3e  oaded..$..</pre>
0ed0: 3c 2f 74 64 3e 3c 2f 74 72 3e 3c 2f 74 61 62 6c  </td></tr></tabl
0ee0: 65 3e 3c 62 72 3e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c  e><br>..<ul>..<l
0ef0: 69 3e 69 6e 20 74 68 65 20 70 72 65 76 69 6f 75  i>in the previou
0f00: 73 20 65 78 61 6d 70 6c 65 20 77 65 27 76 65 20  s example we've 
0f10: 63 72 65 61 74 65 64 20 66 72 6f 6d 20 73 63 72  created from scr
0f20: 61 74 63 68 20 61 20 6e 65 77 20 44 42 2d 66 69  atch a new DB-fi
0f30: 6c 65 20 63 6f 6e 74 61 69 6e 69 6e 67 20 61 20  le containing a 
0f40: 3c 75 3e 3c 69 3e 52 6f 61 64 20 4e 65 74 77 6f  <u><i>Road Netwo
0f50: 72 6b 3c 2f 69 3e 3c 2f 75 3e 3c 2f 6c 69 3e 0d  rk</i></u></li>.
0f60: 0a 3c 6c 69 3e 3c 62 3e 2d 54 20 72 6f 61 64 73  .<li><b>-T roads
0f70: 3c 2f 62 3e 20 73 70 65 63 69 66 69 65 73 20 74  </b> specifies t
0f80: 68 65 20 74 61 62 6c 65 20 70 72 65 66 69 78 20  he table prefix 
0f90: 74 6f 20 62 65 20 75 73 65 64 20 66 6f 72 20 74  to be used for t
0fa0: 68 65 20 47 72 61 70 68 2f 4e 65 74 77 6f 72 6b  he Graph/Network
0fb0: 20 74 6f 20 62 65 20 63 72 65 61 74 65 64 2e 3c   to be created.<
0fc0: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 79 6f 75 20 63 61  /li>..<li>you ca
0fd0: 6e 20 65 76 65 6e 74 75 61 6c 6c 79 20 61 64 64  n eventually add
0fe0: 20 61 6e 79 20 6f 74 68 65 72 20 44 42 2d 72 65   any other DB-re
0ff0: 6c 61 74 65 64 20 6f 70 74 69 6d 69 7a 61 74 69  lated optimizati
1000: 6f 6e 20 73 77 69 74 63 68 2c 20 69 66 20 79 6f  on switch, if yo
1010: 75 20 74 68 69 6e 6b 20 69 74 20 77 69 6c 6c 20  u think it will 
1020: 62 65 20 75 73 65 66 75 6c 2e 3c 62 72 3e 0d 0a  be useful.<br>..
1030: 57 61 6e 74 20 74 6f 20 6c 65 61 72 6e 20 6d 6f  Want to learn mo
1040: 72 65 20 3f 20 72 65 61 64 20 74 68 65 20 3c 61  re ? read the <a
1050: 20 68 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f 77   href="https://w
1060: 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 66  ww.gaia-gis.it/f
1070: 6f 73 73 69 6c 2f 73 70 61 74 69 61 6c 69 74 65  ossil/spatialite
1080: 2d 74 6f 6f 6c 73 2f 77 69 6b 69 3f 6e 61 6d 65  -tools/wiki?name
1090: 3d 64 62 2d 6f 70 74 69 6d 69 7a 61 74 69 6f 6e  =db-optimization
10a0: 22 3e 44 42 20 6f 70 74 69 6d 69 7a 61 74 69 6f  ">DB optimizatio
10b0: 6e 3c 2f 61 3e 20 73 68 6f 72 74 20 6e 6f 74 65  n</a> short note
10c0: 0d 0a 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 62  ..</li>..</ul><b
10d0: 72 3e 0d 0a 4f 6e 63 65 20 74 68 65 20 63 6f 6d  r>..Once the com
10e0: 6d 61 6e 64 20 73 75 63 63 65 73 66 75 6c 6c 79  mand succesfully
10f0: 20 63 6f 6d 70 6c 65 74 65 73 20 69 74 73 20 65   completes its e
1100: 78 65 63 75 74 69 6f 6e 2c 20 79 6f 75 27 6c 6c  xecution, you'll
1110: 20 66 69 6e 64 20 61 20 62 72 61 6e 64 20 6e 65   find a brand ne
1120: 77 20 44 42 2d 66 69 6c 65 20 6a 75 73 74 20 63  w DB-file just c
1130: 72 65 61 74 65 64 20 2e 2e 2e 3c 62 72 3e 3c 62  reated ...<br><b
1140: 72 3e 0d 0a 3c 69 6d 67 20 73 72 63 3d 22 68 74  r>..<img src="ht
1150: 74 70 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69  tp://www.gaia-gi
1160: 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e 73 2f 67  s.it/gaia-sins/g
1170: 72 61 70 68 2d 70 69 63 73 2f 64 62 2d 6d 61 70  raph-pics/db-map
1180: 2e 70 6e 67 22 20 61 6c 74 3d 22 64 62 2d 6d 61  .png" alt="db-ma
1190: 70 2e 70 6e 67 22 20 62 6f 72 64 65 72 3d 22 31  p.png" border="1
11a0: 22 3e 3c 62 72 3e 0d 0a 2e 2e 2e 20 79 6f 75 20  "><br>..... you 
11b0: 63 61 6e 20 65 78 70 6c 6f 72 65 20 74 68 69 73  can explore this
11c0: 20 44 42 2d 66 69 6c 65 20 65 2e 67 2e 20 75 73   DB-file e.g. us
11d0: 69 6e 67 20 3c 75 3e 3c 62 3e 73 70 61 74 69 61  ing <u><b>spatia
11e0: 6c 69 74 65 5f 67 75 69 3c 2f 62 3e 3c 2f 75 3e  lite_gui</b></u>
11f0: 20 2e 2e 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 69   ...<br><br>..<i
1200: 6d 67 20 73 72 63 3d 22 68 74 74 70 3a 2f 2f 77  mg src="http://w
1210: 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 67  ww.gaia-gis.it/g
1220: 61 69 61 2d 73 69 6e 73 2f 67 72 61 70 68 2d 70  aia-sins/graph-p
1230: 69 63 73 2f 6f 73 6d 2d 6d 61 70 2e 70 6e 67 22  ics/osm-map.png"
1240: 20 61 6c 74 3d 22 6f 73 6d 2d 6d 61 70 2e 70 6e   alt="osm-map.pn
1250: 67 22 20 62 6f 72 64 65 72 3d 22 31 22 3e 3c 62  g" border="1"><b
1260: 72 3e 0d 0a 2e 2e 2e 20 6f 72 20 79 6f 75 20 63  r>..... or you c
1270: 61 6e 20 63 6f 6e 6e 65 63 74 20 74 68 65 20 44  an connect the D
1280: 42 2d 66 69 6c 65 20 74 6f 20 61 20 6d 6f 72 65  B-file to a more
1290: 20 63 6f 6e 76 65 6e 74 69 6f 6e 61 6c 20 64 65   conventional de
12a0: 73 6b 74 6f 70 20 47 49 53 20 73 75 63 68 20 61  sktop GIS such a
12b0: 73 20 51 47 49 53 2c 20 73 6f 20 74 6f 20 69 6d  s QGIS, so to im
12c0: 6d 65 64 69 61 74 65 6c 79 20 73 65 65 20 79 6f  mediately see yo
12d0: 75 72 20 6d 61 70 20 61 70 70 65 61 72 69 6e 67  ur map appearing
12e0: 20 6f 6e 20 74 68 65 20 73 63 72 65 65 6e 2e 0d   on the screen..
12f0: 0a 3c 62 72 3e 3c 62 72 3e 62 61 63 6b 20 74 6f  .<br><br>back to
1300: 20 74 68 65 20 3c 61 20 68 72 65 66 3d 22 68 74   the <a href="ht
1310: 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67  tps://www.gaia-g
1320: 69 73 2e 69 74 2f 66 6f 73 73 69 6c 2f 73 70 61  is.it/fossil/spa
1330: 74 69 61 6c 69 74 65 2d 74 6f 6f 6c 73 2f 77 69  tialite-tools/wi
1340: 6b 69 3f 6e 61 6d 65 3d 4f 53 4d 2b 74 6f 6f 6c  ki?name=OSM+tool
1350: 73 22 3e 4f 53 4d 20 74 6f 6f 6c 73 3c 2f 61 3e  s">OSM tools</a>
1360: 20 6d 61 69 6e 20 70 61 67 65 0a 5a 20 34 38 31   main page.Z 481
1370: 61 38 33 61 37 65 63 64 39 65 61 30 31 61 32 30  a83a7ecd9ea01a20
1380: 66 36 34 37 36 35 38 35 38 66 39 30 62 0a        f64765858f90b.