2009-03-31 01:15:49 +08:00
|
|
|
__all__ = ['create_test_spatial_db', 'get_geo_where_clause', 'SpatialBackend']
|
2008-08-06 02:13:06 +08:00
|
|
|
|
|
|
|
from django.contrib.gis.db.backend.base import BaseSpatialBackend
|
|
|
|
from django.contrib.gis.db.backend.postgis.adaptor import PostGISAdaptor
|
2009-03-31 01:15:49 +08:00
|
|
|
from django.contrib.gis.db.backend.postgis.creation import create_test_spatial_db
|
2008-08-06 02:13:06 +08:00
|
|
|
from django.contrib.gis.db.backend.postgis.field import PostGISField
|
2009-03-31 01:15:49 +08:00
|
|
|
from django.contrib.gis.db.backend.postgis.models import GeometryColumns, SpatialRefSys
|
2008-08-06 02:13:06 +08:00
|
|
|
from django.contrib.gis.db.backend.postgis.query import *
|
|
|
|
|
|
|
|
SpatialBackend = BaseSpatialBackend(name='postgis', postgis=True,
|
|
|
|
area=AREA,
|
|
|
|
centroid=CENTROID,
|
2009-03-31 01:15:49 +08:00
|
|
|
collect=COLLECT,
|
2008-08-06 02:13:06 +08:00
|
|
|
difference=DIFFERENCE,
|
|
|
|
distance=DISTANCE,
|
|
|
|
distance_functions=DISTANCE_FUNCTIONS,
|
|
|
|
distance_sphere=DISTANCE_SPHERE,
|
|
|
|
distance_spheroid=DISTANCE_SPHEROID,
|
|
|
|
envelope=ENVELOPE,
|
|
|
|
extent=EXTENT,
|
|
|
|
gis_terms=POSTGIS_TERMS,
|
2009-04-03 00:50:44 +08:00
|
|
|
geojson=ASGEOJSON,
|
2008-08-06 02:13:06 +08:00
|
|
|
gml=ASGML,
|
|
|
|
intersection=INTERSECTION,
|
|
|
|
kml=ASKML,
|
|
|
|
length=LENGTH,
|
|
|
|
length_spheroid=LENGTH_SPHEROID,
|
|
|
|
make_line=MAKE_LINE,
|
|
|
|
mem_size=MEM_SIZE,
|
|
|
|
num_geom=NUM_GEOM,
|
|
|
|
num_points=NUM_POINTS,
|
|
|
|
perimeter=PERIMETER,
|
|
|
|
point_on_surface=POINT_ON_SURFACE,
|
|
|
|
scale=SCALE,
|
|
|
|
select=GEOM_SELECT,
|
2009-04-03 00:50:44 +08:00
|
|
|
snap_to_grid=SNAP_TO_GRID,
|
2008-08-06 02:13:06 +08:00
|
|
|
svg=ASSVG,
|
|
|
|
sym_difference=SYM_DIFFERENCE,
|
|
|
|
transform=TRANSFORM,
|
|
|
|
translate=TRANSLATE,
|
|
|
|
union=UNION,
|
|
|
|
unionagg=UNIONAGG,
|
|
|
|
version=(MAJOR_VERSION, MINOR_VERSION1, MINOR_VERSION2),
|
|
|
|
Adaptor=PostGISAdaptor,
|
|
|
|
Field=PostGISField,
|
2009-03-31 01:15:49 +08:00
|
|
|
GeometryColumns=GeometryColumns,
|
|
|
|
SpatialRefSys=SpatialRefSys,
|
2008-08-06 02:13:06 +08:00
|
|
|
)
|