Changes between Version 43 and Version 44 of GeoDjango


Ignore:
Timestamp:
Mar 25, 2007, 2:35:37 PM (18 years ago)
Author:
jbronn
Comment:

improved Model API section

Legend:

Unmodified
Added
Removed
Modified
  • GeoDjango

    v43 v44  
    212212
    213213== Creating a Geometry Object and Saving ==
    214 Here is an example of how to create a geometry object (assuming the {{{Zip}}} model example above).  Geometries can be represented in either the WKT (Well Known Text) format, or in HEXEWKB (PostGIS specific, essentially a WKB geometry in hexadecimal).   ''See'' Open GIS Consortium, Inc., ''[http://portal.opengeospatial.org/files/?artifact_id=829&ei=Z5oGRv6aCZ-IwQKh2LXwAw&usg=__4YgoHsbqjocl8Z01SwMAyN84aW0=&sig2=4DpSpm83ZDEIBKSivWcYGQ OpenGIS Simple Feature Specification For SQL]'', Document 99-049 (May 5, 1999), at  Ch. 3.2.5 (SQL Textual Representation of Geometry, pg. 53); ''see also'' [http://postgis.refractions.net/docs/ch04.html#id2904792 "PostGIS EWKB, EWKT and Canonical Forms"], PostGIS documentation at Ch. 4.1.2.
     214Here is an example of how to create a geometry object (assuming the {{{Zip}}} model example above):
     215
    215216{{{
    216217>>> from zipcode.models import Zip
     
    218219>>> z.save()
    219220}}}
     221
     222Geometries are represented as '''strings''' in either of the formats WKT (Well Known Text) or HEXEWKB (PostGIS specific, essentially a WKB geometry in hexadecimal).  For example:
     223 * WKT Polygon: {{{'POLYGON(( 10 10, 10 20, 20 20, 20 15, 10 10))'}}}
     224 * HEXEWKB Polygon: '{{{0103000000010000000 ... 00000000000002440'}}}
     225
     226'''References:'''
     227 * ''See'' Open GIS Consortium, Inc., ''[http://portal.opengeospatial.org/files/?artifact_id=829&ei=Z5oGRv6aCZ-IwQKh2LXwAw&usg=__4YgoHsbqjocl8Z01SwMAyN84aW0=&sig2=4DpSpm83ZDEIBKSivWcYGQ OpenGIS Simple Feature Specification For SQL]'', Document 99-049 (May 5, 1999), at  Ch. 3.2.5 (SQL Textual Representation of Geometry, pg. 53).
     228 * ''See also'' [http://postgis.refractions.net/docs/ch04.html#id2904792 "PostGIS EWKB, EWKT and Canonical Forms"], PostGIS documentation at Ch. 4.1.2.
    220229
    221230= Database API =
     
    263272
    264273== PostGIS GEOS Function Field Lookup Types ==
    265  * ''See generally'' "Geometry Relationship Functions", PostGIS Documentation at Ch. 6.1.2.  This documentation will be updated completely with the content from the aforementioned PostGIS docs.
     274 * ''See generally'' [http://postgis.refractions.net/docs/ch06.html#id2615853 "Geometry Relationship Functions", PostGIS Documentation at Ch. 6.1.2].  This documentation will be updated completely with the content from the aforementioned PostGIS docs.
    266275 * {{{distance}}}
    267276   * Return the cartesian distance between two geometries in projected units.
Back to Top