Changes between Version 73 and Version 74 of GeoDjango


Ignore:
Timestamp:
May 24, 2007, 8:47:16 PM (18 years ago)
Author:
jbronn
Comment:

updated for r5336 API changes

Legend:

Unmodified
Added
Removed
Modified
  • GeoDjango

    v73 v74  
    8989   * Support for a mapping framework (e.g. Google Maps/Earth, Yahoo Maps, MS Live, etc.)
    9090     * Admin fields and forms (WKT field currently as of r4884, but we want widgets to view and manipulate geographic objects).
    91    * Utilities for importing raster data (SHP files first) directly into Django models -- will be done with the forthcoming {{{LayerMapping}}} class.
     91   * Utilities for importing vector and raster data (SHP files first) directly into Django models -- will be done with the forthcoming {{{LayerMapping}}} class.
    9292   * Distance queries, calculations, and related utilities.
    9393 * '''Complete'''
     
    144144class School(models.Model, models.GeoMixin):
    145145    name  = models.CharField(maxlength=35)
    146     point = models.PointField(index=True)
     146    point = models.PointField()
    147147
    148148    objects = models.GeoManager()
    149149}}}
    150150
    151 '''Notes''':  The {{{GeoMixin}}} class allows for [GeoDjango#ExtraInstanceMethods extra instance methods]. The {{{index}}} keyword is used to indicate that a GiST index be created for the School {{{PointField}}}s fields.
     151'''Notes''':  The {{{GeoMixin}}} class allows for [GeoDjango#ExtraInstanceMethods extra instance methods].  By default, a GiST index will be created for the School {{{PointField}}}s fields.  This behavior can be turned off by using {{{models.PointField(index=False)}}}.
    152152
    153153== Using syncdb ==
     
    168168SELECT AddGeometryColumn('geo_app_school', 'point', 4326, 'POINT', 2);
    169169CREATE INDEX "geo_app_school_point_id" ON "geo_app_school" USING GIST ( "point" GIST_GEOMETRY_OPS );
    170 SELECT AddGeometryColumn('geo_app_district', 'poly', 4326, 'MULTIPOLYGON', 2);
     170SELECT AddGeometryColumn('geo_app_district', 'poly', 4326, 'POLYGON', 2);
     171CREATE INDEX "geo_app_district_poly_id" ON "geo_app_district" USING GIST ( "poly" GIST_GEOMETRY_OPS );
    171172COMMIT;
    172173$ python manage.py syncdb geo_app
     
    294295class Zip(models.Model, models.GeoMixin):
    295296  code = models.IntegerField()
    296   poly = models.PolygonField(srid=-1, index=True)
     297  poly = models.PolygonField(srid=-1)
    297298
    298299  object = models.GeoManager()
     
    302303   * Sets the SRID (Spatial Reference System Identity) of geometry to the given value.  Defaults to 4326 (WGS84).  ''See'' Open GIS Consortium, Inc., ''[http://www.opengis.org/docs/99-049.pdf OpenGIS Simple Feature Specification For SQL]'', Document 99-049 (May 5, 1999), at  Ch. 2.3.8 (Geometry Values and Spatial Reference Systems, pg. 39).
    303304 * {{{index}}}
    304    * If set to True, will create a GiST index for the given geometry.  Update the index with the PostgreSQL command {{{VACUUM ANALYZE}}} (may take a while to execute depending on how large your geographic-enabled tables are).
     305   * Defaults to True.  Creates a GiST index for the given geometry.  Update the index with the PostgreSQL command {{{VACUUM ANALYZE}}} (may take a while to execute depending on how large your geographic-enabled tables are).
    305306
    306307== Creating and Saving Models with Geometry Fields ==
     
    358359   * Returns true if A's bounding box is strictly above B's bounding box.
    359360   * PostGIS equivalent "{{{|>>}}}"
    360  * {{{same_as}}}
     361 * {{{same_as}}} or {{{exact}}}
    361362   * The "same as" operator. It tests actual geometric equality of two features. So if A and B are the same feature, vertex-by-vertex, the operator returns true.
    362363   * PostGIS equivalent "{{{~=}}}"
Back to Top