Changes between Version 12 and Version 13 of BluePrintGISStorage


Ignore:
Timestamp:
06/20/11 18:39:18 (10 years ago)
Author:
Fran Boon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BluePrintGISStorage

    v12 v13  
    3939
    4040Q: copy [http://docs.djangoproject.com/en/dev/ref/contrib/gis/db-api/ GeoDjango]?
     41
     42== Extend DAL to support Spatial Queries ==
     43We need to support some extra SQL queries in DAL.
     44
     45I guess we have a PostGIS Adapter which inherits from the PostgreSQL one & a Spatialite adapter which inherits from the Sqlite one.
     46
     47Both should inherit the OpenGIS set of SQL syntax
     48
     49
     50We need to be able to do spatial queries like this:
     51* http://postgis.refractions.net/docs/ST_Overlaps.html
     52This one is our key performance bottleneck currently as we do BBOX filters on GeoJSON feature layers like this:
     53* http://bazaar.launchpad.net/~flavour/sahana-eden/trunk/view/head:/modules/s3/s3rest.py#L1773
     54Instead of this query:
     55{{{
     56bbox_filter = ((db.location.lon > minLon) & (db.location.lon < maxLon) & (db.location.lat > minLat) & (db.location.lat < maxLat))
     57}}}
     58We want to:
     59{{{
     60bbox_filter = (db.location.ST_Overlaps([minLon, minLat, maxLon, maxLat]))
     61}}}
     62
     63Full list of possible commands are here, but I don't expect all these to be implemented immediately (we can add additional ones as/when we need them if the hooks are right):
     64* http://postgis.refractions.net/documentation/manual-1.3/ch06.html#id2574404
     65
     66
     67We could also want to be able to specify that a table is spatialised, so an option to db.define_table(spatial=True).
     68If this is on then we should send AddGeometryColumn() to the SQL Adapter
     69
     70NB A normal system would commonly only have a single spatial table, so this could be easily done out of band using a script, as I do now:
     71* wiki:InstallationGuidelinesPostgreSQL#AddGeometrycolumntogis_location
     72
     73
     74There are also some new field types, but I don't think we need to worry about those right now.
     75
     76Full specs are here:
     77* http://www.opengeospatial.org/standards/sfs
     78
    4179----
    4280[wiki:BluePrintGeographicInformationSystems GIS BluePrints]