Changes between Version 12 and Version 13 of BluePrintGISStorage

06/20/11 18:39:18 (10 years ago)
Fran Boon



  • BluePrintGISStorage

    v12 v13  
    4040Q: copy [ GeoDjango]?
     42== Extend DAL to support Spatial Queries ==
     43We need to support some extra SQL queries in DAL.
     45I guess we have a PostGIS Adapter which inherits from the PostgreSQL one & a Spatialite adapter which inherits from the Sqlite one.
     47Both should inherit the OpenGIS set of SQL syntax
     50We need to be able to do spatial queries like this:
     52This one is our key performance bottleneck currently as we do BBOX filters on GeoJSON feature layers like this:
     54Instead of this query:
     56bbox_filter = ((db.location.lon > minLon) & (db.location.lon < maxLon) & ( > minLat) & ( < maxLat))
     58We want to:
     60bbox_filter = (db.location.ST_Overlaps([minLon, minLat, maxLon, maxLat]))
     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):
     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
     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
     74There are also some new field types, but I don't think we need to worry about those right now.
     76Full specs are here:
    4280[wiki:BluePrintGeographicInformationSystems GIS BluePrints]