[postgis-commits] svn - r2907 - trunk/doc
postgis-commits at postgis.refractions.net
postgis-commits at postgis.refractions.net
Fri Aug 1 08:18:44 PDT 2008
Author: robe
Date: 2008-08-01 08:18:43 -0700 (Fri, 01 Aug 2008)
New Revision: 2907
Modified:
trunk/doc/reference_new.xml
Log:
Provide example for geojson (excerpts from postgis newsgroup thread)
Modified: trunk/doc/reference_new.xml
===================================================================
--- trunk/doc/reference_new.xml 2008-08-01 15:12:20 UTC (rev 2906)
+++ trunk/doc/reference_new.xml 2008-08-01 15:18:43 UTC (rev 2907)
@@ -2288,11 +2288,11 @@
<para><xref linkend="ST_AsBinary" /><xref linkend="ST_AsEWKB" /><xref linkend="ST_AsText" />, <xref linkend="ST_GeomFromEWKT" /></para>
</refsection>
</refentry>
- <refentry id="ST_AsGeoJson">
+ <refentry id="ST_AsGeoJSON">
<refnamediv>
- <refname>ST_AsGeoJson</refname>
+ <refname>ST_AsGeoJSON</refname>
- <refpurpose>Return the geometry as a GeoJson element.</refpurpose>
+ <refpurpose>Return the geometry as a GeoJSON element.</refpurpose>
</refnamediv>
<refsynopsisdiv>
@@ -2336,10 +2336,10 @@
<refsection>
<title>Description</title>
- <para>Return the geometry as a GeoJson element. (Cf <ulink
- url="http://geojson.org/geojson-spec.html">GeoJson
+ <para>Return the geometry as a Geometry Javascript Object Notation (GeoJSON) element. (Cf <ulink
+ url="http://geojson.org/geojson-spec.html">GeoJSON
specifications 1.0</ulink>). 2D and 3D Geometries are both
- supported. GeoJson only support SFS 1.1 geometry type (no curve
+ supported. GeoJSON only support SFS 1.1 geometry type (no curve
support for example).</para>
<para>The version parameter, if specified, must be 1.</para>
@@ -2355,33 +2355,44 @@
</listitem>
<listitem>
- <para>1: GeoJson CRS</para>
+ <para>1: GeoJSON CRS</para>
</listitem>
<listitem>
- <para>2: GeoJson Bbox</para>
+ <para>2: GeoJSON Bbox</para>
</listitem>
<listitem>
- <para>3: Both GeoJson Bbox and CRS</para>
+ <para>3: Both GeoJSON Bbox and CRS</para>
</listitem>
</itemizedlist>
GeoJson CRS pattern is: <literal>auth_name:auth_srid</literal>
from spatial_ref_sys table (EPSG:4326 for instance).
</para>
- <para>Version 1: ST_AsGeoJson(geom) / precision=15 version=1 options=0</para>
- <para>Version 2: ST_AsGeoJson(geom, precision) / version=1 options=0</para>
- <para>Version 3: ST_AsGeoJson(geom, precision, options) / version=1</para>
- <para>Version 4: ST_AsGeoJson(version, geom) / precision=15 options=0</para>
- <para>Version 5: ST_AsGeoJson(version, geom, precision) /options=0</para>
- <para>Version 6: ST_AsGeoJson(version, geom, precision,options)</para>
+ <para>Version 1: ST_AsGeoJSON(geom) / precision=15 version=1 options=0</para>
+ <para>Version 2: ST_AsGeoJSON(geom, precision) / version=1 options=0</para>
+ <para>Version 3: ST_AsGeoJSON(geom, precision, options) / version=1</para>
+ <para>Version 4: ST_AsGeoJSON(version, geom) / precision=15 options=0</para>
+ <para>Version 5: ST_AsGeoJSON(version, geom, precision) /options=0</para>
+ <para>Version 6: ST_AsGeoJSON(version, geom, precision,options)</para>
<note><para>Availability: 1.3.4</para></note>
</refsection>
<refsection>
<title>Examples</title>
- <programlisting><!-- TODO: --></programlisting>
+ <para>GeoJSON format is generally more efficient than other formats for use in ajax mapping.
+ One popular javascript client that supports this is Open Layers.
+ Example of its use is <ulink
+ url="http://openlayers.org/dev/examples/vector-formats.html">OpenLayers GeoJSON Example</ulink>
+ </para>
+ <programlisting>SELECT ST_AsGeoJSON(the_geom) from fe_edges limit 1;
+ st_asgeojson
+-----------------------------------------------------------------------------------------------------------
+
+{"type":"MultiLineString","coordinates":[[[-89.734634999999997,31.4920720000
+00000],[-89.734955999999997,31.492237999999997]]]}
+(1 row)</programlisting>
</refsection>
</refentry>
<refentry id="ST_AsGML">
@@ -2901,12 +2912,12 @@
<remark>TODO: Insert appropriate MathML markup here or use a gif.
Simple HTML markup does not work well in both IE and Firefox.</remark>
- <informalfigure>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/st_crosses-math.gif" />
- </imageobject>
- </mediaobject>
+ <informalfigure>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/st_crosses-math.gif" />
+ </imageobject>
+ </mediaobject>
</informalfigure>
<para>The DE-9IM Intersection Matrix for the two geometries is:</para>
@@ -3715,12 +3726,12 @@
<remark>TODO: Insert appropriate MathML markup here or use a gif.
Simple HTML markup does not work well in both IE and Firefox.</remark>
- <informalfigure>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/st_touches-math.gif" />
- </imageobject>
- </mediaobject>
+ <informalfigure>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/st_touches-math.gif" />
+ </imageobject>
+ </mediaobject>
</informalfigure>
<para>The allowable DE-9IM Intersection Matrices for the two geometries are:</para>
More information about the postgis-commits
mailing list