Django

Code

Show
Ignore:
Timestamp:
06/15/08 14:48:57 (7 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/query.py

    r7483 r7641  
    1616 
    1717# The GML, distance, transform, and union procedures. 
     18AREA = 'SDO_GEOM.SDO_AREA' 
    1819ASGML = 'SDO_UTIL.TO_GMLGEOMETRY' 
     20CENTROID = 'SDO_GEOM.SDO_CENTROID' 
     21DIFFERENCE = 'SDO_GEOM.SDO_DIFFERENCE' 
    1922DISTANCE = 'SDO_GEOM.SDO_DISTANCE' 
     23EXTENT = 'SDO_AGGR_MBR' 
     24INTERSECTION = 'SDO_GEOM.SDO_INTERSECTION' 
     25LENGTH = 'SDO_GEOM.SDO_LENGTH' 
     26NUM_GEOM = 'SDO_UTIL.GETNUMELEM' 
     27NUM_POINTS = 'SDO_UTIL.GETNUMVERTICES' 
     28POINT_ON_SURFACE = 'SDO_GEOM.SDO_POINTONSURFACE' 
     29SYM_DIFFERENCE = 'SDO_GEOM.SDO_XOR' 
    2030TRANSFORM = 'SDO_CS.TRANSFORM' 
    21 UNION = 'SDO_AGGR_UNION' 
     31UNION = 'SDO_GEOM.SDO_UNION' 
     32UNIONAGG = 'SDO_AGGR_UNION' 
    2233 
    2334# We want to get SDO Geometries as WKT because it is much easier to