[postgis-users] GeoJson export function

Courtin Olivier olivier.courtin at camptocamp.com
Wed Apr 23 09:56:10 PDT 2008


Hi,

GeoJson is a format we use widely between server and Web GIS  
applications,
cf <http://wiki.geojson.org/GeoJSON_draft_version_6>

So it sounds like a good idea to have GeoJson native support
in PostGIS,

Attached to this post is a patch against current PostGIS SVN, with:
  - ST_asGeoJson implementation
  - units tests
  - DocBook documentation entry

To play with it, after installation, generate a GeoJson element:

SELECT ST_AsGeoJson(the_geom) FROM your_table LIMIT 1;

and copy/paste the result in OpenLayers:
cf <http://openlayers.org/dev/examples/vector-formats.html>

Any reaction welcome,

HTH,
--
Olivier
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PATCH_GEOJSON_23_04
Type: application/octet-stream
Size: 126197 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20080423/6da1a2f5/attachment.obj>
-------------- next part --------------



More information about the postgis-users mailing list