Django

Code

Show
Ignore:
Timestamp:
06/15/08 14:48:57 (3 months ago)
Author:
jbronn
Message:

gis: Refactor of the GeoQuerySet; new features include:

(1) Creation of internal API that eases generation of GeoQuerySet methods.
(2) GeoQuerySet.distance now returns Distance objects instead of floats.
(3) Added the new GeoQuerySet methods: area, centroid, difference, envelope, intersection, length, make_line, mem_size, num_geom, num_points, perimeter, point_on_surface, scale, svg, sym_difference, translate, union.
(4) The model_att keyword may be used to customize the attribute that GeoQuerySet methods attach output to.
(5) Geographic distance lookups and GeoQuerySet.distance calls now use ST_distance_sphere by default (performance benefits far outweigh small loss in accuracy); ST_distance_spheroid may still be used by specifying an option.
(6) GeoQuerySet methods may now operate accross ForeignKey? relations specified via the field_name keyword (but this does not work on Oracle).
(7) Area now has the same units of measure as Distance.

Backward Incompatibilites:

  • The aggregate union method is now known as unionagg.
  • The field_name keyword used for GeoQuerySet methods may no longer be specified via positional arguments.
  • Distance objects returned instead of floats from GeoQuerySet.distance.
  • ST_Distance_sphere used by default for geographic distance calculations.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/gis/django/contrib/gis/db/backend/oracle/__init__.py

    r7104 r7641  
     1__all__ = ['create_spatial_db', 'get_geo_where_clause', 'SpatialBackend'] 
     2 
     3from django.contrib.gis.db.backend.base import BaseSpatialBackend 
     4from django.contrib.gis.db.backend.oracle.adaptor import OracleSpatialAdaptor 
     5from django.contrib.gis.db.backend.oracle.creation import create_spatial_db 
     6from django.contrib.gis.db.backend.oracle.field import OracleSpatialField 
     7from django.contrib.gis.db.backend.oracle.query import * 
     8 
     9SpatialBackend = BaseSpatialBackend(name='oracle', oracle=True, 
     10                                    area=AREA, 
     11                                    centroid=CENTROID, 
     12                                    difference=DIFFERENCE, 
     13                                    distance=DISTANCE, 
     14                                    distance_functions=DISTANCE_FUNCTIONS, 
     15                                    gis_terms=ORACLE_SPATIAL_TERMS, 
     16                                    gml=ASGML, 
     17                                    intersection=INTERSECTION, 
     18                                    length=LENGTH, 
     19                                    limited_where = {'relate' : None}, 
     20                                    num_geom=NUM_GEOM, 
     21                                    num_points=NUM_POINTS, 
     22                                    perimeter=LENGTH, 
     23                                    point_on_surface=POINT_ON_SURFACE, 
     24                                    select=GEOM_SELECT, 
     25                                    sym_difference=SYM_DIFFERENCE, 
     26                                    transform=TRANSFORM, 
     27                                    unionagg=UNIONAGG, 
     28                                    union=UNION, 
     29                                    Adaptor=OracleSpatialAdaptor, 
     30                                    Field=OracleSpatialField, 
     31                                    )