Wiki page
[Supporting GeoJSON] by
sandro
2019-01-22 11:08:26.
0000: 44 20 32 30 31 39 2d 30 31 2d 32 32 54 31 31 3a D 2019-01-22T11:
0010: 30 38 3a 32 36 2e 31 39 32 0a 4c 20 53 75 70 70 08:26.192.L Supp
0020: 6f 72 74 69 6e 67 5c 73 47 65 6f 4a 53 4f 4e 0a orting\sGeoJSON.
0030: 50 20 66 65 39 36 35 66 33 66 32 66 38 66 30 36 P fe965f3f2f8f06
0040: 64 30 65 34 33 64 66 37 31 37 33 32 37 62 38 64 d0e43df717327b8d
0050: 65 39 62 37 35 38 39 36 62 34 0a 55 20 73 61 6e e9b75896b4.U san
0060: 64 72 6f 0a 57 20 32 30 34 31 31 0a 3c 61 20 68 dro.W 20411.<a h
0070: 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 ref="https://www
0080: 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 66 6f 73 .gaia-gis.it/fos
0090: 73 69 6c 2f 6c 69 62 73 70 61 74 69 61 6c 69 74 sil/libspatialit
00a0: 65 2f 77 69 6b 69 3f 6e 61 6d 65 3d 34 2e 33 2e e/wiki?name=4.3.
00b0: 30 2d 64 6f 63 22 3e 62 61 63 6b 3c 2f 61 3e 3c 0-doc">back</a><
00c0: 68 72 3e 3c 62 72 3e 0d 0a 3c 68 31 3e 49 6e 74 hr><br>..<h1>Int
00d0: 72 6f 64 75 63 74 69 6f 6e 3c 2f 68 31 3e 0d 0a roduction</h1>..
00e0: 3c 61 20 68 72 65 66 3d 22 68 74 74 70 73 3a 2f <a href="https:/
00f0: 2f 65 6e 2e 77 69 6b 69 70 65 64 69 61 2e 6f 72 /en.wikipedia.or
0100: 67 2f 77 69 6b 69 2f 47 65 6f 4a 53 4f 4e 22 3e g/wiki/GeoJSON">
0110: 47 65 6f 4a 53 4f 4e 3c 2f 61 3e 20 69 73 20 61 GeoJSON</a> is a
0120: 6e 20 6f 70 65 6e 20 73 74 61 6e 64 61 72 64 20 n open standard
0130: 64 61 74 61 20 66 6f 72 6d 61 74 20 62 61 73 65 data format base
0140: 64 20 6f 6e 20 3c 61 20 68 72 65 66 3d 22 68 74 d on <a href="ht
0150: 74 70 73 3a 2f 2f 65 6e 2e 77 69 6b 69 70 65 64 tps://en.wikiped
0160: 69 61 2e 6f 72 67 2f 77 69 6b 69 2f 4a 53 4f 4e ia.org/wiki/JSON
0170: 22 3e 4a 53 4f 4e 3c 2f 61 3e 20 28 3c 62 3e 4a ">JSON</a> (<b>J
0180: 61 76 61 53 63 72 69 70 74 20 4f 62 6a 65 63 74 avaScript Object
0190: 20 4e 6f 74 61 74 69 6f 6e 3c 2f 62 3e 29 20 74 Notation</b>) t
01a0: 68 61 74 20 69 73 20 61 20 76 65 72 79 20 70 6f hat is a very po
01b0: 70 75 6c 61 72 20 64 61 74 61 20 66 6f 72 6d 61 pular data forma
01c0: 74 20 77 69 64 65 6c 79 20 75 73 65 64 20 62 79 t widely used by
01d0: 20 6d 61 6e 79 20 77 65 62 2d 61 70 70 73 20 61 many web-apps a
01e0: 73 20 61 20 72 65 70 6c 61 63 65 6d 65 6e 74 20 s a replacement
01f0: 66 6f 72 20 58 4d 4c 2e 3c 62 72 3e 0d 0a 54 68 for XML.<br>..Th
0200: 65 20 69 6e 64 65 6e 64 65 64 20 75 73 65 20 6f e indended use o
0210: 66 20 47 65 6f 4a 53 4f 4e 20 69 73 20 74 68 65 f GeoJSON is the
0220: 20 65 78 74 65 6e 73 69 6f 6e 20 6f 66 20 74 68 extension of th
0230: 65 20 62 61 73 69 63 20 63 61 70 61 62 69 6c 69 e basic capabili
0240: 74 69 65 73 20 6f 66 20 4a 53 4f 4e 20 73 6f 20 ties of JSON so
0250: 74 6f 20 61 64 65 71 75 61 74 65 6c 79 20 73 75 to adequately su
0260: 70 70 6f 72 74 20 3c 62 3e 67 65 6f 67 72 61 70 pport <b>geograp
0270: 68 69 63 20 66 65 61 74 75 72 65 73 3c 2f 62 3e hic features</b>
0280: 20 69 6e 63 6c 75 64 69 6e 67 20 62 6f 74 68 20 including both
0290: 3c 62 3e 47 65 6f 6d 65 74 72 69 65 73 3c 2f 62 <b>Geometries</b
02a0: 3e 20 61 6e 64 0d 0a 3c 62 3e 6e 6f 6e 2d 73 70 > and..<b>non-sp
02b0: 61 74 69 61 6c 20 61 74 74 72 69 62 75 74 65 73 atial attributes
02c0: 3c 2f 62 3e 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 47 </b>.<br><br>..G
02d0: 65 6f 4a 53 4f 4e 2c 20 77 68 69 63 68 20 68 61 eoJSON, which ha
02e0: 73 20 65 78 69 73 74 65 64 20 66 6f 72 20 6d 61 s existed for ma
02f0: 6e 79 20 79 65 61 72 73 2c 20 77 61 73 20 69 6e ny years, was in
0300: 69 74 69 61 6c 6c 79 20 62 61 73 65 64 20 6f 6e itially based on
0310: 20 61 20 6c 6f 6f 73 65 20 61 6e 64 20 69 6e 66 a loose and inf
0320: 6f 72 6d 61 6c 20 64 61 74 61 20 73 70 65 63 69 ormal data speci
0330: 66 69 63 61 74 69 6f 6e 2e 3c 62 72 3e 0d 0a 4f fication.<br>..O
0340: 6e 6c 79 20 76 65 72 79 20 72 65 63 65 6e 74 6c nly very recentl
0350: 79 20 28 32 30 31 36 29 20 69 74 20 68 61 73 20 y (2016) it has
0360: 66 69 6e 61 6c 6c 79 20 62 65 63 6f 6d 65 20 61 finally become a
0370: 20 72 65 73 70 65 63 74 61 62 6c 65 20 73 74 61 respectable sta
0380: 6e 64 61 72 64 20 66 6f 72 6d 61 74 20 62 61 73 ndard format bas
0390: 65 64 20 6f 6e 20 61 20 66 6f 72 6d 61 6c 20 73 ed on a formal s
03a0: 70 65 63 69 66 69 63 61 74 69 6f 6e 2c 20 3c 61 pecification, <a
03b0: 20 68 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f 74 href="https://t
03c0: 6f 6f 6c 73 2e 69 65 74 66 2e 6f 72 67 2f 68 74 ools.ietf.org/ht
03d0: 6d 6c 2f 72 66 63 37 39 34 36 22 3e 52 46 43 20 ml/rfc7946">RFC
03e0: 37 39 34 36 3c 2f 61 3e 2c 20 72 65 6c 65 61 73 7946</a>, releas
03f0: 65 64 20 62 79 20 3c 62 3e 49 45 54 46 3c 2f 62 ed by <b>IETF</b
0400: 3e 20 28 3c 69 3e 49 6e 74 65 72 6e 65 74 20 45 > (<i>Internet E
0410: 6e 67 69 6e 65 65 72 69 6e 67 20 54 61 73 6b 20 ngineering Task
0420: 46 6f 72 63 65 3c 2f 69 3e 29 2e 3c 62 72 3e 0d Force</i>).<br>.
0430: 0a 3c 75 3e 4e 6f 74 65 3c 2f 75 3e 3a 20 52 46 .<u>Note</u>: RF
0440: 43 20 37 39 34 36 20 69 6e 74 72 6f 64 75 63 65 C 7946 introduce
0450: 64 20 73 65 76 65 72 61 6c 20 72 65 6c 65 76 61 d several releva
0460: 6e 74 20 72 65 71 75 69 72 65 6d 65 6e 74 73 20 nt requirements
0470: 61 6e 64 20 72 65 73 74 72 69 63 74 69 6f 6e 73 and restrictions
0480: 2c 20 73 6f 20 74 68 61 74 20 3c 62 3e 70 72 65 , so that <b>pre
0490: 2d 52 46 43 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e -RFC</b> and <b>
04a0: 70 6f 73 74 2d 52 46 43 3c 2f 62 3e 20 47 65 6f post-RFC</b> Geo
04b0: 4a 53 4f 4e 20 66 69 6c 65 73 20 61 72 65 20 6e JSON files are n
04c0: 6f 74 20 6d 75 74 75 61 6c 6c 79 20 69 6e 74 65 ot mutually inte
04d0: 72 6f 70 65 72 61 62 6c 65 2e 3c 62 72 3e 3c 62 roperable.<br><b
04e0: 72 3e 0d 0a 41 20 76 65 72 79 20 72 65 6d 61 72 r>..A very remar
04f0: 6b 61 62 6c 65 20 66 65 61 74 75 72 65 20 6f 66 kable feature of
0500: 20 52 46 43 20 37 39 34 36 20 69 73 20 74 68 61 RFC 7946 is tha
0510: 74 20 69 74 27 73 20 65 78 70 6c 69 63 69 74 6c t it's explicitl
0520: 79 20 64 65 63 6c 61 72 65 64 20 74 6f 20 62 65 y declared to be
0530: 20 61 20 3c 62 3e 66 69 78 65 64 20 61 6e 64 20 a <b>fixed and
0540: 69 6d 6d 75 74 61 62 6c 65 3c 2f 62 3e 20 73 70 immutable</b> sp
0550: 65 63 69 66 69 63 61 74 69 6f 6e 2e 3c 62 72 3e ecification.<br>
0560: 0d 0a 54 68 65 72 65 20 77 69 6c 6c 20 6e 65 76 ..There will nev
0570: 65 72 20 62 65 20 75 70 64 61 74 65 64 20 76 65 er be updated ve
0580: 72 73 69 6f 6e 73 20 6f 66 20 47 65 6f 4a 53 4f rsions of GeoJSO
0590: 4e 3b 20 65 76 65 6e 20 74 68 65 20 73 6c 69 67 N; even the slig
05a0: 68 74 65 73 74 20 63 68 61 6e 67 65 20 77 69 6c htest change wil
05b0: 6c 20 72 65 71 75 69 72 65 20 61 20 72 65 6e 6e l require a renn
05c0: 61 6d 65 20 66 72 6f 6d 20 47 65 6f 4a 53 4f 4e ame from GeoJSON
05d0: 20 74 6f 20 73 6f 6d 65 74 68 69 6e 67 20 65 6c to something el
05e0: 73 65 2e 3c 62 72 3e 0d 0a 53 75 63 68 20 61 20 se.<br>..Such a
05f0: 72 65 73 74 72 69 6e 63 74 69 6f 6e 20 69 73 20 restrinction is
0600: 6f 62 76 69 6f 73 6c 79 20 69 6e 74 65 6e 64 65 obviosly intende
0610: 64 20 74 6f 20 65 6e 73 75 72 65 20 61 20 76 65 d to ensure a ve
0620: 72 79 20 73 74 72 6f 6e 67 20 73 74 61 62 69 6c ry strong stabil
0630: 69 74 79 20 64 75 72 69 6e 67 20 69 74 73 20 6c ity during its l
0640: 69 66 65 74 69 6d 65 20 28 61 6e 64 20 72 65 70 ifetime (and rep
0650: 72 65 73 65 6e 74 73 20 61 20 73 74 72 6f 6e 67 resents a strong
0660: 20 72 65 61 63 74 69 6f 6e 20 74 6f 20 74 68 65 reaction to the
0670: 20 6d 61 6e 79 20 47 4d 4c 20 76 65 72 73 69 6f many GML versio
0680: 6e 73 20 74 68 61 74 20 61 62 72 75 70 74 6c 79 ns that abruptly
0690: 20 69 6e 74 72 6f 64 75 63 65 64 20 72 61 64 69 introduced radi
06a0: 63 61 6c 20 63 68 61 6e 67 65 73 20 75 70 73 65 cal changes upse
06b0: 74 74 69 6e 67 20 74 68 65 20 77 65 6c 6c 20 65 tting the well e
06c0: 73 74 61 62 6c 69 73 68 65 64 20 62 65 68 61 76 stablished behav
06d0: 69 6f 72 20 6f 66 20 65 78 69 73 74 69 6e 67 20 ior of existing
06e0: 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 73 29 implementations)
06f0: 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 54 68 65 20 6d .<br><br>..The m
0700: 6f 73 74 20 6f 62 76 69 6f 75 73 20 63 6f 6d 70 ost obvious comp
0710: 65 74 69 74 6f 72 73 20 6f 66 20 47 65 6f 4a 53 etitors of GeoJS
0720: 4f 4e 20 61 72 65 20 74 68 65 20 3c 61 20 68 72 ON are the <a hr
0730: 65 66 3d 22 68 74 74 70 73 3a 2f 2f 65 6e 2e 77 ef="https://en.w
0740: 69 6b 69 70 65 64 69 61 2e 6f 72 67 2f 77 69 6b ikipedia.org/wik
0750: 69 2f 53 68 61 70 65 66 69 6c 65 22 3e 45 53 52 i/Shapefile">ESR
0760: 49 20 53 68 61 70 65 66 69 6c 65 3c 2f 61 3e 20 I Shapefile</a>
0770: 61 6e 64 20 3c 61 20 68 72 65 66 3d 22 0d 0a 68 and <a href="..h
0780: 74 74 70 73 3a 2f 2f 65 6e 2e 77 69 6b 69 70 65 ttps://en.wikipe
0790: 64 69 61 2e 6f 72 67 2f 77 69 6b 69 2f 47 65 6f dia.org/wiki/Geo
07a0: 67 72 61 70 68 79 5f 4d 61 72 6b 75 70 5f 4c 61 graphy_Markup_La
07b0: 6e 67 75 61 67 65 22 3e 47 4d 4c 3c 2f 61 3e 3c nguage">GML</a><
07c0: 62 72 3e 0d 0a 54 68 65 20 66 6f 6c 6c 6f 77 69 br>..The followi
07d0: 6e 67 20 63 68 61 72 74 20 77 69 6c 6c 20 71 75 ng chart will qu
07e0: 69 63 6b 6c 79 20 6c 69 73 74 20 74 68 65 20 6d ickly list the m
07f0: 61 69 6e 20 64 69 66 66 65 72 65 6e 63 65 73 20 ain differences
0800: 62 65 74 77 65 65 6e 20 74 68 65 6d 2e 3c 62 72 between them.<br
0810: 3e 3c 62 72 3e 0d 0a 3c 74 61 62 6c 65 20 63 65 ><br>..<table ce
0820: 6c 6c 73 70 61 63 69 6e 67 3d 22 34 22 20 63 65 llspacing="4" ce
0830: 6c 6c 70 61 64 64 69 6e 67 3d 22 38 22 20 62 67 llpadding="8" bg
0840: 63 6f 6c 6f 72 3d 22 23 63 30 65 65 63 30 22 20 color="#c0eec0"
0850: 62 6f 72 64 65 72 3d 22 31 22 3e 0d 0a 3c 74 72 border="1">..<tr
0860: 3e 3c 74 68 3e 54 6f 70 69 63 3c 2f 74 68 3e 3c ><th>Topic</th><
0870: 74 68 3e 53 68 61 70 65 66 69 6c 65 3c 2f 74 68 th>Shapefile</th
0880: 3e 3c 74 68 3e 47 4d 4c 3c 2f 74 68 3e 3c 74 68 ><th>GML</th><th
0890: 3e 47 65 6f 4a 53 4f 4e 3c 2f 74 68 3e 3c 74 68 >GeoJSON</th><th
08a0: 3e 52 65 6d 61 72 6b 73 3c 2f 74 68 3e 3c 2f 74 >Remarks</th></t
08b0: 72 3e 0d 0a 3c 74 72 3e 0d 0a 3c 74 68 20 76 61 r>..<tr>..<th va
08c0: 6c 69 67 6e 3d 22 6d 69 64 64 6c 65 22 3e 46 69 lign="middle">Fi
08d0: 6c 65 20 6f 72 67 61 6e 69 7a 61 74 69 6f 6e 3c le organization<
08e0: 2f 74 68 3e 0d 0a 3c 74 64 20 76 61 6c 69 67 6e /th>..<td valign
08f0: 3d 22 6d 69 64 64 6c 65 22 3e 41 74 20 6c 65 61 ="middle">At lea
0900: 73 74 20 74 68 72 65 65 20 69 6e 64 65 70 65 6e st three indepen
0910: 64 65 6e 74 20 66 69 6c 65 73 20 73 68 61 72 69 dent files shari
0920: 6e 67 20 74 68 65 20 73 61 6d 65 20 6e 61 6d 65 ng the same name
0930: 20 61 6e 64 20 72 65 73 70 65 63 74 69 76 65 6c and respectivel
0940: 79 20 69 64 65 6e 74 69 66 69 65 64 20 62 79 20 y identified by
0950: 73 75 66 66 69 78 65 73 20 3c 62 3e 2e 73 68 70 suffixes <b>.shp
0960: 3c 2f 62 3e 2c 20 3c 62 3e 2e 73 68 78 3c 2f 62 </b>, <b>.shx</b
0970: 3e 20 61 6e 64 20 3c 62 3e 2e 64 62 66 3c 2f 62 > and <b>.dbf</b
0980: 3e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 42 6f 74 >..<ul>..<li>Bot
0990: 68 20 74 68 65 20 3c 62 3e 2e 73 68 70 3c 2f 62 h the <b>.shp</b
09a0: 3e 20 61 6e 64 20 3c 62 3e 2e 73 68 78 3c 2f 62 > and <b>.shx</b
09b0: 3e 20 6d 65 6d 62 65 72 73 20 61 72 65 20 3c 62 > members are <b
09c0: 3e 62 69 6e 61 72 79 20 66 69 6c 65 73 3c 2f 62 >binary files</b
09d0: 3e 20 69 6e 74 65 6e 64 65 64 20 74 6f 20 73 74 > intended to st
09e0: 6f 72 65 20 47 65 6f 6d 65 74 72 69 65 73 20 61 ore Geometries a
09f0: 6e 64 20 73 68 6f 75 6c 64 20 62 65 20 65 6e 63 nd should be enc
0a00: 6f 64 65 64 20 61 63 63 6f 72 64 69 6e 67 6c 79 oded accordingly
0a10: 20 74 6f 20 74 68 65 20 3c 61 20 68 72 65 66 3d to the <a href=
0a20: 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 65 73 72 "https://www.esr
0a30: 69 2e 63 6f 6d 2f 6c 69 62 72 61 72 79 2f 77 68 i.com/library/wh
0a40: 69 74 65 70 61 70 65 72 73 2f 70 64 66 73 2f 73 itepapers/pdfs/s
0a50: 68 61 70 65 66 69 6c 65 2e 70 64 66 22 3e 45 53 hapefile.pdf">ES
0a60: 52 49 20 6f 70 65 6e 20 73 70 65 63 69 66 69 63 RI open specific
0a70: 61 74 69 6f 6e 3c 2f 61 3e 3c 2f 6c 69 3e 0d 0a ation</a></li>..
0a80: 3c 6c 69 3e 54 68 65 20 3c 62 3e 2e 64 62 66 3c <li>The <b>.dbf<
0a90: 2f 62 3e 20 6d 65 6d 62 65 72 20 69 73 20 69 6e /b> member is in
0aa0: 74 65 6e 64 65 64 20 74 6f 20 73 74 6f 72 65 20 tended to store
0ab0: 6e 6f 6e 2d 73 70 61 74 69 61 6c 20 61 74 74 72 non-spatial attr
0ac0: 69 62 75 74 65 73 2e 3c 62 72 3e 0d 0a 54 68 69 ibutes.<br>..Thi
0ad0: 73 20 3c 62 3e 62 69 6e 61 72 79 20 66 69 6c 65 s <b>binary file
0ae0: 3c 2f 62 3e 20 69 73 20 61 6c 73 6f 20 65 78 70 </b> is also exp
0af0: 65 63 74 65 64 20 74 6f 20 62 65 20 65 6e 63 6f ected to be enco
0b00: 64 65 64 20 61 63 63 6f 72 64 69 6e 67 6c 79 20 ded accordingly
0b10: 74 6f 20 3c 61 20 68 72 65 66 3d 22 68 74 74 70 to <a href="http
0b20: 73 3a 2f 2f 65 6e 2e 77 69 6b 69 70 65 64 69 61 s://en.wikipedia
0b30: 2e 6f 72 67 2f 77 69 6b 69 2f 44 42 61 73 65 22 .org/wiki/DBase"
0b40: 3e 41 73 68 74 6f 6e 2d 54 61 74 65 20 64 42 61 >Ashton-Tate dBa
0b50: 73 65 20 73 70 65 63 69 66 69 63 61 74 69 6f 6e se specification
0b60: 3c 2f 61 3e 3b 20 75 6e 68 61 70 70 69 6c 79 20 </a>; unhappily
0b70: 74 68 69 73 20 76 65 72 79 20 6f 6c 64 20 73 70 this very old sp
0b80: 65 63 69 66 69 63 61 74 69 6f 6e 20 28 62 6f 72 ecification (bor
0b90: 6e 20 69 6e 20 74 68 65 20 27 38 30 73 29 20 68 n in the '80s) h
0ba0: 61 64 20 61 20 73 61 76 61 67 65 20 70 72 6f 6c ad a savage prol
0bb0: 69 66 65 72 61 74 69 6f 6e 20 6f 66 20 64 69 66 iferation of dif
0bc0: 66 65 72 65 6e 74 20 64 69 61 6c 65 63 74 73 20 ferent dialects
0bd0: 28 3c 69 3e 43 6c 69 70 70 65 72 3c 2f 69 3e 2c (<i>Clipper</i>,
0be0: 20 3c 69 3e 46 6f 78 50 72 6f 3c 2f 69 3e 29 20 <i>FoxPro</i>)
0bf0: 62 65 63 6f 6d 69 6e 67 20 71 75 69 74 65 20 6d becoming quite m
0c00: 65 73 73 79 20 61 6e 64 20 63 68 61 6f 74 69 63 essy and chaotic
0c10: 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c .</li>..</ul>..<
0c20: 2f 74 64 3e 0d 0a 3c 74 64 3e 47 4d 4c 20 69 73 /td>..<td>GML is
0c30: 20 62 61 73 65 64 20 6f 6e 20 58 4d 4c 2c 20 61 based on XML, a
0c40: 6e 64 20 69 73 20 6a 75 73 74 20 61 20 73 69 6e nd is just a sin
0c50: 67 6c 65 2c 20 6d 6f 6e 6f 6c 69 74 68 69 63 20 gle, monolithic
0c60: 3c 62 3e 74 65 78 74 20 66 69 6c 65 2e 3c 2f 62 <b>text file.</b
0c70: 3e 3c 62 72 3e 0d 0a 41 73 20 61 6e 79 20 6f 74 ><br>..As any ot
0c80: 68 65 72 20 58 4d 4c 20 66 69 6c 65 2c 20 47 4d her XML file, GM
0c90: 4c 20 74 6f 6f 20 63 61 6e 20 62 65 20 73 74 72 L too can be str
0ca0: 6f 6e 67 6c 79 20 63 6f 6e 73 74 72 61 69 6e 65 ongly constraine
0cb0: 64 20 74 6f 20 63 6f 6e 66 6f 72 6d 20 74 6f 20 d to conform to
0cc0: 61 20 66 6f 72 6d 61 6c 6c 79 20 64 65 66 69 6e a formally defin
0cd0: 65 64 20 3c 61 20 68 72 65 66 3d 22 68 74 74 70 ed <a href="http
0ce0: 73 3a 2f 2f 69 74 2e 77 69 6b 69 70 65 64 69 61 s://it.wikipedia
0cf0: 2e 6f 72 67 2f 77 69 6b 69 2f 58 4d 4c 5f 53 63 .org/wiki/XML_Sc
0d00: 68 65 6d 61 22 3e 58 4d 4c 20 53 63 68 65 6d 61 hema">XML Schema
0d10: 3c 2f 61 3e 0d 0a 3c 2f 74 64 3e 0d 0a 3c 74 64 </a>..</td>..<td
0d20: 20 76 61 6c 69 67 6e 3d 22 6d 69 64 64 6c 65 22 valign="middle"
0d30: 3e 0d 0a 53 69 6e 67 6c 65 20 6d 6f 6e 6f 6c 69 >..Single monoli
0d40: 74 68 69 63 20 3c 62 3e 74 65 78 74 20 66 69 6c thic <b>text fil
0d50: 65 3c 2f 62 3e 2e 3c 62 72 3e 0d 0a 53 69 6d 69 e</b>.<br>..Simi
0d60: 6c 61 72 20 74 6f 20 58 4d 4c 2c 20 62 75 74 20 lar to XML, but
0d70: 69 6e 74 65 6e 64 65 64 20 74 6f 20 62 65 20 66 intended to be f
0d80: 61 72 20 73 69 6d 70 6c 65 72 20 61 6e 64 20 6c ar simpler and l
0d90: 65 73 73 20 76 65 72 62 6f 73 65 2e 0d 0a 3c 2f ess verbose...</
0da0: 74 64 3e 0d 0a 3c 74 64 3e 0d 0a 54 68 65 20 74 td>..<td>..The t
0db0: 68 72 65 65 2d 66 69 6c 65 73 20 6c 61 79 6f 75 hree-files layou
0dc0: 74 20 6f 66 20 53 68 61 70 65 66 69 6c 65 20 69 t of Shapefile i
0dd0: 73 20 63 6c 65 61 72 6c 79 20 6f 62 73 6f 6c 65 s clearly obsole
0de0: 74 65 2c 20 61 6e 64 20 69 74 20 66 72 65 71 75 te, and it frequ
0df0: 65 6e 74 6c 79 20 70 6f 73 65 73 20 6d 61 6e 79 ently poses many
0e00: 20 68 65 61 64 61 63 68 65 73 20 63 61 75 73 69 headaches causi
0e10: 6e 67 20 75 6e 65 78 70 65 63 74 65 64 20 74 72 ng unexpected tr
0e20: 6f 75 62 6c 65 73 2e 3c 62 72 3e 3c 62 72 3e 0d oubles.<br><br>.
0e30: 0a 54 68 65 20 73 69 6e 67 6c 65 2d 66 69 6c 65 .The single-file
0e40: 20 6c 61 79 6f 75 74 20 61 64 6f 70 74 65 64 20 layout adopted
0e50: 62 79 20 62 6f 74 68 20 47 4d 4c 20 61 6e 64 20 by both GML and
0e60: 47 65 6f 4a 53 4f 4e 20 69 73 20 63 6c 65 61 72 GeoJSON is clear
0e70: 6c 79 20 62 65 74 74 65 72 20 61 6e 64 20 73 61 ly better and sa
0e80: 66 65 72 2c 20 61 6e 64 20 62 65 69 6e 67 20 3c fer, and being <
0e90: 62 3e 74 65 78 74 20 66 69 6c 65 73 3c 2f 62 3e b>text files</b>
0ea0: 20 74 68 65 79 20 63 61 6e 20 62 65 20 65 61 73 they can be eas
0eb0: 69 6c 79 20 69 6e 73 70 65 63 74 65 64 20 61 6e ily inspected an
0ec0: 64 20 65 76 65 6e 74 75 61 6c 6c 79 20 64 65 62 d eventually deb
0ed0: 75 67 67 65 64 20 6a 75 73 74 20 75 73 69 6e 67 ugged just using
0ee0: 20 61 6e 79 20 67 65 6e 65 72 69 63 20 3c 62 3e any generic <b>
0ef0: 74 65 78 74 20 65 64 69 74 6f 72 3c 2f 62 3e 20 text editor</b>
0f00: 77 69 74 68 6f 75 74 20 72 65 71 75 69 72 69 6e without requirin
0f10: 67 20 61 6e 79 20 73 70 65 63 69 66 69 63 20 74 g any specific t
0f20: 6f 6f 6c 2e 0d 0a 3c 2f 74 64 3e 0d 0a 3c 2f 74 ool...</td>..</t
0f30: 72 3e 0d 0a 3c 74 72 3e 0d 0a 3c 74 68 3e 47 65 r>..<tr>..<th>Ge
0f40: 6f 6d 65 74 72 79 20 63 6c 61 73 73 65 73 3c 2f ometry classes</
0f50: 74 68 3e 0d 0a 3c 74 64 3e 0d 0a 3c 75 6c 3e 0d th>..<td>..<ul>.
0f60: 0a 3c 6c 69 3e 4e 75 6c 6c 20 53 68 61 70 65 3c .<li>Null Shape<
0f70: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 50 6f 69 6e 74 3c /li>..<li>Point<
0f80: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 4d 75 6c 74 69 50 /li>..<li>MultiP
0f90: 6f 69 6e 74 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 50 oint</li>..<li>P
0fa0: 6f 6c 79 4c 69 6e 65 20 28 77 69 74 68 6f 75 74 olyLine (without
0fb0: 20 64 69 73 74 69 6e 67 75 69 73 68 69 6e 67 20 distinguishing
0fc0: 62 65 74 77 65 65 6e 20 73 69 6e 67 6c 65 2d 20 between single-
0fd0: 61 6e 64 20 6d 75 6c 74 69 2d 70 61 72 74 29 3c and multi-part)<
0fe0: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 50 6f 6c 79 67 6f /li>..<li>Polygo
0ff0: 6e 20 28 77 69 74 68 6f 75 74 20 64 69 73 74 69 n (without disti
1000: 6e 67 75 69 73 68 69 6e 67 20 62 65 74 77 65 65 nguishing betwee
1010: 6e 20 73 69 6e 67 6c 65 2d 20 61 6e 64 20 6d 75 n single- and mu
1020: 6c 74 69 2d 70 61 72 74 29 3c 2f 6c 69 3e 0d 0a lti-part)</li>..
1030: 3c 2f 75 6c 3e 0d 0a 3c 62 72 3e 0d 0a 3c 75 3e </ul>..<br>..<u>
1040: 4e 6f 74 65 73 3c 2f 75 3e 3a 20 0d 0a 3c 75 6c Notes</u>: ..<ul
1050: 3e 0d 0a 3c 6c 69 3e 41 6c 6c 20 47 65 6f 6d 65 >..<li>All Geome
1060: 74 72 69 65 73 20 69 6e 20 74 68 65 20 73 61 6d tries in the sam
1070: 65 20 53 68 61 70 65 66 69 6c 65 20 6d 75 73 74 e Shapefile must
1080: 20 73 68 61 72 65 20 74 68 65 20 73 61 6d 65 20 share the same
1090: 63 6c 61 73 73 20 28 6f 72 20 62 65 20 3c 62 3e class (or be <b>
10a0: 4e 75 6c 6c 3c 2f 62 3e 29 2e 3c 2f 6c 69 3e 0d Null</b>).</li>.
10b0: 0a 3c 6c 69 3e 41 6c 6c 20 47 65 6f 6d 65 74 72 .<li>All Geometr
10c0: 69 65 73 20 69 6e 20 74 68 65 20 73 61 6d 65 20 ies in the same
10d0: 53 68 61 70 65 66 69 6c 65 20 6d 75 73 74 20 73 Shapefile must s
10e0: 68 61 72 65 20 74 68 65 20 73 61 6d 65 20 53 52 hare the same SR
10f0: 49 44 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 54 68 ID.</li>..<li>Th
1100: 65 20 72 75 6c 65 73 20 66 6f 72 20 69 64 65 6e e rules for iden
1110: 74 69 66 79 69 6e 67 20 3c 62 3e 45 78 74 65 72 tifying <b>Exter
1120: 69 6f 72 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 49 ior</b> and <b>I
1130: 6e 74 65 72 69 6f 72 3c 2f 62 3e 20 50 6f 6c 79 nterior</b> Poly
1140: 67 6f 6e 20 72 69 6e 67 73 0d 0a 61 72 65 20 61 gon rings..are a
1150: 77 6b 77 61 72 64 20 61 6e 64 20 63 61 6e 20 66 wkward and can f
1160: 72 65 71 75 65 6e 74 6c 79 20 63 61 75 73 65 20 requently cause
1170: 69 6e 74 65 72 6f 70 65 72 61 62 69 6c 69 74 79 interoperability
1180: 20 69 73 73 75 65 73 2e 3c 2f 6c 69 3e 0d 0a 3c issues.</li>..<
1190: 2f 75 6c 3e 0d 0a 3c 2f 74 64 3e 0d 0a 3c 74 64 /ul>..</td>..<td
11a0: 3e 0d 0a 47 4d 4c 20 61 6c 6c 6f 77 73 20 6d 61 >..GML allows ma
11b0: 6e 79 20 64 69 66 66 65 72 65 6e 74 20 77 61 79 ny different way
11c0: 73 20 74 6f 20 64 65 66 69 6e 65 20 74 68 65 20 s to define the
11d0: 73 61 6d 65 20 74 79 70 65 20 6f 66 20 47 65 6f same type of Geo
11e0: 6d 65 74 72 79 2c 20 61 6e 64 20 74 68 65 20 73 metry, and the s
11f0: 70 65 63 69 66 69 63 61 74 69 6f 6e 73 20 68 61 pecifications ha
1200: 76 65 20 72 61 64 69 63 61 6c 6c 79 20 63 68 61 ve radically cha
1210: 6e 67 65 64 20 66 72 6f 6d 20 76 65 72 73 69 6f nged from versio
1220: 6e 20 74 6f 20 76 65 72 73 69 6f 6e 2e 3c 62 72 n to version.<br
1230: 3e 3c 62 72 3e 0d 0a 47 4d 4c 20 68 61 73 20 61 ><br>..GML has a
1240: 20 72 65 61 6c 6c 79 20 69 6d 70 72 65 73 73 69 really impressi
1250: 76 65 20 66 6c 65 78 69 62 69 6c 79 20 28 65 2e ve flexibily (e.
1260: 67 2e 20 65 61 63 68 20 73 69 6e 67 6c 65 20 47 g. each single G
1270: 65 6f 6d 65 74 72 79 20 63 61 6e 20 66 72 65 65 eometry can free
1280: 6c 79 20 64 65 63 6c 61 72 65 20 69 74 73 20 6f ly declare its o
1290: 77 6e 20 53 52 49 44 29 2c 20 62 75 74 20 61 74 wn SRID), but at
12a0: 20 74 68 65 20 63 6f 73 74 20 6f 66 20 69 6d 70 the cost of imp
12b0: 6f 73 69 6e 67 20 61 6e 20 6f 76 65 72 77 68 65 osing an overwhe
12c0: 6c 6d 69 6e 67 20 63 6f 6d 70 6c 65 78 69 74 79 lming complexity
12d0: 2e 0d 0a 3c 2f 74 64 3e 0d 0a 3c 74 64 3e 0d 0a ...</td>..<td>..
12e0: 3c 75 6c 3e 0d 0a 3c 6c 69 3e 4e 75 6c 6c 3c 2f <ul>..<li>Null</
12f0: 6c 69 3e 0d 0a 3c 6c 69 3e 50 6f 69 6e 74 3c 2f li>..<li>Point</
1300: 6c 69 3e 0d 0a 3c 6c 69 3e 4c 69 6e 65 73 74 72 li>..<li>Linestr
1310: 69 6e 67 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 50 6f ing</li>..<li>Po
1320: 6c 79 67 6f 6e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e lygon</li>..<li>
1330: 4d 75 6c 74 69 50 6f 69 6e 74 3c 2f 6c 69 3e 0d MultiPoint</li>.
1340: 0a 3c 6c 69 3e 4d 75 6c 74 69 4c 69 6e 65 73 74 .<li>MultiLinest
1350: 72 69 6e 67 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 4d ring</li>..<li>M
1360: 75 6c 74 69 50 6f 6c 79 67 6f 6e 3c 2f 6c 69 3e ultiPolygon</li>
1370: 0d 0a 3c 6c 69 3e 47 65 6f 6d 65 74 72 79 43 6f ..<li>GeometryCo
1380: 6c 6c 65 63 74 69 6f 6e 3c 2f 6c 69 3e 0d 0a 3c llection</li>..<
1390: 2f 75 6c 3e 0d 0a 3c 62 72 3e 0d 0a 3c 75 3e 4e /ul>..<br>..<u>N
13a0: 6f 74 65 73 3c 2f 75 3e 3a 20 0d 0a 3c 75 6c 3e otes</u>: ..<ul>
13b0: 0d 0a 3c 6c 69 3e 54 68 69 73 20 65 78 61 63 74 ..<li>This exact
13c0: 6c 79 20 63 6f 72 72 65 73 70 6f 6e 64 73 20 74 ly corresponds t
13d0: 6f 20 74 68 65 20 73 74 61 6e 64 61 72 64 20 3c o the standard <
13e0: 62 3e 37 20 63 6c 61 73 73 65 73 3c 2f 62 3e 20 b>7 classes</b>
13f0: 6d 6f 64 65 6c 20 61 64 6f 70 74 65 64 20 62 79 model adopted by
1400: 20 53 70 61 74 69 61 6c 20 53 51 4c 2e 3c 2f 6c Spatial SQL.</l
1410: 69 3e 0d 0a 3c 6c 69 3e 54 68 65 20 73 61 6d 65 i>..<li>The same
1420: 20 47 65 6f 4a 53 4f 4e 20 66 69 6c 65 20 63 61 GeoJSON file ca
1430: 6e 20 66 72 65 65 6c 79 20 63 6f 6e 74 61 69 6e n freely contain
1440: 20 61 6e 79 20 6b 69 6e 64 20 6f 66 20 47 65 6f any kind of Geo
1450: 6d 65 74 72 79 20 63 6c 61 73 73 65 73 20 77 69 metry classes wi
1460: 74 68 6f 75 72 20 72 65 73 74 72 69 63 74 69 6f thour restrictio
1470: 6e 73 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 41 6c ns.</li>..<li>Al
1480: 6c 20 47 65 6f 6d 65 74 72 69 65 73 20 69 6e 20 l Geometries in
1490: 74 68 65 20 73 61 6d 65 20 47 65 6f 4a 53 4f 4e the same GeoJSON
14a0: 20 66 69 6c 65 20 6d 75 73 74 20 73 68 61 72 65 file must share
14b0: 20 74 68 65 20 73 61 6d 65 20 53 52 49 44 2e 3c the same SRID.<
14c0: 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 2f 74 /li>..</ul>..</t
14d0: 64 3e 0d 0a 3c 74 64 3e 0d 0a 3c 75 6c 3e 0d 0a d>..<td>..<ul>..
14e0: 3c 6c 69 3e 53 68 61 70 65 66 69 6c 65 20 69 73 <li>Shapefile is
14f0: 20 6f 62 76 69 6f 75 73 6c 79 20 6f 62 73 6f 6c obviously obsol
1500: 65 74 65 2c 20 61 6e 64 20 73 6f 6d 65 77 61 79 ete, and someway
1510: 20 6d 65 73 73 79 20 61 6e 64 20 6c 69 6d 69 74 messy and limit
1520: 65 64 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 47 4d ed.</li>..<li>GM
1530: 4c 20 69 73 20 65 6c 65 67 61 6e 74 20 61 6e 64 L is elegant and
1540: 20 76 65 72 79 20 73 6f 70 68 69 73 74 69 63 61 very sophistica
1550: 74 65 64 3a 20 73 6f 6d 65 74 69 6d 65 73 20 74 ted: sometimes t
1560: 6f 6f 20 73 6f 70 68 69 73 74 69 63 61 74 65 64 oo sophisticated
1570: 20 61 6e 64 20 63 6f 6d 70 6c 65 78 20 74 6f 20 and complex to
1580: 62 65 20 72 65 61 6c 6c 79 20 75 73 61 62 6c 65 be really usable
1590: 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 47 65 6f 4a .</li>..<li>GeoJ
15a0: 53 4f 4e 20 6d 61 74 63 68 65 73 20 74 68 65 20 SON matches the
15b0: 53 70 61 74 69 61 6c 20 53 51 4c 20 72 65 71 75 Spatial SQL requ
15c0: 69 72 65 6d 65 6e 74 73 2c 20 61 6e 64 20 74 68 irements, and th
15d0: 65 72 66 6f 72 65 20 61 76 6f 69 64 73 20 61 6e erfore avoids an
15e0: 79 20 75 6e 6e 65 63 65 73 73 61 72 79 20 63 6f y unnecessary co
15f0: 6d 70 6c 65 78 69 74 79 2e 3c 2f 6c 69 3e 0d 0a mplexity.</li>..
1600: 3c 2f 75 6c 3e 0d 0a 3c 2f 74 64 3e 0d 0a 3c 2f </ul>..</td>..</
1610: 74 72 3e 0d 0a 3c 74 72 3e 0d 0a 3c 74 68 3e 44 tr>..<tr>..<th>D
1620: 69 6d 65 6e 73 69 6f 6e 73 3c 2f 74 68 3e 0d 0a imensions</th>..
1630: 3c 74 64 3e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e <td>..<ul>..<li>
1640: 58 59 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 58 59 4d XY</li>..<li>XYM
1650: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 58 59 5a 3c 2f </li>..<li>XYZ</
1660: 6c 69 3e 0d 0a 3c 6c 69 3e 58 59 5a 4d 3c 2f 6c li>..<li>XYZM</l
1670: 69 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 2f 74 64 3e i>..</ul>..</td>
1680: 0d 0a 3c 74 64 3e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c ..<td>..<ul>..<l
1690: 69 3e 58 59 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 58 i>XY</li>..<li>X
16a0: 59 4d 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 58 59 5a YM</li>..<li>XYZ
16b0: 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 58 59 5a 4d 3c </li>..<li>XYZM<
16c0: 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 2f 74 /li>..</ul>..</t
16d0: 64 3e 0d 0a 3c 74 64 3e 0d 0a 3c 75 6c 3e 0d 0a d>..<td>..<ul>..
16e0: 3c 6c 69 3e 58 59 3c 2f 6c 69 3e 0d 0a 3c 6c 69 <li>XY</li>..<li
16f0: 3e 58 59 5a 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e >XYZ</li>..</ul>
1700: 0d 0a 3c 62 72 3e 0d 0a 3c 75 3e 4e 6f 74 65 3c ..<br>..<u>Note<
1710: 2f 75 3e 3a 20 52 46 43 20 37 39 34 36 20 6a 75 /u>: RFC 7946 ju
1720: 73 74 20 73 75 70 70 6f 72 74 73 20 32 20 6f 72 st supports 2 or
1730: 20 33 20 63 6f 6f 72 64 69 6e 61 74 65 73 2c 20 3 coordinates,
1740: 61 6e 64 20 74 68 65 20 74 68 69 72 64 20 76 61 and the third va
1750: 6c 75 65 20 28 77 68 65 6e 20 64 65 63 6c 61 72 lue (when declar
1760: 65 64 29 20 69 73 20 61 6c 77 61 79 73 20 65 78 ed) is always ex
1770: 70 65 63 74 65 64 20 74 6f 20 63 6f 72 72 65 73 pected to corres
1780: 70 6f 6e 64 20 74 6f 20 61 6e 20 45 6c 65 76 61 pond to an Eleva
1790: 74 69 6f 6e 20 28 5a 20 61 78 69 73 29 2e 3c 62 tion (Z axis).<b
17a0: 72 3e 3c 62 72 3e 0d 0a 53 75 70 70 6f 72 74 69 r><br>..Supporti
17b0: 6e 67 20 58 59 4d 20 6f 72 20 58 59 5a 4d 20 69 ng XYM or XYZM i
17c0: 73 20 6e 6f 74 20 74 65 63 68 6e 69 63 61 6c 6c s not technicall
17d0: 79 20 75 6e 66 65 61 73 69 62 6c 65 2e 0d 0a 42 y unfeasible...B
17e0: 6f 74 68 20 77 72 69 74 65 72 73 20 61 6e 64 20 oth writers and
17f0: 72 65 61 64 65 72 73 20 63 6f 75 6c 64 20 73 75 readers could su
1800: 70 70 6f 72 74 20 73 75 63 68 20 6f 70 74 69 6f pport such optio
1810: 6e 73 2c 20 62 75 74 20 61 6c 6c 20 74 68 69 73 ns, but all this
1820: 20 69 73 20 73 75 72 65 6c 79 20 6f 75 74 73 69 is surely outsi
1830: 64 65 20 74 68 65 20 73 74 61 6e 64 61 72 64 20 de the standard
1840: 61 6e 64 20 77 69 6c 6c 20 73 75 72 65 6c 79 20 and will surely
1850: 69 6d 70 61 69 72 20 74 68 65 20 75 6e 69 76 65 impair the unive
1860: 72 73 61 6c 20 70 6f 72 74 61 62 69 6c 69 74 79 rsal portability
1870: 20 6f 66 20 61 6e 79 20 6e 6f 6e 20 63 61 6e 6f of any non cano
1880: 6e 69 63 61 6c 20 66 69 6c 65 2e 0d 0a 3c 2f 74 nical file...</t
1890: 64 3e 0d 0a 3c 74 64 3e 0d 0a 47 65 6f 4a 53 4f d>..<td>..GeoJSO
18a0: 4e 20 6c 61 63 6b 73 20 74 68 65 20 63 61 70 61 N lacks the capa
18b0: 62 69 6c 69 74 79 20 74 6f 20 73 75 70 70 6f 72 bility to suppor
18c0: 74 20 58 59 4d 20 61 6e 64 20 58 59 5a 4d 2c 20 t XYM and XYZM,
18d0: 6f 74 68 65 72 20 74 68 61 6e 20 62 79 20 61 64 other than by ad
18e0: 6f 70 74 69 6e 67 20 28 61 6e 64 20 74 6f 20 6f opting (and to o
18f0: 74 68 65 72 73 20 75 6e 6b 6e 6f 77 6e 29 20 76 thers unknown) v
1900: 69 63 69 6f 75 73 20 74 72 69 63 6b 73 2e 3c 62 icious tricks.<b
1910: 72 3e 0d 0a 4d 61 79 20 77 65 6c 6c 20 62 65 20 r>..May well be
1920: 69 74 27 73 20 6e 6f 74 20 61 20 66 6f 72 62 69 it's not a forbi
1930: 64 64 69 6e 67 20 6c 69 6d 69 74 61 74 69 6f 6e dding limitation
1940: 20 69 6e 20 6d 61 6e 79 20 63 6f 6d 6d 6f 6e 20 in many common
1950: 63 61 73 65 73 2c 20 62 75 74 20 69 74 27 73 20 cases, but it's
1960: 69 6e 64 69 73 70 75 74 61 62 6c 79 20 61 20 6c indisputably a l
1970: 69 6d 69 74 61 74 69 6f 6e 2e 0d 0a 3c 2f 74 64 imitation...</td
1980: 3e 0d 0a 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 0d 0a >..</tr>..<tr>..
1990: 3c 74 68 3e 53 52 49 44 3c 2f 74 68 3e 0d 0a 3c <th>SRID</th>..<
19a0: 74 64 3e 0d 0a 4e 6f 74 20 69 6e 74 65 72 6e 61 td>..Not interna
19b0: 6c 6c 79 20 64 65 63 6c 61 72 65 64 20 62 79 20 lly declared by
19c0: 74 68 65 20 53 68 61 70 65 66 69 6c 65 20 69 74 the Shapefile it
19d0: 73 65 6c 66 2e 3c 62 72 3e 0d 0a 44 65 70 6c 6f self.<br>..Deplo
19e0: 79 69 6e 67 20 61 20 66 75 72 74 68 65 72 20 3c ying a further <
19f0: 62 3e 2e 70 72 6a 3c 2f 62 3e 20 66 69 6c 65 20 b>.prj</b> file
1a00: 64 65 73 63 72 69 62 69 6e 67 20 74 68 65 20 69 describing the i
1a10: 6e 74 65 6e 64 65 64 20 53 52 49 44 20 69 73 20 ntended SRID is
1a20: 74 68 65 20 75 73 75 61 6c 20 73 6f 6c 75 74 69 the usual soluti
1a30: 6f 6e 20 61 64 6f 70 74 65 64 20 62 79 20 45 53 on adopted by ES
1a40: 52 49 20 69 74 73 65 6c 66 2c 20 62 75 74 20 63 RI itself, but c
1a50: 6f 72 72 65 63 74 6c 79 20 70 61 72 73 69 6e 67 orrectly parsing
1a60: 20 74 68 65 73 65 20 65 78 74 72 61 20 66 69 6c these extra fil
1a70: 65 73 20 69 73 20 61 6e 20 75 73 75 61 6c 6c 79 es is an usually
1a80: 20 66 6c 69 6d 73 79 20 70 72 6f 63 65 73 73 20 flimsy process
1a90: 66 61 6c 6c 69 6e 67 20 6f 75 74 73 69 64 65 20 falling outside
1aa0: 72 65 61 6c 20 63 61 70 61 62 69 6c 69 74 69 65 real capabilitie
1ab0: 73 20 6f 66 20 6d 61 6e 79 20 74 68 69 72 64 20 s of many third
1ac0: 70 61 72 74 79 20 72 65 61 64 65 72 73 2e 0d 0a party readers...
1ad0: 3c 2f 74 64 3e 0d 0a 3c 74 64 3e 0d 0a 45 61 63 </td>..<td>..Eac
1ae0: 68 20 73 69 6e 67 6c 65 20 47 65 6f 6d 65 74 72 h single Geometr
1af0: 79 20 69 73 20 61 6c 6c 6f 77 65 64 20 74 6f 20 y is allowed to
1b00: 66 72 65 65 6c 79 20 64 65 66 69 6e 65 20 69 74 freely define it
1b10: 73 20 6f 77 6e 20 53 52 49 44 2c 20 61 73 20 77 s own SRID, as w
1b20: 65 6c 6c 20 61 73 20 64 65 66 69 6e 69 6e 67 20 ell as defining
1b30: 74 68 65 20 53 52 49 44 20 66 6f 72 20 74 68 65 the SRID for the
1b40: 20 77 68 6f 6c 65 20 6c 61 79 65 72 2e 0d 0a 3c whole layer...<
1b50: 2f 74 64 3e 0d 0a 3c 74 64 3e 0d 0a 41 63 63 6f /td>..<td>..Acco
1b60: 72 64 69 6e 67 6c 79 20 74 6f 20 52 46 43 20 37 rdingly to RFC 7
1b70: 39 34 36 20 61 6c 6c 20 63 6f 6f 72 64 69 6e 61 946 all coordina
1b80: 74 65 73 20 61 72 65 20 61 6c 77 61 79 73 20 65 tes are always e
1b90: 78 70 65 74 65 64 20 74 6f 20 62 65 20 65 78 70 xpeted to be exp
1ba0: 72 65 73 73 65 64 20 61 73 20 3c 62 3e 6c 6f 6e ressed as <b>lon
1bb0: 67 69 74 75 65 73 3c 2f 62 3e 20 61 6e 64 20 3c gitues</b> and <
1bc0: 62 3e 6c 61 74 69 74 75 64 65 73 3c 2f 62 3e 20 b>latitudes</b>
1bd0: 28 28 69 2e 65 3a 20 78 2d 70 6f 73 69 74 69 6f ((i.e: x-positio
1be0: 6e 20 61 6e 64 20 79 2d 70 6f 73 69 74 69 6f 6e n and y-position
1bf0: 29 2e 3c 62 72 3e 0d 0a 53 6f 20 61 6e 79 20 63 ).<br>..So any c
1c00: 61 6e 6f 6e 69 63 61 6c 20 47 65 6f 4a 53 4f 4e anonical GeoJSON
1c10: 20 66 69 6c 65 20 69 73 20 61 6c 77 61 79 73 20 file is always
1c20: 65 78 70 65 63 74 65 64 20 74 6f 20 72 65 66 65 expected to refe
1c30: 72 65 6e 63 65 20 3c 62 3e 53 52 49 44 3d 34 33 rence <b>SRID=43
1c40: 32 36 20 57 47 53 20 38 34 3c 2f 62 3e 20 28 69 26 WGS 84</b> (i
1c50: 2e 65 2e 20 74 68 65 20 53 52 49 44 20 69 73 20 .e. the SRID is
1c60: 3c 62 3e 6e 6f 74 3c 2f 62 3e 20 73 74 6f 72 65 <b>not</b> store
1c70: 64 20 77 69 74 68 69 6e 20 74 68 65 20 47 65 6f d within the Geo
1c80: 4a 53 4f 4e 20 66 69 6c 65 29 2e 3c 62 72 3e 3c JSON file).<br><
1c90: 62 72 3e 0d 0a 55 73 69 6e 67 20 61 6e 79 20 6f br>..Using any o
1ca0: 74 68 65 72 20 53 52 49 44 20 69 73 20 74 65 63 ther SRID is tec
1cb0: 68 6e 69 63 61 6c 6c 79 20 70 6f 73 73 69 62 6c hnically possibl
1cc0: 65 2c 20 62 75 74 20 72 65 71 75 69 72 65 73 20 e, but requires
1cd0: 61 20 63 6f 6e 76 65 6e 74 69 6f 6e 61 6c 20 61 a conventional a
1ce0: 67 72 65 65 6d 65 6e 74 20 62 65 74 77 65 65 6e greement between
1cf0: 20 77 72 69 74 65 72 73 20 61 6e 64 20 72 65 61 writers and rea
1d00: 64 65 72 73 2c 20 62 75 74 20 61 6c 6c 20 74 68 ders, but all th
1d10: 69 73 20 69 73 20 73 75 72 65 6c 79 20 6f 75 74 is is surely out
1d20: 73 69 64 65 20 74 68 65 20 73 74 61 6e 64 61 72 side the standar
1d30: 64 20 61 6e 64 20 77 69 6c 6c 20 73 75 72 65 6c d and will surel
1d40: 79 20 69 6d 70 61 69 72 20 74 68 65 20 75 6e 69 y impair the uni
1d50: 76 65 72 73 61 6c 20 70 6f 72 74 61 62 69 6c 69 versal portabili
1d60: 74 79 20 6f 66 20 61 6e 79 20 6e 6f 6e 20 63 61 ty of any non ca
1d70: 6e 6f 6e 69 63 61 6c 20 66 69 6c 65 2e 0d 0a 3c nonical file...<
1d80: 2f 74 64 3e 0d 0a 3c 74 64 3e 0d 0a 54 68 65 20 /td>..<td>..The
1d90: 75 6e 69 71 75 65 20 65 66 66 65 63 74 69 76 65 unique effective
1da0: 20 73 6f 6c 75 74 69 6f 6e 20 69 73 20 74 68 65 solution is the
1db0: 20 6f 6e 65 20 61 64 6f 70 74 65 64 20 62 79 20 one adopted by
1dc0: 47 4d 4c 2e 3c 62 72 3e 0d 0a 42 6f 74 68 20 53 GML.<br>..Both S
1dd0: 68 61 70 65 66 69 6c 65 20 61 6e 64 20 47 65 6f hapefile and Geo
1de0: 4a 53 4f 4e 20 61 72 65 20 63 6c 65 61 72 6c 79 JSON are clearly
1df0: 20 69 6e 66 65 72 69 6f 72 20 75 6e 64 65 72 20 inferior under
1e00: 74 68 69 73 20 70 65 63 75 6c 69 61 72 20 61 73 this peculiar as
1e10: 70 65 63 74 2e 0d 0a 3c 2f 74 64 3e 0d 0a 3c 2f pect...</td>..</
1e20: 74 72 3e 0d 0a 3c 74 72 3e 0d 0a 3c 74 68 3e 4e tr>..<tr>..<th>N
1e30: 6f 6e 2d 73 70 61 74 69 61 6c 20 61 74 74 72 69 on-spatial attri
1e40: 62 75 74 65 73 3c 2f 74 68 3e 0d 0a 3c 74 64 3e butes</th>..<td>
1e50: 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 43 48 41 52 ..<ul>..<li>CHAR
1e60: 20 28 6c 69 6d 69 74 65 64 20 74 6f 20 6d 61 78 (limited to max
1e70: 2e 20 32 35 34 20 62 79 74 65 73 29 3c 2f 6c 69 . 254 bytes)</li
1e80: 3e 0d 0a 3c 6c 69 3e 4e 55 4d 42 45 52 20 28 72 >..<li>NUMBER (r
1e90: 65 70 72 65 73 65 6e 74 65 64 20 62 79 20 61 6e epresented by an
1ea0: 20 41 53 43 49 49 20 73 74 72 69 6e 67 20 6f 66 ASCII string of
1eb0: 20 6d 61 78 2e 20 33 32 20 62 79 74 65 73 29 3c max. 32 bytes)<
1ec0: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 44 41 54 45 20 28 /li>..<li>DATE (
1ed0: 59 59 59 59 4d 4d 44 44 29 3c 2f 6c 69 3e 0d 0a YYYYMMDD)</li>..
1ee0: 3c 6c 69 3e 4c 4f 47 49 43 41 4c 20 28 54 2f 46 <li>LOGICAL (T/F
1ef0: 29 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c )</li>..</ul>..<
1f00: 62 72 3e 0d 0a 3c 75 3e 4e 6f 74 65 3c 2f 75 3e br>..<u>Note</u>
1f10: 3a 20 61 6c 6c 20 61 74 74 72 69 62 75 74 65 20 : all attribute
1f20: 6e 61 6d 65 73 20 61 72 65 20 6c 69 6d 69 74 65 names are limite
1f30: 64 20 74 6f 20 61 20 6c 65 6e 67 74 68 20 6f 66 d to a length of
1f40: 20 6d 61 78 2e 20 31 30 20 62 79 74 65 73 2e 20 max. 10 bytes.
1f50: 54 68 65 72 65 20 69 73 20 6e 6f 20 73 61 66 65 There is no safe
1f60: 20 77 61 79 20 66 6f 72 20 64 65 63 6c 61 72 69 way for declari
1f70: 6e 67 20 3c 62 3e 4e 55 4c 4c 3c 2f 62 3e 20 76 ng <b>NULL</b> v
1f80: 61 6c 75 65 73 2e 0d 0a 3c 2f 74 64 3e 0d 0a 3c alues...</td>..<
1f90: 74 64 3e 0d 0a 41 6e 79 20 70 6f 73 73 69 62 6c td>..Any possibl
1fa0: 65 20 64 61 74 61 74 79 70 65 20 79 6f 75 20 63 e datatype you c
1fb0: 61 6e 20 69 6d 61 67 69 6e 65 2e 3c 62 72 3e 0d an imagine.<br>.
1fc0: 0a 41 6e 64 20 64 65 66 69 6e 69 6e 67 20 66 75 .And defining fu
1fd0: 72 74 68 65 72 20 64 65 72 69 76 65 64 20 64 61 rther derived da
1fe0: 74 61 74 79 70 65 73 20 69 73 20 61 6e 20 6f 70 tatypes is an op
1ff0: 74 69 6f 6e 20 73 75 70 70 6f 72 74 65 64 20 62 tion supported b
2000: 79 20 74 68 65 20 58 4d 4c 20 53 63 68 65 6d 61 y the XML Schema
2010: 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 75 3e 4e 6f .<br><br>..<u>No
2020: 74 65 3c 2f 75 3e 3a 20 61 74 74 72 69 62 75 74 te</u>: attribut
2030: 65 20 6e 61 6d 65 73 20 61 6e 64 20 74 65 78 74 e names and text
2040: 20 76 61 6c 75 65 73 20 63 61 6e 20 68 61 76 65 values can have
2050: 20 61 6e 79 20 61 72 62 69 74 72 61 72 79 20 6c any arbitrary l
2060: 65 6e 67 74 68 2e 0d 0a 3c 2f 74 64 3e 0d 0a 3c ength...</td>..<
2070: 74 64 3e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 74 td>..<ul>..<li>t
2080: 65 78 74 20 28 75 6e 63 6f 6e 73 74 72 61 69 6e ext (unconstrain
2090: 65 64 20 6c 65 6e 67 74 68 29 3c 2f 6c 69 3e 0d ed length)</li>.
20a0: 0a 3c 6c 69 3e 6e 75 6d 62 65 72 3c 2f 6c 69 3e .<li>number</li>
20b0: 0d 0a 3c 6c 69 3e 6e 75 6c 6c 3c 2f 6c 69 3e 0d ..<li>null</li>.
20c0: 0a 3c 6c 69 3e 74 72 75 65 3c 2f 6c 69 3e 0d 0a .<li>true</li>..
20d0: 3c 6c 69 3e 66 61 6c 73 65 3c 2f 6c 69 3e 0d 0a <li>false</li>..
20e0: 3c 2f 75 6c 3e 0d 0a 3c 62 72 3e 0d 0a 3c 75 3e </ul>..<br>..<u>
20f0: 4e 6f 74 65 3c 2f 75 3e 3a 20 61 74 74 72 69 62 Note</u>: attrib
2100: 75 74 65 20 6e 61 6d 65 73 20 20 63 61 6e 20 68 ute names can h
2110: 61 76 65 20 61 6e 79 20 61 72 62 69 74 72 61 72 ave any arbitrar
2120: 79 20 6c 65 6e 67 74 68 2e 0d 0a 3c 2f 74 64 3e y length...</td>
2130: 0d 0a 3c 74 64 3e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c ..<td>..<ul>..<l
2140: 69 3e 53 68 61 70 65 66 69 6c 65 20 28 6f 72 20 i>Shapefile (or
2150: 6d 6f 72 65 20 70 72 65 63 69 73 65 6c 79 20 69 more precisely i
2160: 6e 20 74 68 69 73 20 63 61 73 65 20 44 42 46 29 n this case DBF)
2170: 20 63 6c 65 61 72 6c 79 20 73 75 66 66 65 72 73 clearly suffers
2180: 20 66 72 6f 6d 20 74 6f 6f 20 6d 61 6e 79 20 75 from too many u
2190: 6e 70 6c 65 61 73 61 6e 74 20 6c 69 6d 69 74 61 npleasant limita
21a0: 74 69 6f 6e 73 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 tions.</li>..<li
21b0: 3e 47 4d 4c 20 28 6d 6f 72 65 20 70 72 65 63 69 >GML (more preci
21c0: 73 65 6c 79 20 58 4d 4c 29 20 63 61 6e 20 65 66 sely XML) can ef
21d0: 66 65 63 74 69 76 65 6c 79 20 73 75 70 70 6f 72 fectively suppor
21e0: 74 20 61 6e 20 69 6d 70 72 65 73 73 69 76 65 20 t an impressive
21f0: 66 6c 65 78 69 62 69 6c 69 74 79 20 62 75 74 20 flexibility but
2200: 63 61 6e 20 65 61 73 69 6c 79 20 62 65 63 6f 6d can easily becom
2210: 65 20 74 6f 6f 20 63 6f 6d 70 6c 65 78 20 61 6e e too complex an
2220: 64 20 64 69 66 66 65 63 75 74 20 74 6f 20 70 61 d diffecut to pa
2230: 72 73 65 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 47 rse.</li>..<li>G
2240: 65 6f 4a 53 4f 4e 20 6f 66 66 65 72 73 20 61 20 eoJSON offers a
2250: 77 65 6c 6c 20 62 61 6c 61 6e 63 65 64 20 6d 69 well balanced mi
2260: 78 3b 20 69 74 27 73 20 73 74 69 6c 6c 20 72 65 x; it's still re
2270: 61 73 6f 6e 61 62 6c 79 20 73 69 6d 70 6c 65 20 asonably simple
2280: 61 6e 64 20 69 74 27 73 20 70 6f 77 65 72 66 75 and it's powerfu
2290: 6c 20 61 74 20 74 68 65 20 73 61 6d 65 20 74 69 l at the same ti
22a0: 6d 65 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 0d me.</li>..</ul>.
22b0: 0a 3c 2f 74 64 3e 0d 0a 3c 2f 74 72 3e 0d 0a 3c .</td>..</tr>..<
22c0: 74 72 3e 0d 0a 3c 74 64 20 61 6c 69 67 6e 3d 22 tr>..<td align="
22d0: 63 65 6e 74 65 72 22 3e 0d 0a 3c 62 3e 43 68 61 center">..<b>Cha
22e0: 72 73 65 74 20 65 6e 63 6f 64 69 6e 67 3c 2f 62 rset encoding</b
22f0: 3e 0d 0a 3c 74 61 62 6c 65 20 63 65 6c 6c 70 61 >..<table cellpa
2300: 64 64 69 6e 67 3d 22 34 22 20 63 65 6c 6c 73 70 dding="4" cellsp
2310: 61 63 69 6e 67 3d 22 34 22 3e 0d 0a 3c 74 72 3e acing="4">..<tr>
2320: 3c 74 64 20 61 6c 69 67 6e 3d 22 6c 65 66 74 22 <td align="left"
2330: 3e 0d 0a 73 65 65 20 74 68 65 20 3c 61 20 68 72 >..see the <a hr
2340: 65 66 3d 22 68 74 74 70 3a 2f 2f 77 77 77 2e 67 ef="http://www.g
2350: 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 2d aia-gis.it/gaia-
2360: 73 69 6e 73 2f 73 70 61 74 69 61 6c 69 74 65 2d sins/spatialite-
2370: 63 6f 6f 6b 62 6f 6f 6b 2d 35 2f 63 6f 6f 6b 62 cookbook-5/cookb
2380: 6f 6f 6b 5f 74 6f 70 69 63 73 2e 30 31 2e 68 74 ook_topics.01.ht
2390: 6d 6c 23 74 6f 70 69 63 5f 41 62 6f 75 74 5f 43 ml#topic_About_C
23a0: 68 61 72 73 65 74 5f 45 6e 63 6f 64 69 6e 67 22 harset_Encoding"
23b0: 3e 43 6f 6f 6b 42 6f 6f 6b 3c 2f 61 3e 20 66 6f >CookBook</a> fo
23c0: 72 20 6d 6f 72 65 20 6f 6e 20 74 68 69 73 20 74 r more on this t
23d0: 6f 70 69 63 2e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 opic...</td></tr
23e0: 3e 0d 0a 3c 2f 74 61 62 6c 65 3e 0d 0a 3c 2f 74 >..</table>..</t
23f0: 64 3e 0d 0a 3c 74 64 3e 0d 0a 4e 6f 74 20 69 6e d>..<td>..Not in
2400: 74 65 72 6e 61 6c 6c 79 20 64 65 66 69 6e 65 64 ternally defined
2410: 20 62 79 20 74 68 65 20 53 68 61 70 65 66 69 6c by the Shapefil
2420: 65 20 69 74 73 65 6c 66 2e 3c 62 72 3e 0d 0a 41 e itself.<br>..A
2430: 74 74 65 6d 70 74 69 6e 67 20 74 6f 20 67 75 65 ttempting to gue
2440: 73 73 20 74 68 65 20 61 70 70 72 6f 70 72 69 61 ss the appropria
2450: 74 65 20 63 68 61 72 73 65 74 20 65 6e 63 6f 64 te charset encod
2460: 69 6e 67 20 72 65 71 75 69 72 65 64 20 62 79 20 ing required by
2470: 73 6f 6d 65 20 53 68 61 70 65 66 69 6c 65 20 69 some Shapefile i
2480: 73 20 6d 6f 72 65 20 61 20 6d 61 67 69 63 20 61 s more a magic a
2490: 72 74 20 74 68 61 6e 20 72 61 74 69 6f 6e 61 6c rt than rational
24a0: 20 73 63 69 65 6e 63 65 2e 0d 0a 3c 2f 74 64 3e science...</td>
24b0: 0d 0a 3c 74 64 3e 0d 0a 41 6c 77 61 79 73 20 69 ..<td>..Always i
24c0: 6e 74 65 72 6e 61 6c 6c 79 20 64 65 66 69 6e 65 nternally define
24d0: 64 20 62 79 20 74 68 65 20 47 4d 4c 2f 58 4d 4c d by the GML/XML
24e0: 20 66 69 6c 65 20 69 74 73 65 6c 66 2e 0d 0a 3c file itself...<
24f0: 2f 74 64 3e 0d 0a 3c 74 64 3e 0d 0a 52 46 43 20 /td>..<td>..RFC
2500: 37 39 34 36 20 73 74 72 69 63 74 6c 79 20 72 65 7946 strictly re
2510: 71 75 69 72 65 73 20 74 68 61 74 20 61 6c 6c 20 quires that all
2520: 47 65 6f 4a 53 4f 4e 20 66 69 6c 65 73 20 6d 75 GeoJSON files mu
2530: 73 74 20 62 65 20 65 6e 63 6f 64 65 64 20 61 73 st be encoded as
2540: 20 3c 62 3e 55 54 46 2d 38 3c 2f 62 3e 3c 62 72 <b>UTF-8</b><br
2550: 3e 3c 62 72 3e 0d 0a 49 6e 20 70 75 72 65 20 74 ><br>..In pure t
2560: 68 65 6f 72 79 20 62 6f 74 68 20 3c 62 3e 55 54 heory both <b>UT
2570: 46 2d 31 36 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e F-16</b> and <b>
2580: 55 54 46 2d 33 32 3c 2f 62 3e 20 63 6f 75 6c 64 UTF-32</b> could
2590: 20 62 65 20 75 73 65 64 20 66 6f 72 20 65 6e 63 be used for enc
25a0: 6f 64 69 6e 67 20 61 20 6c 65 67 69 74 69 6d 61 oding a legitima
25b0: 74 65 20 47 65 6f 4a 53 4f 4e 20 66 69 6c 65 2c te GeoJSON file,
25c0: 20 62 75 74 20 73 75 63 68 20 6f 70 74 69 6f 6e but such option
25d0: 73 20 73 65 65 6d 73 20 74 6f 20 62 65 20 76 65 s seems to be ve
25e0: 72 79 20 72 61 72 65 6c 79 20 28 69 66 20 65 76 ry rarely (if ev
25f0: 65 72 29 20 61 64 6f 70 74 65 64 20 69 6e 20 72 er) adopted in r
2600: 65 61 6c 20 77 6f 72 6c 64 2e 0d 0a 3c 2f 74 64 eal world...</td
2610: 3e 0d 0a 3c 74 64 3e 0d 0a 3c 75 6c 3e 0d 0a 3c >..<td>..<ul>..<
2620: 6c 69 3e 53 68 61 70 65 66 69 6c 65 73 20 6c 65 li>Shapefiles le
2630: 61 76 65 73 20 61 20 6c 6f 74 20 74 6f 20 62 65 aves a lot to be
2640: 20 64 65 73 69 72 65 64 2c 20 61 6e 64 20 6c 61 desired, and la
2650: 63 6b 20 6f 66 20 64 65 66 69 6e 65 64 20 63 68 ck of defined ch
2660: 61 72 73 65 74 20 65 6e 63 6f 64 69 6e 67 20 63 arset encoding c
2670: 61 75 73 65 73 20 6d 61 6e 79 20 73 65 72 69 6f auses many serio
2680: 75 73 20 70 6f 72 74 61 62 69 6c 69 74 79 20 69 us portability i
2690: 73 73 75 65 73 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 ssues.</li>..<li
26a0: 3e 47 4d 4c 2f 58 4d 4c 20 6e 69 63 65 6c 79 20 >GML/XML nicely
26b0: 73 75 70 70 6f 72 74 73 20 61 6e 79 20 70 6f 73 supports any pos
26c0: 73 69 62 6c 65 20 63 68 61 72 73 65 74 20 69 6e sible charset in
26d0: 20 74 68 65 20 6d 6f 73 74 20 66 6c 65 78 69 62 the most flexib
26e0: 6c 65 20 28 61 6e 64 20 73 61 66 65 29 0d 0a 77 le (and safe)..w
26f0: 61 79 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 4f 6e 63 ay</li>..<li>Onc
2700: 65 20 61 67 61 69 6e 2c 20 47 65 6f 4a 53 4f 4e e again, GeoJSON
2710: 20 69 73 20 73 74 72 61 69 67 68 74 66 6f 72 77 is straightforw
2720: 61 72 64 20 61 6e 64 20 73 69 6d 70 6c 65 2c 20 ard and simple,
2730: 62 75 74 20 72 65 61 6c 6c 79 20 65 66 66 65 63 but really effec
2740: 74 69 76 65 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c tive.</li>..</ul
2750: 3e 0d 0a 3c 2f 74 64 3e 0d 0a 3c 2f 74 72 3e 0d >..</td>..</tr>.
2760: 0a 3c 2f 74 61 62 6c 65 3e 0d 0a 3c 68 32 3e 53 .</table>..<h2>S
2770: 6b 65 6c 65 74 61 6c 20 47 65 6f 4a 53 4f 4e 20 keletal GeoJSON
2780: 61 6e 61 74 68 6f 6d 79 3c 2f 68 32 3e 0d 0a 3c anathomy</h2>..<
2790: 76 65 72 62 61 74 69 6d 3e 0d 0a 7b 0d 0a 20 20 verbatim>..{..
27a0: 20 22 74 79 70 65 22 3a 20 22 46 65 61 74 75 72 "type": "Featur
27b0: 65 43 6f 6c 6c 65 63 74 69 6f 6e 22 2c 0d 0a 20 eCollection",..
27c0: 20 20 22 66 65 61 74 75 72 65 73 22 3a 20 0d 0a "features": ..
27d0: 20 20 20 5b 7b 0d 0a 20 20 20 20 20 20 20 22 74 [{.. "t
27e0: 79 70 65 22 3a 20 22 46 65 61 74 75 72 65 22 2c ype": "Feature",
27f0: 0d 0a 20 20 20 20 20 20 20 22 67 65 6f 6d 65 74 .. "geomet
2800: 72 79 22 3a 20 0d 0a 20 20 20 20 20 20 20 7b 0d ry": .. {.
2810: 0a 20 20 20 20 20 20 20 20 20 20 20 22 74 79 70 . "typ
2820: 65 22 3a 20 22 50 6f 69 6e 74 22 2c 0d 0a 20 20 e": "Point",..
2830: 20 20 20 20 20 20 20 20 20 22 63 6f 6f 72 64 69 "coordi
2840: 6e 61 74 65 73 22 3a 20 5b 31 30 32 2e 30 2c 20 nates": [102.0,
2850: 30 2e 35 5d 0d 0a 20 20 20 20 20 20 20 7d 2c 0d 0.5].. },.
2860: 0a 20 20 20 20 20 20 20 22 70 72 6f 70 65 72 74 . "propert
2870: 69 65 73 22 3a 20 0d 0a 20 20 20 20 20 20 20 7b ies": .. {
2880: 0d 0a 20 20 20 20 20 20 20 20 20 20 20 22 70 72 .. "pr
2890: 6f 70 30 22 3a 20 22 76 61 6c 75 65 30 22 0d 0a op0": "value0"..
28a0: 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 7d 2c }.. },
28b0: 20 0d 0a 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 .. {..
28c0: 20 22 74 79 70 65 22 3a 20 22 46 65 61 74 75 72 "type": "Featur
28d0: 65 22 2c 0d 0a 20 20 20 20 20 20 20 22 67 65 6f e",.. "geo
28e0: 6d 65 74 72 79 22 3a 20 0d 0a 20 20 20 20 20 20 metry": ..
28f0: 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 22 {.. "
2900: 74 79 70 65 22 3a 20 22 4c 69 6e 65 53 74 72 69 type": "LineStri
2910: 6e 67 22 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 ng",..
2920: 20 22 63 6f 6f 72 64 69 6e 61 74 65 73 22 3a 20 "coordinates":
2930: 0d 0a 20 20 20 20 20 20 20 20 20 20 5b 0d 0a 20 .. [..
2940: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 5b 31 [1
2950: 30 32 2e 30 2c 20 30 2e 30 5d 2c 0d 0a 20 20 20 02.0, 0.0],..
2960: 20 20 20 20 20 20 20 20 20 20 20 20 5b 31 30 33 [103
2970: 2e 30 2c 20 31 2e 30 5d 2c 0d 0a 20 20 20 20 20 .0, 1.0],..
2980: 20 20 20 20 20 20 20 20 20 20 5b 31 30 34 2e 30 [104.0
2990: 2c 20 30 2e 30 5d 2c 0d 0a 20 20 20 20 20 20 20 , 0.0],..
29a0: 20 20 20 20 20 20 20 20 5b 31 30 35 2e 30 2c 20 [105.0,
29b0: 31 2e 30 5d 0d 0a 20 20 20 20 20 20 20 20 20 20 1.0]..
29c0: 20 5d 0d 0a 20 20 20 20 20 20 20 7d 2c 0d 0a 20 ].. },..
29d0: 20 20 20 20 20 20 22 70 72 6f 70 65 72 74 69 65 "propertie
29e0: 73 22 3a 20 0d 0a 20 20 20 20 20 20 20 7b 0d 0a s": .. {..
29f0: 20 20 20 20 20 20 20 20 20 20 20 22 70 72 6f 70 "prop
2a00: 30 22 3a 20 22 76 61 6c 75 65 30 22 2c 0d 0a 20 0": "value0",..
2a10: 20 20 20 20 20 20 20 20 20 20 22 70 72 6f 70 31 "prop1
2a20: 22 3a 20 30 2e 30 0d 0a 20 20 20 20 20 20 20 7d ": 0.0.. }
2a30: 0d 0a 20 20 20 20 7d 2c 20 0d 0a 20 20 20 20 7b .. }, .. {
2a40: 0d 0a 20 20 20 20 20 20 20 22 74 79 70 65 22 3a .. "type":
2a50: 20 22 46 65 61 74 75 72 65 22 2c 0d 0a 20 20 20 "Feature",..
2a60: 20 20 20 20 22 67 65 6f 6d 65 74 72 79 22 3a 20 "geometry":
2a70: 0d 0a 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 .. {..
2a80: 20 20 20 20 20 20 20 22 74 79 70 65 22 3a 20 22 "type": "
2a90: 50 6f 6c 79 67 6f 6e 22 2c 0d 0a 20 20 20 20 20 Polygon",..
2aa0: 20 20 20 20 20 20 22 63 6f 6f 72 64 69 6e 61 74 "coordinat
2ab0: 65 73 22 3a 20 0d 0a 20 20 20 20 20 20 20 20 20 es": ..
2ac0: 20 20 5b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 [..
2ad0: 20 20 20 20 5b 0d 0a 20 20 20 20 20 20 20 20 20 [..
2ae0: 20 20 20 20 20 20 20 20 20 20 5b 31 30 30 2e 30 [100.0
2af0: 2c 20 30 2e 30 5d 2c 0d 0a 20 20 20 20 20 20 20 , 0.0],..
2b00: 20 20 20 20 20 20 20 20 20 20 20 20 5b 31 30 31 [101
2b10: 2e 30 2c 20 30 2e 30 5d 2c 0d 0a 20 20 20 20 20 .0, 0.0],..
2b20: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 5b 31 [1
2b30: 30 31 2e 30 2c 20 31 2e 30 5d 2c 0d 0a 20 20 20 01.0, 1.0],..
2b40: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
2b50: 5b 31 30 30 2e 30 2c 20 31 2e 30 5d 2c 0d 0a 20 [100.0, 1.0],..
2b60: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
2b70: 20 20 5b 31 30 30 2e 30 2c 20 30 2e 30 5d 0d 0a [100.0, 0.0]..
2b80: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 5d ]
2b90: 0d 0a 20 20 20 20 20 20 20 20 20 20 20 5d 0d 0a .. ]..
2ba0: 20 20 20 20 20 20 20 7d 2c 0d 0a 20 20 20 20 20 },..
2bb0: 20 20 22 70 72 6f 70 65 72 74 69 65 73 22 3a 20 "properties":
2bc0: 0d 0a 20 20 20 20 20 20 20 7b 0d 0a 20 20 20 20 .. {..
2bd0: 20 20 20 20 20 20 20 22 70 72 6f 70 30 22 3a 20 "prop0":
2be0: 22 76 61 6c 75 65 30 22 2c 0d 0a 20 20 20 20 20 "value0",..
2bf0: 20 20 20 20 20 20 22 70 72 6f 70 31 22 3a 20 7b "prop1": {
2c00: 22 74 68 69 73 22 3a 20 22 74 68 61 74 22 7d 0d "this": "that"}.
2c10: 0a 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 7d 5d . }.. }]
2c20: 0d 0a 7d 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e ..}..</verbatim>
2c30: 0d 0a 41 73 20 79 6f 75 20 63 61 6e 20 65 61 73 ..As you can eas
2c40: 69 6c 79 20 6e 6f 74 69 63 65 2c 20 47 65 6f 4a ily notice, GeoJ
2c50: 53 4f 4e 20 68 61 73 20 61 20 70 6c 61 69 6e 20 SON has a plain
2c60: 72 65 67 75 6c 61 72 20 73 74 72 75 63 74 75 72 regular structur
2c70: 65 20 61 6e 64 20 69 73 20 64 65 63 69 73 65 6c e and is decisel
2c80: 79 20 6d 6f 73 74 20 63 6f 6e 63 69 73 65 20 61 y most concise a
2c90: 6e 64 20 6c 65 73 73 20 76 65 72 62 6f 73 65 20 nd less verbose
2ca0: 74 68 61 6e 20 47 4d 4c 2f 58 4d 4c 3a 0d 0a 3c than GML/XML:..<
2cb0: 75 6c 3e 0d 0a 3c 6c 69 3e 45 76 65 72 79 20 47 ul>..<li>Every G
2cc0: 65 6f 4a 53 4f 4e 20 66 69 6c 65 20 6d 75 73 74 eoJSON file must
2cd0: 20 63 6f 6e 74 61 69 6e 20 61 20 3c 62 3e 46 65 contain a <b>Fe
2ce0: 61 74 75 72 65 43 6f 6c 6c 65 63 74 69 6f 6e 3c atureCollection<
2cf0: 2f 62 3e 20 6f 62 6a 65 63 74 2e 0d 0a 3c 75 6c /b> object...<ul
2d00: 3e 0d 0a 3c 6c 69 3e 41 20 20 3c 62 3e 46 65 61 >..<li>A <b>Fea
2d10: 74 75 72 65 43 6f 6c 6c 65 63 74 69 6f 6e 3c 2f tureCollection</
2d20: 62 3e 20 63 6f 6e 74 61 69 6e 73 20 6f 6e 65 20 b> contains one
2d30: 6f 72 20 6d 6f 72 65 20 69 6e 64 69 76 69 64 75 or more individu
2d40: 61 6c 20 3c 62 3e 46 65 61 74 75 72 65 3c 2f 62 al <b>Feature</b
2d50: 3e 20 6f 62 6a 65 63 74 73 2e 0d 0a 3c 75 6c 3e > objects...<ul>
2d60: 0d 0a 3c 6c 69 3e 45 61 63 68 20 3c 62 3e 46 65 ..<li>Each <b>Fe
2d70: 61 74 75 72 65 3c 2f 62 3e 20 69 73 20 65 78 70 ature</b> is exp
2d80: 65 63 74 65 64 20 74 6f 20 64 65 63 6c 61 72 65 ected to declare
2d90: 20 61 20 3c 62 3e 47 65 6f 6d 65 74 72 79 3c 2f a <b>Geometry</
2da0: 62 3e 20 61 6e 64 20 61 20 3c 62 3e 70 72 6f 70 b> and a <b>prop
2db0: 65 72 74 69 65 73 3c 2f 62 3e 20 61 72 72 61 79 erties</b> array
2dc0: 2e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 45 61 63 ...<ul>..<li>Eac
2dd0: 68 20 70 72 6f 70 65 72 74 79 20 63 6f 72 65 73 h property cores
2de0: 70 6f 6e 64 73 20 74 6f 20 61 6e 20 61 74 74 72 ponds to an attr
2df0: 69 62 75 74 65 20 77 69 74 68 20 61 20 3c 62 3e ibute with a <b>
2e00: 6e 61 6d 65 3c 2f 62 3e 20 61 6e 64 20 61 20 3c name</b> and a <
2e10: 62 3e 76 61 6c 75 65 3c 2f 62 3e 3c 2f 6c 69 3e b>value</b></li>
2e20: 2e 0d 0a 3c 2f 6c 69 3e 3c 2f 75 6c 3e 0d 0a 3c ...</li></ul>..<
2e30: 2f 6c 69 3e 3c 2f 75 6c 3e 0d 0a 3c 2f 6c 69 3e /li></ul>..</li>
2e40: 3c 2f 75 6c 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 68 </ul>..</ul>..<h
2e50: 33 3e 53 68 6f 72 74 20 63 6f 6e 63 6c 75 73 69 3>Short conclusi
2e60: 6f 6e 73 3c 2f 68 33 3e 0d 0a 47 65 6f 4a 53 4f ons</h3>..GeoJSO
2e70: 4e 20 69 73 20 77 69 64 65 6c 79 20 61 64 6f 70 N is widely adop
2e80: 74 65 64 20 62 79 20 6d 61 6e 79 20 77 65 62 2d ted by many web-
2e90: 61 70 70 73 3b 20 62 65 69 6e 67 20 61 20 6e 6f apps; being a no
2ea0: 74 61 74 69 6f 6e 20 64 69 72 65 63 74 6c 79 20 tation directly
2eb0: 62 61 73 65 64 20 6f 6e 20 3c 62 3e 4a 61 76 61 based on <b>Java
2ec0: 53 63 72 69 70 74 3c 2f 62 3e 20 69 74 20 68 61 Script</b> it ha
2ed0: 73 20 61 20 6e 61 74 75 72 61 6c 20 69 6e 74 65 s a natural inte
2ee0: 67 72 61 74 69 6f 6e 20 69 6e 20 70 6f 70 75 6c gration in popul
2ef0: 61 72 20 3c 69 3e 63 6c 69 65 6e 74 2d 73 69 64 ar <i>client-sid
2f00: 65 3c 2f 69 3e 20 4a 53 20 6c 69 62 72 61 72 69 e</i> JS librari
2f10: 65 73 20 73 75 63 68 20 61 73 20 3c 61 20 68 72 es such as <a hr
2f20: 65 66 3d 22 68 74 74 70 73 3a 2f 2f 65 6e 2e 77 ef="https://en.w
2f30: 69 6b 69 70 65 64 69 61 2e 6f 72 67 2f 77 69 6b ikipedia.org/wik
2f40: 69 2f 4f 70 65 6e 4c 61 79 65 72 73 22 3e 4f 70 i/OpenLayers">Op
2f50: 65 6e 4c 61 79 65 72 73 3c 2f 61 3e 20 61 6e 64 enLayers</a> and
2f60: 20 3c 61 20 68 72 65 66 3d 22 68 74 74 70 73 3a <a href="https:
2f70: 2f 2f 65 6e 2e 77 69 6b 69 70 65 64 69 61 2e 6f //en.wikipedia.o
2f80: 72 67 2f 77 69 6b 69 2f 4c 65 61 66 6c 65 74 5f rg/wiki/Leaflet_
2f90: 28 73 6f 66 74 77 61 72 65 29 22 3e 4c 65 61 66 (software)">Leaf
2fa0: 6c 65 74 3c 2f 61 3e 2e 3c 62 72 3e 0d 0a 49 74 let</a>.<br>..It
2fb0: 27 73 20 61 64 65 71 75 61 74 65 6c 79 20 73 75 's adequately su
2fc0: 70 70 6f 72 74 65 64 20 62 79 20 3c 61 20 68 72 pported by <a hr
2fd0: 65 66 3d 22 68 74 74 70 73 3a 2f 2f 65 6e 2e 77 ef="https://en.w
2fe0: 69 6b 69 70 65 64 69 61 2e 6f 72 67 2f 77 69 6b ikipedia.org/wik
2ff0: 69 2f 47 44 41 4c 22 3e 47 44 41 4c 3c 2f 61 3e i/GDAL">GDAL</a>
3000: 2c 20 61 6e 64 20 63 6f 6e 73 65 71 75 65 6e 74 , and consequent
3010: 6c 79 20 62 79 20 6d 61 6e 79 20 6f 74 68 65 72 ly by many other
3020: 73 20 66 72 65 65 2f 6c 69 62 72 65 20 73 77 20 s free/libre sw
3030: 63 6f 6d 70 6f 6e 65 6e 74 73 20 28 61 73 20 65 components (as e
3040: 2e 67 2e 20 3c 61 20 68 72 65 66 3d 22 68 74 74 .g. <a href="htt
3050: 70 73 3a 2f 2f 65 6e 2e 77 69 6b 69 70 65 64 69 ps://en.wikipedi
3060: 61 2e 6f 72 67 2f 77 69 6b 69 2f 4d 61 70 53 65 a.org/wiki/MapSe
3070: 72 76 65 72 3e 4d 61 70 53 65 72 76 65 72 22 3e rver>MapServer">
3080: 4d 61 70 53 65 72 76 65 72 3c 2f 61 3e 20 61 6e MapServer</a> an
3090: 64 20 3c 61 20 68 72 65 66 3d 22 68 74 74 70 73 d <a href="https
30a0: 3a 2f 2f 65 6e 2e 77 69 6b 69 70 65 64 69 61 2e ://en.wikipedia.
30b0: 6f 72 67 2f 77 69 6b 69 2f 47 65 6f 53 65 72 76 org/wiki/GeoServ
30c0: 65 72 22 3e 47 65 6f 53 65 72 76 65 72 3c 2f 61 er">GeoServer</a
30d0: 3e 29 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 4f 75 74 >).<br><br>..Out
30e0: 73 69 64 65 20 74 68 65 20 77 65 62 2d 67 69 73 side the web-gis
30f0: 20 61 72 65 6e 61 20 47 65 6f 4a 53 4f 4e 20 73 arena GeoJSON s
3100: 74 69 6c 6c 20 68 61 73 20 6c 69 6d 69 74 65 64 till has limited
3110: 20 61 64 6f 70 74 69 6f 6e 2c 20 61 6e 64 20 69 adoption, and i
3120: 74 27 73 20 61 20 72 65 61 6c 20 70 69 74 79 20 t's a real pity
3130: 62 65 63 61 75 73 65 20 75 6e 64 65 72 20 6d 61 because under ma
3140: 6e 79 20 61 73 70 65 63 74 73 20 69 74 27 73 20 ny aspects it's
3150: 61 20 76 65 72 79 20 76 61 6c 69 64 20 66 75 6c a very valid ful
3160: 6c 20 72 65 70 6c 61 63 65 6d 65 6e 74 20 66 6f l replacement fo
3170: 72 20 74 68 65 20 6e 6f 77 61 64 61 79 73 20 69 r the nowadays i
3180: 72 72 65 6d 65 64 69 61 62 6c 79 20 6f 62 73 6f rremediably obso
3190: 6c 65 74 65 20 53 68 61 70 65 66 69 6c 65 2e 3c lete Shapefile.<
31a0: 62 72 3e 0d 0a 53 74 61 72 74 69 6e 67 20 73 69 br>..Starting si
31b0: 6e 63 65 20 76 65 72 73 69 6f 6e 20 3c 62 3e 35 nce version <b>5
31c0: 2e 30 2e 30 3c 2f 62 3e 20 53 70 61 74 69 61 4c .0.0</b> SpatiaL
31d0: 69 74 65 20 6f 66 66 65 72 73 20 66 75 6c 6c 20 ite offers full
31e0: 73 75 70 70 6f 72 74 73 20 74 6f 20 47 65 6f 4a supports to GeoJ
31f0: 53 4f 4e 20 61 73 20 64 65 66 69 6e 65 64 20 62 SON as defined b
3200: 79 20 52 46 43 20 37 39 34 36 2e 3c 62 72 3e 0d y RFC 7946.<br>.
3210: 0a 54 68 65 20 69 6d 70 6c 65 6d 65 6e 74 61 74 .The implementat
3220: 69 6f 6e 20 73 74 72 6f 6e 67 6c 79 20 72 65 73 ion strongly res
3230: 65 6d 62 6c 65 73 20 74 68 65 20 6f 6e 65 20 73 embles the one s
3240: 75 70 70 6f 72 74 65 64 20 62 79 20 61 6c 6c 20 upported by all
3250: 70 72 65 76 69 6f 75 73 20 76 65 72 73 69 6f 6e previous version
3260: 73 20 66 6f 72 20 53 68 61 70 65 66 69 6c 65 2c s for Shapefile,
3270: 20 61 6e 64 20 74 68 69 73 20 69 73 6e 27 74 20 and this isn't
3280: 61 74 20 61 6c 6c 20 73 75 72 70 72 69 73 69 6e at all surprisin
3290: 67 20 62 65 63 61 75 73 65 20 62 6f 74 68 20 74 g because both t
32a0: 68 65 6d 20 63 6f 76 65 72 20 74 68 65 20 73 61 hem cover the sa
32b0: 6d 65 20 66 75 6e 63 74 69 6f 6e 61 6c 20 61 72 me functional ar
32c0: 65 61 2e 0d 0a 3c 62 72 3e 3c 62 72 3e 0d 0a 3c ea...<br><br>..<
32d0: 68 72 3e 0d 0a 3c 68 31 3e 53 51 4c 20 66 75 6e hr>..<h1>SQL fun
32e0: 63 74 69 6f 6e 73 20 73 75 70 70 6f 72 74 69 6e ctions supportin
32f0: 67 20 47 65 6f 4a 53 4f 4e 3c 2f 68 31 3e 0d 0a g GeoJSON</h1>..
3300: 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 <verbatim>..SELE
3310: 43 54 20 45 78 70 6f 72 74 47 65 6f 4a 53 4f 4e CT ExportGeoJSON
3320: 32 28 27 6d 79 74 61 62 6c 65 27 2c 20 27 67 65 2('mytable', 'ge
3330: 6f 6d 27 2c 20 27 2f 68 6f 6d 65 2f 73 61 6e 64 om', '/home/sand
3340: 72 6f 2f 6d 79 74 61 62 6c 65 2e 67 65 6f 6a 73 ro/mytable.geojs
3350: 6f 6e 27 29 3b 0d 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d on');..---------
3360: 0d 0a 31 32 33 34 0d 0a 0d 0a 53 45 4c 45 43 54 ..1234....SELECT
3370: 20 45 78 70 6f 72 74 47 65 6f 4a 53 4f 4e 32 28 ExportGeoJSON2(
3380: 27 6d 79 74 61 62 6c 65 27 2c 20 27 67 65 6f 6d 'mytable', 'geom
3390: 27 2c 20 27 2f 68 6f 6d 65 2f 73 61 6e 64 72 6f ', '/home/sandro
33a0: 2f 6d 79 74 61 62 6c 65 2e 67 65 6f 6a 73 6f 6e /mytable.geojson
33b0: 27 2c 20 31 32 29 3b 0d 0a 2d 2d 2d 2d 2d 2d 2d ', 12);..-------
33c0: 2d 2d 0d 0a 31 32 33 34 0d 0a 0d 0a 53 45 4c 45 --..1234....SELE
33d0: 43 54 20 45 78 70 6f 72 74 47 65 6f 4a 53 4f 4e CT ExportGeoJSON
33e0: 32 28 27 6d 79 74 61 62 6c 65 27 2c 20 27 67 65 2('mytable', 'ge
33f0: 6f 6d 27 2c 20 27 2f 68 6f 6d 65 2f 73 61 6e 64 om', '/home/sand
3400: 72 6f 2f 6d 79 74 61 62 6c 65 2e 67 65 6f 6a 73 ro/mytable.geojs
3410: 6f 6e 27 2c 20 31 32 2c 20 31 29 3b 0d 0a 2d 2d on', 12, 1);..--
3420: 2d 2d 2d 2d 2d 2d 2d 0d 0a 31 32 33 34 0d 0a 0d -------..1234...
3430: 0a 53 45 4c 45 43 54 20 45 78 70 6f 72 74 47 65 .SELECT ExportGe
3440: 6f 4a 53 4f 4e 32 28 27 6d 79 74 61 62 6c 65 27 oJSON2('mytable'
3450: 2c 20 27 67 65 6f 6d 27 2c 20 27 2f 68 6f 6d 65 , 'geom', '/home
3460: 2f 73 61 6e 64 72 6f 2f 6d 79 74 61 62 6c 65 2e /sandro/mytable.
3470: 67 65 6f 6a 73 6f 6e 27 2c 20 31 32 2c 20 31 2c geojson', 12, 1,
3480: 20 30 29 3b 0d 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 0);..---------.
3490: 0a 31 32 33 34 0d 0a 0d 0a 53 45 4c 45 43 54 20 .1234....SELECT
34a0: 45 78 70 6f 72 74 47 65 6f 4a 53 4f 4e 32 28 27 ExportGeoJSON2('
34b0: 6d 79 74 61 62 6c 65 27 2c 20 27 67 65 6f 6d 27 mytable', 'geom'
34c0: 2c 20 27 2f 68 6f 6d 65 2f 73 61 6e 64 72 6f 2f , '/home/sandro/
34d0: 6d 79 74 61 62 6c 65 2e 67 65 6f 6a 73 6f 6e 27 mytable.geojson'
34e0: 2c 20 31 32 2c 20 31 2c 20 30 2c 20 31 29 3b 0d , 12, 1, 0, 1);.
34f0: 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 0a 31 32 33 34 .---------..1234
3500: 0d 0a 0d 0a 53 45 4c 45 43 54 20 45 78 70 6f 72 ....SELECT Expor
3510: 74 47 65 6f 4a 53 4f 4e 32 28 27 6d 79 74 61 62 tGeoJSON2('mytab
3520: 6c 65 27 2c 20 27 67 65 6f 6d 27 2c 20 27 2f 68 le', 'geom', '/h
3530: 6f 6d 65 2f 73 61 6e 64 72 6f 2f 6d 79 74 61 62 ome/sandro/mytab
3540: 6c 65 2e 67 65 6f 6a 73 6f 6e 27 2c 20 31 32 2c le.geojson', 12,
3550: 20 31 2c 20 30 2c 20 31 2c 20 27 4c 4f 57 45 52 1, 0, 1, 'LOWER
3560: 43 41 53 45 27 29 3b 0d 0a 2d 2d 2d 2d 2d 2d 2d CASE');..-------
3570: 2d 2d 0d 0a 31 32 33 34 0d 0a 3c 2f 76 65 72 62 --..1234..</verb
3580: 61 74 69 6d 3e 0d 0a 54 68 65 20 53 51 4c 20 66 atim>..The SQL f
3590: 75 6e 63 74 69 6f 6e 20 3c 62 3e 45 78 70 6f 72 unction <b>Expor
35a0: 74 47 65 6f 4a 53 4f 4e 32 28 29 3c 2f 62 3e 20 tGeoJSON2()</b>
35b0: 63 61 6e 20 64 69 72 65 63 74 6c 79 20 65 78 70 can directly exp
35c0: 6f 72 74 20 61 20 77 68 6f 6c 65 20 53 70 61 74 ort a whole Spat
35d0: 69 61 6c 20 54 61 62 6c 65 20 28 61 6b 61 20 3c ial Table (aka <
35e0: 69 3e 4c 61 79 65 72 3c 2f 69 3e 29 20 69 6e 74 i>Layer</i>) int
35f0: 6f 20 61 6e 20 65 78 74 65 6e 61 6c 20 47 65 6f o an extenal Geo
3600: 4a 53 4f 4e 20 66 69 6c 65 20 63 6f 6e 66 6f 72 JSON file confor
3610: 6d 61 74 20 74 6f 20 52 46 43 20 37 39 34 36 2e mat to RFC 7946.
3620: 3c 62 72 3e 0d 0a 54 68 69 73 20 66 75 6e 63 74 <br>..This funct
3630: 69 6f 6e 20 61 63 63 65 70 74 73 20 74 68 65 20 ion accepts the
3640: 66 6f 6c 6c 6f 77 69 6e 67 20 61 72 67 75 6d 65 following argume
3650: 6e 74 73 3a 0d 0a 3c 6f 6c 3e 0d 0a 3c 6c 69 3e nts:..<ol>..<li>
3660: 3c 62 3e 74 61 62 6c 65 3c 2f 62 3e 3a 20 28 3c <b>table</b>: (<
3670: 69 3e 6d 61 6e 64 61 74 6f 72 79 3c 2f 69 3e 29 i>mandatory</i>)
3680: 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 53 70 61 name of the Spa
3690: 74 69 61 6c 20 54 61 62 6c 65 20 74 6f 20 62 65 tial Table to be
36a0: 20 65 78 70 6f 72 74 65 64 2e 3c 2f 6c 69 3e 0d exported.</li>.
36b0: 0a 3c 6c 69 3e 3c 62 3e 67 65 6f 6d 5f 63 6f 6c .<li><b>geom_col
36c0: 75 6d 6e 3c 2f 62 3e 3a 20 28 3c 69 3e 6d 61 6e umn</b>: (<i>man
36d0: 64 61 74 6f 72 79 3c 2f 69 3e 29 20 6e 61 6d 65 datory</i>) name
36e0: 20 6f 66 20 74 68 65 20 43 6f 6c 75 6d 6e 20 63 of the Column c
36f0: 6f 6e 74 61 69 6e 69 6e 67 20 74 68 65 20 47 65 ontaining the Ge
3700: 6f 6d 65 74 72 69 65 73 20 74 6f 20 62 65 20 65 ometries to be e
3710: 78 70 6f 72 74 65 64 2e 3c 62 72 3e 0d 0a 43 61 xported.<br>..Ca
3720: 6e 20 62 65 20 3c 62 3e 4e 55 4c 4c 3c 2f 62 3e n be <b>NULL</b>
3730: 2c 20 61 6e 64 20 69 6e 20 74 68 69 73 20 63 61 , and in this ca
3740: 73 65 20 74 68 65 20 66 75 6e 63 74 69 6f 6e 20 se the function
3750: 77 69 6c 6c 20 61 75 74 6f 6d 61 74 69 63 61 6c will automatical
3760: 6c 79 20 64 65 74 65 72 6d 69 6e 65 20 74 68 65 ly determine the
3770: 20 61 70 70 72 6f 70 72 69 61 74 65 20 43 6f 6c appropriate Col
3780: 75 6d 6e 2d 6e 61 6d 65 20 69 66 20 74 68 65 20 umn-name if the
3790: 54 61 62 6c 65 20 6a 75 73 74 20 63 6f 6e 74 61 Table just conta
37a0: 69 6e 73 20 61 20 73 69 6e 67 6c 65 20 47 65 6f ins a single Geo
37b0: 6d 65 74 72 79 2c 20 6f 74 68 65 72 77 69 73 65 metry, otherwise
37c0: 20 61 20 66 61 69 6c 75 72 65 20 77 69 6c 6c 20 a failure will
37d0: 66 6f 6c 6c 6f 77 2e 3c 2f 6c 69 3e 0d 0a 3c 6c follow.</li>..<l
37e0: 69 3e 3c 62 3e 66 69 6c 65 6e 61 6d 65 3c 2f 62 i><b>filename</b
37f0: 3e 3a 20 28 3c 69 3e 6d 61 6e 64 61 74 6f 72 79 >: (<i>mandatory
3800: 3c 2f 69 3e 29 20 61 62 73 6f 6c 75 74 65 20 6f </i>) absolute o
3810: 72 20 72 65 6c 61 74 69 76 65 20 70 61 74 68 20 r relative path
3820: 6f 66 20 74 68 65 20 47 65 6f 4a 73 6f 6e 20 66 of the GeoJson f
3830: 69 6c 65 20 74 6f 20 62 65 20 63 72 65 61 74 65 ile to be create
3840: 64 20 28 3c 69 3e 6f 75 74 70 75 74 20 66 69 6c d (<i>output fil
3850: 65 3c 2f 69 3e 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c e</i>).</li>..<l
3860: 69 3e 3c 62 3e 70 72 65 63 69 73 69 6f 6e 3c 2f i><b>precision</
3870: 62 3e 3a 20 28 3c 69 3e 6f 70 74 69 6f 6e 61 6c b>: (<i>optional
3880: 3c 2f 69 3e 29 20 6e 75 6d 62 65 72 20 6f 66 20 </i>) number of
3890: 64 65 63 69 6d 61 6c 20 64 69 67 69 74 73 20 74 decimal digits t
38a0: 6f 20 62 65 20 75 73 65 64 20 66 6f 72 20 63 6f o be used for co
38b0: 6f 72 64 69 6e 61 74 65 20 76 61 6c 75 65 73 3b ordinate values;
38c0: 20 74 68 65 20 64 65 66 61 75 6c 74 20 73 65 74 the default set
38d0: 74 69 6e 67 20 69 73 20 3c 62 3e 38 3c 2f 62 3e ting is <b>8</b>
38e0: 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 6c .</li>..<li><b>l
38f0: 6f 6e 5f 6c 61 74 3c 2f 62 3e 3a 20 28 3c 69 3e on_lat</b>: (<i>
3900: 6f 70 74 69 6f 6e 61 6c 3c 2f 69 3e 29 20 74 68 optional</i>) th
3910: 69 73 20 69 73 20 61 20 62 6f 6f 6c 65 61 6e 20 is is a boolean
3920: 66 6c 61 67 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 flag:..<ul>..<li
3930: 3e 69 66 20 73 65 74 20 74 6f 20 3c 62 3e 46 41 >if set to <b>FA
3940: 4c 53 45 3c 2f 62 3e 20 61 6c 6c 20 63 6f 6f 72 LSE</b> all coor
3950: 64 69 6e 61 74 65 73 20 77 69 6c 6c 20 62 65 20 dinates will be
3960: 65 78 70 6f 72 74 65 64 20 65 78 61 63 74 6c 79 exported exactly
3970: 20 61 73 20 74 68 65 79 20 61 72 65 2e 3c 2f 6c as they are.</l
3980: 69 3e 0d 0a 3c 6c 69 3e 69 66 20 73 65 74 20 74 i>..<li>if set t
3990: 6f 20 3c 62 3e 54 52 55 45 3c 2f 62 3e 20 61 6c o <b>TRUE</b> al
39a0: 6c 20 63 6f 6f 72 64 69 6e 61 74 65 73 20 77 69 l coordinates wi
39b0: 6c 6c 20 62 65 20 61 75 74 6f 6d 61 74 69 63 61 ll be automatica
39c0: 6c 6c 79 20 74 72 61 6e 73 66 6f 72 6d 65 64 20 lly transformed
39d0: 28 69 66 20 72 65 71 75 69 72 65 64 29 20 69 6e (if required) in
39e0: 74 6f 20 3c 62 3e 53 52 49 44 3d 34 33 32 36 20 to <b>SRID=4326
39f0: 57 47 53 20 38 34 3c 2f 62 3e 20 61 73 20 72 65 WGS 84</b> as re
3a00: 71 75 69 72 65 64 20 62 79 20 52 46 43 20 37 39 quired by RFC 79
3a10: 34 36 2e 3c 62 72 3e 0d 0a 54 68 69 73 20 69 73 46.<br>..This is
3a20: 20 74 68 65 20 64 65 66 61 75 6c 74 20 73 65 74 the default set
3a30: 74 69 6e 67 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c ting.</li>..</ul
3a40: 3e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 4d ></li>..<li><b>M
3a50: 5f 63 6f 6f 72 64 73 3c 2f 62 3e 3a 20 28 3c 69 _coords</b>: (<i
3a60: 3e 6f 70 74 69 6f 6e 61 6c 3c 2f 69 3e 29 20 74 >optional</i>) t
3a70: 68 69 73 20 74 6f 6f 20 69 73 20 61 20 62 6f 6f his too is a boo
3a80: 6c 65 61 6e 20 66 6c 61 67 3a 0d 0a 3c 75 6c 3e lean flag:..<ul>
3a90: 0d 0a 3c 6c 69 3e 69 66 20 73 65 74 20 74 6f 20 ..<li>if set to
3aa0: 3c 62 3e 46 41 4c 53 45 3c 2f 62 3e 20 65 76 65 <b>FALSE</b> eve
3ab0: 6e 74 75 61 6c 20 3c 62 3e 4d 2d 76 61 6c 75 65 ntual <b>M-value
3ac0: 73 3c 2f 62 3e 20 77 69 6c 6c 20 62 65 20 73 69 s</b> will be si
3ad0: 6d 70 6c 79 20 69 67 6e 6f 72 65 64 2c 20 61 73 mply ignored, as
3ae0: 20 72 65 71 75 69 72 65 64 20 62 79 20 52 46 43 required by RFC
3af0: 20 37 39 34 36 2e 3c 62 72 3e 0d 0a 54 68 69 73 7946.<br>..This
3b00: 20 69 73 20 74 68 65 20 64 65 66 61 75 6c 74 20 is the default
3b10: 73 65 74 74 69 6e 67 2e 3c 2f 6c 69 3e 0d 0a 3c setting.</li>..<
3b20: 6c 69 3e 69 66 20 73 65 74 20 74 6f 20 3c 62 3e li>if set to <b>
3b30: 54 52 55 45 3c 2f 62 3e 20 65 76 65 6e 74 75 61 TRUE</b> eventua
3b40: 6c 20 3c 62 3e 4d 2d 76 61 6c 75 65 73 3c 2f 62 l <b>M-values</b
3b50: 3e 20 77 69 6c 6c 20 62 65 20 65 78 70 6f 72 74 > will be export
3b60: 65 64 20 69 6e 74 6f 20 74 68 65 20 47 65 6f 4a ed into the GeoJ
3b70: 53 4f 4e 20 66 69 6c 65 20 61 73 20 65 78 74 72 SON file as extr
3b80: 61 2d 63 6f 6f 72 64 69 6e 61 74 65 73 2e 3c 62 a-coordinates.<b
3b90: 72 3e 0d 0a 3c 75 3e 4e 6f 74 65 3c 2f 75 3e 3a r>..<u>Note</u>:
3ba0: 20 74 68 65 20 72 65 73 75 6c 74 69 6e 67 20 6f the resulting o
3bb0: 75 74 70 75 74 20 66 69 6c 65 20 63 6f 75 6c 64 utput file could
3bc0: 20 65 61 73 69 6c 79 20 73 75 66 66 65 72 20 66 easily suffer f
3bd0: 72 6f 6d 20 6c 69 6d 69 74 65 64 20 70 6f 72 74 rom limited port
3be0: 61 62 69 6c 69 74 79 2e 3c 2f 6c 69 3e 0d 0a 3c ability.</li>..<
3bf0: 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c /ul></li>..<li><
3c00: 62 3e 69 6e 64 65 6e 74 65 64 3c 2f 62 3e 3a 20 b>indented</b>:
3c10: 28 3c 69 3e 6f 70 74 69 6f 6e 61 6c 3c 2f 69 3e (<i>optional</i>
3c20: 29 20 79 65 74 20 61 6e 6f 74 68 65 72 20 62 6f ) yet another bo
3c30: 6f 6c 65 61 6e 20 66 6c 61 67 3a 0d 0a 3c 75 6c olean flag:..<ul
3c40: 3e 0d 0a 3c 6c 69 3e 49 66 20 73 65 74 20 74 6f >..<li>If set to
3c50: 20 3c 62 3e 54 52 55 45 3c 2f 62 3e 20 74 68 65 <b>TRUE</b> the
3c60: 20 6f 75 74 70 75 74 20 66 69 6c 65 20 77 69 6c output file wil
3c70: 6c 20 62 65 20 70 72 6f 70 65 72 6c 79 20 69 6e l be properly in
3c80: 64 65 6e 74 65 64 20 66 6f 72 20 65 6e 68 61 6e dented for enhan
3c90: 63 65 64 20 68 75 6d 61 6e 20 72 65 61 64 69 62 ced human readib
3ca0: 69 6c 69 74 79 2e 3c 62 72 3e 0d 0a 54 68 69 73 ility.<br>..This
3cb0: 20 69 73 20 74 68 65 20 64 65 66 61 75 6c 74 20 is the default
3cc0: 73 65 74 74 69 6e 67 2e 3c 2f 6c 69 3e 0d 0a 3c setting.</li>..<
3cd0: 6c 69 3e 49 66 20 73 65 74 20 74 6f 20 3c 62 3e li>If set to <b>
3ce0: 46 41 4c 53 45 3c 2f 62 3e 20 74 68 65 20 6f 75 FALSE</b> the ou
3cf0: 74 70 75 74 20 66 69 6c 65 20 77 69 6c 6c 20 62 tput file will b
3d00: 65 20 61 6c 6c 20 69 6e 20 61 20 73 69 6e 67 6c e all in a singl
3d10: 65 20 6d 6f 6e 6f 6c 69 74 68 69 63 20 6c 69 6e e monolithic lin
3d20: 65 20 77 69 74 68 6f 75 74 20 62 6c 61 6e 6b 20 e without blank
3d30: 73 70 61 63 65 73 20 6f 72 20 6e 65 77 6c 69 6e spaces or newlin
3d40: 65 73 20 28 6e 6f 74 69 63 65 61 62 6c 79 20 73 es (noticeably s
3d50: 6d 61 6c 6c 65 72 29 2e 3c 2f 6c 69 3e 0d 0a 3c maller).</li>..<
3d60: 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c /ul></li>..<li><
3d70: 62 3e 63 6f 6c 6e 61 6d 65 5f 63 61 73 65 3c 2f b>colname_case</
3d80: 62 3e 3a 20 28 3c 69 3e 6f 70 74 69 6f 6e 61 6c b>: (<i>optional
3d90: 3c 2f 69 3e 29 20 63 61 6e 20 61 73 73 75 6d 65 </i>) can assume
3da0: 20 6f 6e 65 20 74 68 65 20 66 6f 6c 6c 6f 77 69 one the followi
3db0: 6e 67 20 76 61 6c 75 65 73 3a 0d 0a 3c 75 6c 3e ng values:..<ul>
3dc0: 0d 0a 3c 6c 69 3e 3c 62 3e 27 55 50 50 45 52 27 ..<li><b>'UPPER'
3dd0: 3c 2f 62 3e 20 6f 72 20 3c 62 3e 27 55 50 50 45 </b> or <b>'UPPE
3de0: 52 43 41 53 45 27 3c 2f 62 3e 3a 20 61 6c 6c 20 RCASE'</b>: all
3df0: 61 74 74 72 69 62 75 74 65 20 6e 61 6d 65 73 20 attribute names
3e00: 77 69 6c 6c 20 62 65 20 69 6e 73 65 72 74 65 64 will be inserted
3e10: 20 69 6e 74 6f 20 74 68 65 20 6f 75 74 70 75 74 into the output
3e20: 20 66 69 6c 65 20 69 6e 20 66 75 6c 6c 20 75 70 file in full up
3e30: 70 65 72 20 63 61 73 65 2e 3c 2f 6c 69 3e 0d 0a per case.</li>..
3e40: 3c 6c 69 3e 3c 62 3e 27 4c 4f 57 45 52 27 3c 2f <li><b>'LOWER'</
3e50: 62 3e 20 6f 72 20 3c 62 3e 27 4c 4f 57 45 52 43 b> or <b>'LOWERC
3e60: 41 53 45 27 3c 2f 62 3e 3a 20 61 6c 6c 20 61 74 ASE'</b>: all at
3e70: 74 72 69 62 75 74 65 20 6e 61 6d 65 73 20 77 69 tribute names wi
3e80: 6c 6c 20 62 65 20 69 6e 73 65 72 74 65 64 20 69 ll be inserted i
3e90: 6e 74 6f 20 74 68 65 20 6f 75 74 70 75 74 20 66 nto the output f
3ea0: 69 6c 65 20 69 6e 20 66 75 6c 6c 20 6c 6f 77 65 ile in full lowe
3eb0: 72 20 63 61 73 65 2e 3c 62 72 3e 0d 0a 54 68 69 r case.<br>..Thi
3ec0: 73 20 69 73 20 74 68 65 20 64 65 66 61 75 6c 74 s is the default
3ed0: 20 73 65 74 74 69 6e 67 2e 3c 2f 6c 69 3e 0d 0a setting.</li>..
3ee0: 3c 6c 69 3e 3c 62 3e 27 53 41 4d 45 27 3c 2f 62 <li><b>'SAME'</b
3ef0: 3e 20 6f 72 20 3c 62 3e 27 53 41 4d 45 43 41 53 > or <b>'SAMECAS
3f00: 45 27 3c 2f 62 3e 3a 20 61 6c 6c 20 61 74 74 72 E'</b>: all attr
3f10: 69 62 75 74 65 20 6e 61 6d 65 73 20 77 69 6c 6c ibute names will
3f20: 20 62 65 20 69 6e 73 65 72 74 65 64 20 69 6e 74 be inserted int
3f30: 6f 20 74 68 65 20 6f 75 74 70 75 74 20 66 69 6c o the output fil
3f40: 65 20 70 72 65 73 65 72 76 69 6e 67 20 61 6c 6c e preserving all
3f50: 20 75 70 70 65 72 2d 20 61 6e 64 20 6c 6f 77 65 upper- and lowe
3f60: 72 2d 63 61 73 65 20 6c 65 74 74 65 72 73 20 65 r-case letters e
3f70: 78 61 63 74 6c 79 20 61 73 20 74 68 65 79 20 61 xactly as they a
3f80: 72 65 20 64 65 66 69 6e 65 64 20 69 6e 20 74 68 re defined in th
3f90: 65 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 e corresponding
3fa0: 63 6f 6c 75 6d 6e 20 6e 61 6d 65 73 2e 3c 2f 6c column names.</l
3fb0: 69 3e 0d 0a 3c 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a i>..</ul></li>..
3fc0: 3c 6c 69 3e 74 68 65 20 3c 62 3e 72 65 74 75 72 <li>the <b>retur
3fd0: 6e 20 76 61 6c 75 65 3c 2f 62 3e 20 69 73 20 61 n value</b> is a
3fe0: 6e 20 3c 62 3e 49 4e 54 45 47 45 52 3c 2f 62 3e n <b>INTEGER</b>
3ff0: 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 74 corresponding t
4000: 6f 20 74 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 o the number of
4010: 65 78 70 6f 72 74 65 64 20 72 6f 77 73 2c 20 6f exported rows, o
4020: 72 20 3c 62 3e 4e 55 4c 4c 3c 2f 62 3e 20 69 6e r <b>NULL</b> in
4030: 20 74 68 65 20 63 61 73 65 20 6f 66 20 66 61 69 the case of fai
4040: 6c 75 72 65 20 6f 72 20 69 6e 76 61 6c 69 64 20 lure or invalid
4050: 61 72 67 75 6d 65 6e 74 73 2e 3c 2f 6c 69 3e 0d arguments.</li>.
4060: 0a 3c 2f 6f 6c 3e 0d 0a 3c 74 61 62 6c 65 20 63 .</ol>..<table c
4070: 65 6c 6c 73 70 61 63 69 6e 67 3d 22 34 22 20 63 ellspacing="4" c
4080: 65 6c 6c 70 61 64 64 69 6e 67 3d 22 38 22 20 62 ellpadding="8" b
4090: 67 63 6f 6c 6f 72 3d 22 23 66 66 66 66 64 30 22 gcolor="#ffffd0"
40a0: 3e 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 68 33 3e 43 ><tr><td>..<h3>C
40b0: 61 76 65 61 74 3c 2f 68 33 3e 0d 0a 41 20 73 69 aveat</h3>..A si
40c0: 6d 69 6c 61 72 20 66 75 6e 63 74 69 6f 6e 20 6e milar function n
40d0: 61 6d 65 64 20 3c 62 3e 45 78 70 6f 72 74 47 65 amed <b>ExportGe
40e0: 6f 4a 53 4f 4e 28 29 3c 2f 62 3e 20 77 61 73 20 oJSON()</b> was
40f0: 61 6c 72 65 61 64 79 20 73 75 70 70 6f 72 74 65 already supporte
4100: 64 20 62 79 20 70 72 65 76 69 6f 75 73 20 76 65 d by previous ve
4110: 72 73 69 6f 6e 73 20 6f 66 20 53 70 61 74 69 61 rsions of Spatia
4120: 4c 69 74 65 2c 20 62 75 74 20 69 74 20 77 61 73 Lite, but it was
4130: 20 6d 6f 64 65 6c 6c 65 64 20 61 67 61 69 6e 73 modelled agains
4140: 74 20 74 68 65 20 6f 6c 64 20 28 3c 62 3e 70 72 t the old (<b>pr
4150: 65 2d 52 46 43 3c 2f 62 3e 29 20 47 65 6f 4a 53 e-RFC</b>) GeoJS
4160: 4f 4e 20 73 70 65 63 69 66 69 63 61 74 69 6f 6e ON specification
4170: 2e 3c 62 72 3e 0d 0a 3c 62 3e 45 78 70 6f 72 74 .<br>..<b>Export
4180: 47 65 6f 4a 53 4f 4e 28 29 3c 2f 62 3e 20 69 73 GeoJSON()</b> is
4190: 20 6e 6f 77 20 3c 62 3e 44 45 50 52 45 43 41 54 now <b>DEPRECAT
41a0: 45 44 3c 2f 62 3e 2c 20 61 6e 64 20 77 69 6c 6c ED</b>, and will
41b0: 20 72 65 6d 61 69 6e 20 74 6f 20 61 76 6f 69 64 remain to avoid
41c0: 20 62 72 65 61 6b 69 6e 67 20 65 78 69 73 74 69 breaking existi
41d0: 6e 67 20 61 70 70 6c 69 63 61 74 69 6f 6e 73 20 ng applications
41e0: 61 6e 64 20 73 63 72 69 70 74 73 2e 3c 62 72 3e and scripts.<br>
41f0: 3c 62 72 3e 0d 0a 49 74 20 69 73 20 73 74 72 6f <br>..It is stro
4200: 6e 67 6c 79 20 72 65 63 6f 6d 6d 65 6e 64 65 64 ngly recommended
4210: 20 74 6f 20 75 73 65 20 3c 62 3e 45 78 70 6f 72 to use <b>Expor
4220: 74 47 65 6f 4a 53 4f 4e 32 28 29 3c 2f 62 3e 20 tGeoJSON2()</b>
4230: 66 6f 72 20 61 6e 79 20 6e 65 77 20 64 65 76 65 for any new deve
4240: 6c 6f 70 6d 65 6e 74 20 61 73 20 66 75 6c 6c 20 lopment as full
4250: 72 65 70 6c 61 63 65 6d 65 6e 74 20 63 6f 6e 66 replacement conf
4260: 6f 72 6d 61 6e 74 20 74 6f 20 52 46 43 20 37 39 ormant to RFC 79
4270: 34 36 2e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 3c 46...</td></tr><
4280: 2f 74 61 62 6c 65 3e 0d 0a 3c 62 72 3e 0d 0a 3c /table>..<br>..<
4290: 74 61 62 6c 65 20 63 65 6c 6c 73 70 61 63 69 6e table cellspacin
42a0: 67 3d 22 34 22 20 63 65 6c 6c 70 61 64 64 69 6e g="4" cellpaddin
42b0: 67 3d 22 38 22 20 62 67 63 6f 6c 6f 72 3d 22 23 g="8" bgcolor="#
42c0: 66 66 63 30 61 30 22 3e 3c 74 72 3e 3c 74 64 3e ffc0a0"><tr><td>
42d0: 0d 0a 3c 68 33 3e 57 61 72 6e 69 6e 67 3c 2f 68 ..<h3>Warning</h
42e0: 33 3e 0d 0a 54 68 69 73 20 53 51 4c 20 66 75 6e 3>..This SQL fun
42f0: 63 74 69 6f 6e 20 6f 70 65 6e 20 74 68 65 20 64 ction open the d
4300: 6f 6f 72 20 74 6f 20 6d 61 6e 79 20 70 6f 74 65 oor to many pote
4310: 6e 74 69 61 6c 20 73 65 63 75 72 69 74 79 20 69 ntial security i
4320: 73 73 75 65 73 2c 20 61 6e 64 20 74 68 75 73 20 ssues, and thus
4330: 3c 62 3e 3c 69 3e 69 73 20 61 6c 77 61 79 73 20 <b><i>is always
4340: 64 69 73 61 62 6c 65 64 20 62 79 20 64 65 66 61 disabled by defa
4350: 75 6c 74 3c 2f 69 3e 3c 2f 62 3e 2e 3c 62 72 3e ult</i></b>.<br>
4360: 0d 0a 45 78 70 6c 69 63 69 74 6c 79 20 73 65 74 ..Explicitly set
4370: 74 69 6e 67 20 74 68 65 20 65 78 74 65 72 6e 61 ting the externa
4380: 6c 20 76 61 72 69 61 62 6c 65 20 3c 62 3e 53 50 l variable <b>SP
4390: 41 54 49 41 4c 49 54 45 5f 53 45 43 55 52 49 54 ATIALITE_SECURIT
43a0: 59 3d 72 65 6c 61 78 65 64 3c 2f 62 3e 20 69 73 Y=relaxed</b> is
43b0: 20 61 62 73 6f 6c 75 74 65 6c 79 20 72 65 71 75 absolutely requ
43c0: 69 72 65 64 20 69 6e 20 6f 72 64 65 72 20 74 6f ired in order to
43d0: 20 65 6e 61 62 6c 65 20 74 68 69 73 20 66 75 6e enable this fun
43e0: 63 74 69 6f 6e 2e 0d 0a 3c 2f 74 64 3e 3c 2f 74 ction...</td></t
43f0: 72 3e 3c 2f 74 61 62 6c 65 3e 0d 0a 3c 62 72 3e r></table>..<br>
4400: 0d 0a 3c 68 72 3e 0d 0a 3c 76 65 72 62 61 74 69 ..<hr>..<verbati
4410: 6d 3e 0d 0a 53 45 4c 45 43 54 20 49 6d 70 6f 72 m>..SELECT Impor
4420: 74 47 65 6f 4a 53 4f 4e 28 27 2f 68 6f 6d 65 2f tGeoJSON('/home/
4430: 73 61 6e 64 72 6f 2f 73 6f 6d 65 6c 61 79 65 72 sandro/somelayer
4440: 2e 67 65 6f 6a 73 6f 6e 27 2c 20 27 73 6f 6d 65 .geojson', 'some
4450: 6c 61 79 65 72 27 29 3b 0d 0a 2d 2d 2d 2d 2d 2d layer');..------
4460: 2d 2d 2d 2d 2d 0d 0a 39 39 0d 0a 0d 0a 53 45 4c -----..99....SEL
4470: 45 43 54 20 49 6d 70 6f 72 74 47 65 6f 4a 53 4f ECT ImportGeoJSO
4480: 4e 28 27 2f 68 6f 6d 65 2f 73 61 6e 64 72 6f 2f N('/home/sandro/
4490: 73 6f 6d 65 6c 61 79 65 72 2e 67 65 6f 6a 73 6f somelayer.geojso
44a0: 6e 27 2c 20 27 73 6f 6d 65 6c 61 79 65 72 27 2c n', 'somelayer',
44b0: 20 27 67 65 6f 6d 27 29 3b 0d 0a 2d 2d 2d 2d 2d 'geom');..-----
44c0: 2d 2d 2d 2d 2d 2d 0d 0a 39 39 0d 0a 0d 0a 53 45 ------..99....SE
44d0: 4c 45 43 54 20 49 6d 70 6f 72 74 47 65 6f 4a 53 LECT ImportGeoJS
44e0: 4f 4e 28 27 2f 68 6f 6d 65 2f 73 61 6e 64 72 6f ON('/home/sandro
44f0: 2f 73 6f 6d 65 6c 61 79 65 72 2e 67 65 6f 6a 73 /somelayer.geojs
4500: 6f 6e 27 2c 20 27 73 6f 6d 65 6c 61 79 65 72 27 on', 'somelayer'
4510: 2c 20 27 67 65 6f 6d 27 2c 20 31 29 3b 0d 0a 2d , 'geom', 1);..-
4520: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 0a 39 39 0d 0a ----------..99..
4530: 0d 0a 53 45 4c 45 43 54 20 49 6d 70 6f 72 74 47 ..SELECT ImportG
4540: 65 6f 4a 53 4f 4e 28 27 2f 68 6f 6d 65 2f 73 61 eoJSON('/home/sa
4550: 6e 64 72 6f 2f 73 6f 6d 65 6c 61 79 65 72 2e 67 ndro/somelayer.g
4560: 65 6f 6a 73 6f 6e 27 2c 20 27 73 6f 6d 65 6c 61 eojson', 'somela
4570: 79 65 72 27 2c 20 27 67 65 6f 6d 27 2c 20 31 2c yer', 'geom', 1,
4580: 20 33 30 30 33 29 3b 0d 0a 2d 2d 2d 2d 2d 2d 2d 3003);..-------
4590: 2d 2d 2d 2d 0d 0a 39 39 0d 0a 0d 0a 53 45 4c 45 ----..99....SELE
45a0: 43 54 20 49 6d 70 6f 72 74 47 65 6f 4a 53 4f 4e CT ImportGeoJSON
45b0: 28 27 2f 68 6f 6d 65 2f 73 61 6e 64 72 6f 2f 73 ('/home/sandro/s
45c0: 6f 6d 65 6c 61 79 65 72 2e 67 65 6f 6a 73 6f 6e omelayer.geojson
45d0: 27 2c 20 27 73 6f 6d 65 6c 61 79 65 72 27 2c 20 ', 'somelayer',
45e0: 27 67 65 6f 6d 27 2c 20 31 2c 20 33 30 30 33 2c 'geom', 1, 3003,
45f0: 20 27 4c 4f 57 45 52 43 41 53 45 27 29 3b 0d 0a 'LOWERCASE');..
4600: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 0a 39 39 0d -----------..99.
4610: 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 54 68 .</verbatim>..Th
4620: 65 20 53 51 4c 20 66 75 6e 63 74 69 6f 6e 20 3c e SQL function <
4630: 62 3e 49 6d 70 6f 72 74 47 65 6f 4a 53 4f 4e 28 b>ImportGeoJSON(
4640: 29 3c 2f 62 3e 20 63 61 6e 20 64 69 72 65 63 74 )</b> can direct
4650: 6c 79 20 63 72 65 61 74 65 20 61 20 6e 65 77 20 ly create a new
4660: 53 70 61 74 69 61 6c 20 54 61 62 6c 65 20 62 79 Spatial Table by
4670: 20 69 6d 70 6f 72 74 69 6e 67 20 64 61 74 61 20 importing data
4680: 66 72 6f 6d 20 61 6e 20 65 78 74 65 6e 61 6c 20 from an extenal
4690: 47 65 6f 4a 53 4f 4e 20 66 69 6c 65 20 63 6f 6e GeoJSON file con
46a0: 66 6f 72 6d 61 74 20 74 6f 20 52 46 43 20 37 39 format to RFC 79
46b0: 34 36 2e 3c 62 72 3e 0d 0a 54 68 69 73 20 66 75 46.<br>..This fu
46c0: 6e 63 74 69 6f 6e 20 61 63 63 65 70 74 73 20 74 nction accepts t
46d0: 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 61 72 67 he following arg
46e0: 75 6d 65 6e 74 73 3a 0d 0a 3c 6f 6c 3e 0d 0a 3c uments:..<ol>..<
46f0: 6c 69 3e 3c 62 3e 66 69 6c 65 6e 61 6d 65 3c 2f li><b>filename</
4700: 62 3e 3a 20 28 3c 69 3e 6d 61 6e 64 61 74 6f 72 b>: (<i>mandator
4710: 79 3c 2f 69 3e 29 20 61 62 73 6f 6c 75 74 65 20 y</i>) absolute
4720: 6f 72 20 72 65 6c 61 74 69 76 65 20 70 61 74 68 or relative path
4730: 20 6f 66 20 74 68 65 20 47 65 6f 4a 73 6f 6e 20 of the GeoJson
4740: 66 69 6c 65 20 74 6f 20 62 65 20 69 6d 70 6f 72 file to be impor
4750: 74 65 64 20 28 3c 69 3e 69 6e 70 75 74 20 66 69 ted (<i>input fi
4760: 6c 65 3c 2f 69 3e 29 2e 3c 2f 6c 69 3e 0d 0a 3c le</i>).</li>..<
4770: 6c 69 3e 3c 62 3e 74 61 62 6c 65 3c 2f 62 3e 3a li><b>table</b>:
4780: 20 28 3c 69 3e 6d 61 6e 64 61 74 6f 72 79 3c 2f (<i>mandatory</
4790: 69 3e 29 20 6e 61 6d 65 20 6f 66 20 74 68 65 20 i>) name of the
47a0: 53 70 61 74 69 61 6c 20 54 61 62 6c 65 20 74 6f Spatial Table to
47b0: 20 62 65 20 63 72 65 61 74 65 64 2e 3c 2f 6c 69 be created.</li
47c0: 3e 0d 0a 3c 6c 69 3e 3c 62 3e 67 65 6f 6d 5f 63 >..<li><b>geom_c
47d0: 6f 6c 75 6d 6e 3c 2f 62 3e 3a 20 28 3c 69 3e 6f olumn</b>: (<i>o
47e0: 70 74 69 6f 6e 61 6c 3c 2f 69 3e 29 20 6e 61 6d ptional</i>) nam
47f0: 65 20 6f 66 20 74 68 65 20 47 65 6f 6d 65 74 72 e of the Geometr
4800: 79 20 43 6f 6c 75 6d 6e 20 74 6f 20 62 65 20 63 y Column to be c
4810: 72 65 61 74 65 64 2e 3c 62 72 3e 0d 0a 49 66 20 reated.<br>..If
4820: 6e 6f 74 20 65 78 70 6c 69 63 69 74 6c 79 20 73 not explicitly s
4830: 70 65 63 69 66 69 65 64 20 6f 72 20 3c 62 3e 4e pecified or <b>N
4840: 55 4c 4c 3c 2f 62 3e 20 61 20 63 6f 6c 75 6d 6e ULL</b> a column
4850: 20 6e 61 6d 65 64 20 3c 62 3e 27 67 65 6f 6d 65 named <b>'geome
4860: 74 72 79 27 3c 2f 62 3e 20 77 69 6c 6c 20 62 65 try'</b> will be
4870: 20 63 72 65 61 74 65 64 20 62 79 20 64 65 66 61 created by defa
4880: 75 6c 74 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c ult.</li>..<li><
4890: 62 3e 73 70 61 74 69 61 6c 5f 69 6e 64 65 78 3c b>spatial_index<
48a0: 2f 62 3e 3a 20 28 3c 69 3e 6f 70 74 69 6f 6e 61 /b>: (<i>optiona
48b0: 6c 3c 2f 69 3e 29 20 74 68 69 73 20 69 73 20 61 l</i>) this is a
48c0: 20 62 6f 6f 6c 65 61 6e 20 66 6c 61 67 3a 0d 0a boolean flag:..
48d0: 3c 75 6c 3e 0d 0a 3c 6c 69 3e 69 66 20 73 65 74 <ul>..<li>if set
48e0: 20 74 6f 20 3c 62 3e 54 52 55 45 3c 2f 62 3e 20 to <b>TRUE</b>
48f0: 61 20 3c 62 3e 53 70 61 74 69 61 6c 49 6e 64 65 a <b>SpatialInde
4900: 78 3c 2f 62 3e 20 73 75 70 70 6f 72 74 69 6e 67 x</b> supporting
4910: 20 74 68 65 20 47 65 6f 6d 65 74 72 79 20 43 6f the Geometry Co
4920: 6c 75 6d 6e 20 77 69 6c 6c 20 62 65 20 61 75 74 lumn will be aut
4930: 6f 6d 61 74 69 63 61 6c 6c 79 20 63 72 65 61 74 omatically creat
4940: 65 64 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 69 66 ed.</li>..<li>if
4950: 20 73 65 74 20 74 6f 20 3c 62 3e 46 41 4c 53 45 set to <b>FALSE
4960: 3c 2f 62 3e 20 6e 6f 20 53 70 61 74 69 61 6c 49 </b> no SpatialI
4970: 6e 64 65 78 20 77 69 6c 6c 20 62 65 20 63 72 65 ndex will be cre
4980: 61 74 65 64 2e 3c 62 72 3e 0d 0a 54 68 69 73 20 ated.<br>..This
4990: 69 73 20 74 68 65 20 64 65 66 61 75 6c 74 20 73 is the default s
49a0: 65 74 74 69 6e 67 2e 3c 2f 6c 69 3e 0d 0a 3c 2f etting.</li>..</
49b0: 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 ul></li>..<li><b
49c0: 3e 73 72 69 64 3c 2f 62 3e 3a 20 28 3c 69 3e 6f >srid</b>: (<i>o
49d0: 70 74 69 6f 6e 61 6c 3c 2f 69 3e 29 3a 0d 0a 3c ptional</i>):..<
49e0: 75 6c 3e 0d 0a 3c 6c 69 3e 57 68 65 6e 20 69 74 ul>..<li>When it
49f0: 27 73 20 61 20 3c 62 3e 70 6f 73 69 74 69 76 65 's a <b>positive
4a00: 20 69 6e 74 65 67 65 72 3c 2f 62 3e 20 69 74 20 integer</b> it
4a10: 63 6f 72 72 65 73 70 6f 6e 64 73 20 74 6f 20 74 corresponds to t
4a20: 68 65 20 53 52 49 44 20 76 61 6c 75 65 20 74 6f he SRID value to
4a30: 20 62 65 20 61 73 73 69 67 6e 65 64 20 74 6f 20 be assigned to
4a40: 61 6c 6c 20 69 6d 70 6f 72 74 65 64 20 47 65 6f all imported Geo
4a50: 6d 65 74 72 69 65 73 2e 3c 2f 6c 69 3e 0d 0a 3c metries.</li>..<
4a60: 6c 69 3e 49 66 20 3c 62 3e 30 3c 2f 62 3e 20 6f li>If <b>0</b> o
4a70: 72 20 3c 62 3e 6e 65 67 61 74 69 76 65 3c 2f 62 r <b>negative</b
4a80: 3e 20 61 6c 6c 20 69 6d 70 6f 72 74 65 64 20 47 > all imported G
4a90: 65 6f 6d 65 74 72 69 65 73 20 77 69 6c 6c 20 62 eometries will b
4aa0: 65 20 61 73 73 75 6d 65 64 20 74 6f 20 62 65 20 e assumed to be
4ab0: 69 6e 20 3c 62 3e 53 52 49 44 3d 34 33 32 36 20 in <b>SRID=4326
4ac0: 57 47 53 20 38 34 3c 2f 62 3e 20 28 3c 69 3e 67 WGS 84</b> (<i>g
4ad0: 65 6f 67 72 61 70 68 69 63 20 63 6f 6f 72 64 69 eographic coordi
4ae0: 6e 61 74 65 73 20 65 78 70 72 65 73 73 65 64 20 nates expressed
4af0: 61 73 20 3c 62 3e 4c 6f 6e 67 69 74 75 64 65 73 as <b>Longitudes
4b00: 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 4c 61 74 69 </b> and <b>Lati
4b10: 74 75 64 65 73 3c 2f 62 3e 3c 2f 69 3e 29 20 61 tudes</b></i>) a
4b20: 73 20 72 65 71 75 69 72 65 64 20 62 79 20 52 46 s required by RF
4b30: 43 20 37 39 34 36 2e 3c 62 72 3e 0d 0a 54 68 69 C 7946.<br>..Thi
4b40: 73 20 69 73 20 74 68 65 20 64 65 66 61 75 6c 74 s is the default
4b50: 20 73 65 74 74 69 6e 67 2e 3c 2f 6c 69 3e 0d 0a setting.</li>..
4b60: 3c 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e </ul></li>..<li>
4b70: 3c 62 3e 63 6f 6c 6e 61 6d 65 5f 63 61 73 65 3c <b>colname_case<
4b80: 2f 62 3e 3a 20 28 3c 69 3e 6f 70 74 69 6f 6e 61 /b>: (<i>optiona
4b90: 6c 3c 2f 69 3e 29 20 63 61 6e 20 61 73 73 75 6d l</i>) can assum
4ba0: 65 20 6f 6e 65 20 74 68 65 20 66 6f 6c 6c 6f 77 e one the follow
4bb0: 69 6e 67 20 76 61 6c 75 65 73 3a 0d 0a 3c 75 6c ing values:..<ul
4bc0: 3e 0d 0a 3c 6c 69 3e 3c 62 3e 27 55 50 50 45 52 >..<li><b>'UPPER
4bd0: 27 3c 2f 62 3e 20 6f 72 20 3c 62 3e 27 55 50 50 '</b> or <b>'UPP
4be0: 45 52 43 41 53 45 27 3c 2f 62 3e 3a 20 61 6c 6c ERCASE'</b>: all
4bf0: 20 63 6f 6c 75 6d 6e 73 20 77 69 6c 6c 20 62 65 columns will be
4c00: 20 63 72 65 61 74 65 64 20 69 6e 74 6f 20 74 68 created into th
4c10: 65 20 74 61 62 6c 65 20 69 6e 20 66 75 6c 6c 20 e table in full
4c20: 75 70 70 65 72 20 63 61 73 65 2e 3c 2f 6c 69 3e upper case.</li>
4c30: 0d 0a 3c 6c 69 3e 3c 62 3e 27 4c 4f 57 45 52 27 ..<li><b>'LOWER'
4c40: 3c 2f 62 3e 20 6f 72 20 3c 62 3e 27 4c 4f 57 45 </b> or <b>'LOWE
4c50: 52 43 41 53 45 27 3c 2f 62 3e 3a 20 61 6c 6c 20 RCASE'</b>: all
4c60: 63 6f 6c 75 6d 6e 73 20 77 69 6c 6c 20 62 65 20 columns will be
4c70: 63 72 65 61 74 65 64 20 69 6e 74 6f 20 74 68 65 created into the
4c80: 20 74 61 62 6c 65 20 69 6e 20 66 75 6c 6c 20 6c table in full l
4c90: 6f 77 65 72 20 63 61 73 65 2e 3c 62 72 3e 0d 0a ower case.<br>..
4ca0: 54 68 69 73 20 69 73 20 74 68 65 20 64 65 66 61 This is the defa
4cb0: 75 6c 74 20 73 65 74 74 69 6e 67 2e 3c 2f 6c 69 ult setting.</li
4cc0: 3e 0d 0a 3c 6c 69 3e 3c 62 3e 27 53 41 4d 45 27 >..<li><b>'SAME'
4cd0: 3c 2f 62 3e 20 6f 72 20 3c 62 3e 27 53 41 4d 45 </b> or <b>'SAME
4ce0: 43 41 53 45 27 3c 2f 62 3e 3a 20 61 6c 6c 20 63 CASE'</b>: all c
4cf0: 6f 6c 75 6d 6e 73 20 77 69 6c 6c 20 62 65 20 63 olumns will be c
4d00: 72 65 61 74 65 64 20 69 6e 74 6f 20 74 68 65 20 reated into the
4d10: 74 61 62 6c 65 20 70 72 65 73 65 72 76 69 6e 67 table preserving
4d20: 20 61 6c 6c 20 75 70 70 65 72 2d 20 61 6e 64 20 all upper- and
4d30: 6c 6f 77 65 72 2d 63 61 73 65 20 6c 65 74 74 65 lower-case lette
4d40: 72 73 20 65 78 61 63 74 6c 79 20 61 73 20 74 68 rs exactly as th
4d50: 65 79 20 61 72 65 20 64 65 66 69 6e 65 64 20 69 ey are defined i
4d60: 6e 20 74 68 65 20 63 6f 72 72 65 73 70 6f 6e 64 n the correspond
4d70: 69 6e 67 20 47 65 6f 4a 53 4f 4e 20 61 74 74 72 ing GeoJSON attr
4d80: 69 62 75 74 65 20 6e 61 6d 65 73 2e 3c 2f 6c 69 ibute names.</li
4d90: 3e 0d 0a 3c 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c >..</ul></li>..<
4da0: 6c 69 3e 74 68 65 20 3c 62 3e 72 65 74 75 72 6e li>the <b>return
4db0: 20 76 61 6c 75 65 3c 2f 62 3e 20 69 73 20 61 6e value</b> is an
4dc0: 20 3c 62 3e 49 4e 54 45 47 45 52 3c 2f 62 3e 20 <b>INTEGER</b>
4dd0: 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f corresponding to
4de0: 20 74 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 65 the number of e
4df0: 78 70 6f 72 74 65 64 20 72 6f 77 73 2c 20 6f 72 xported rows, or
4e00: 20 3c 62 3e 4e 55 4c 4c 3c 2f 62 3e 20 69 6e 20 <b>NULL</b> in
4e10: 74 68 65 20 63 61 73 65 20 6f 66 20 66 61 69 6c the case of fail
4e20: 75 72 65 20 6f 72 20 69 6e 76 61 6c 69 64 20 61 ure or invalid a
4e30: 72 67 75 6d 65 6e 74 73 2e 3c 2f 6c 69 3e 0d 0a rguments.</li>..
4e40: 3c 2f 6f 6c 3e 0d 0a 3c 74 61 62 6c 65 20 63 65 </ol>..<table ce
4e50: 6c 6c 73 70 61 63 69 6e 67 3d 22 34 22 20 63 65 llspacing="4" ce
4e60: 6c 6c 70 61 64 64 69 6e 67 3d 22 38 22 20 62 67 llpadding="8" bg
4e70: 63 6f 6c 6f 72 3d 22 23 66 66 63 30 61 30 22 3e color="#ffc0a0">
4e80: 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 68 33 3e 57 61 <tr><td>..<h3>Wa
4e90: 72 6e 69 6e 67 3c 2f 68 33 3e 0d 0a 54 68 69 73 rning</h3>..This
4ea0: 20 53 51 4c 20 66 75 6e 63 74 69 6f 6e 20 6f 70 SQL function op
4eb0: 65 6e 20 74 68 65 20 64 6f 6f 72 20 74 6f 20 6d en the door to m
4ec0: 61 6e 79 20 70 6f 74 65 6e 74 69 61 6c 20 73 65 any potential se
4ed0: 63 75 72 69 74 79 20 69 73 73 75 65 73 2c 20 61 curity issues, a
4ee0: 6e 64 20 74 68 75 73 20 3c 62 3e 3c 69 3e 69 73 nd thus <b><i>is
4ef0: 20 61 6c 77 61 79 73 20 64 69 73 61 62 6c 65 64 always disabled
4f00: 20 62 79 20 64 65 66 61 75 6c 74 3c 2f 69 3e 3c by default</i><
4f10: 2f 62 3e 2e 3c 62 72 3e 0d 0a 45 78 70 6c 69 63 /b>.<br>..Explic
4f20: 69 74 6c 79 20 73 65 74 74 69 6e 67 20 74 68 65 itly setting the
4f30: 20 65 78 74 65 72 6e 61 6c 20 76 61 72 69 61 62 external variab
4f40: 6c 65 20 3c 62 3e 53 50 41 54 49 41 4c 49 54 45 le <b>SPATIALITE
4f50: 5f 53 45 43 55 52 49 54 59 3d 72 65 6c 61 78 65 _SECURITY=relaxe
4f60: 64 3c 2f 62 3e 20 69 73 20 61 62 73 6f 6c 75 74 d</b> is absolut
4f70: 65 6c 79 20 72 65 71 75 69 72 65 64 20 69 6e 20 ely required in
4f80: 6f 72 64 65 72 20 74 6f 20 65 6e 61 62 6c 65 20 order to enable
4f90: 74 68 69 73 20 66 75 6e 63 74 69 6f 6e 2e 0d 0a this function...
4fa0: 3c 2f 74 64 3e 3c 2f 74 72 3e 3c 2f 74 61 62 6c </td></tr></tabl
4fb0: 65 3e 0d 0a 3c 62 72 3e 0d 0a 3c 68 72 3e 0d 0a e>..<br>..<hr>..
4fc0: 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 68 72 3e 3c 62 <br><br>..<hr><b
4fd0: 72 3e 0d 0a 3c 61 20 68 72 65 66 3d 22 68 74 74 r>..<a href="htt
4fe0: 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 ps://www.gaia-gi
4ff0: 73 2e 69 74 2f 66 6f 73 73 69 6c 2f 6c 69 62 73 s.it/fossil/libs
5000: 70 61 74 69 61 6c 69 74 65 2f 77 69 6b 69 3f 6e patialite/wiki?n
5010: 61 6d 65 3d 34 2e 33 2e 30 2d 64 6f 63 22 3e 62 ame=4.3.0-doc">b
5020: 61 63 6b 3c 2f 61 3e 0a 5a 20 66 37 64 65 61 32 ack</a>.Z f7dea2
5030: 39 65 39 37 39 31 63 39 31 66 64 63 39 38 38 38 9e9791c91fdc9888
5040: 65 34 35 35 32 39 64 30 65 63 0a e45529d0ec.