Changes between Version 14 and Version 15 of BluePrintGISStorage


Ignore:
Timestamp:
02/07/12 09:48:18 (10 years ago)
Author:
Fran Boon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BluePrintGISStorage

    v14 v15  
     1= GIS Storage =
    12[[TOC]]
    2 = GIS Storage =
    3 For portability, the default storage for Features is the normal database via Web2Py's [http://mdp.cti.depaul.edu/examples/default/orm DAL].
     3For portability, the default storage for Features is the normal database via Web2Py's [http://web2py.com/books/default/chapter/29/6 DAL].
    44
    55In order to support Lines & Polygons we store as [http://en.wikipedia.org/wiki/Well-known_text WKT]
     
    1010
    1111We can extend DAL for spatial support:
    12  * adding if deployment_settings.gis.spatialdb == True and deployment_settings.database.db_type == "postgres" to routines inside S3GIS' spaital functions to use optimsied routines where possible & falling back to the existing Shapely routines.
     12 * adding if deployment_settings.gis.spatialdb == True and deployment_settings.database.db_type == "postgres" to routines inside S3GIS' spaital functions to use optimised routines where possible & falling back to the existing Shapely routines.
    1313
    1414We could [http://groups.google.com/group/web2py/browse_thread/thread/7551b50ef3ca72a8 bypass DAL completely] & use an ORM like [http://geoalchemy.org/ GeoAlchemy]:
    1515{{{
    16 response.custom_commit=lambda: do_commit()
     16response.custom_commit = lambda: do_commit()
    1717}}}
    1818
     
    4646I guess we have a PostGIS Adapter which inherits from the PostgreSQL one & a Spatialite adapter which inherits from the Sqlite one.
    4747
    48 Both should inherit the OpenGIS set of SQL syntax
    49 
     48Both should inherit the OpenGIS set of SQL syntax:
     49* http://www.opengeospatial.org/standards/sfs
    5050
    5151We need to be able to do spatial queries like this:
    5252* http://postgis.refractions.net/docs/ST_Overlaps.html
     53
    5354This one is our key performance bottleneck currently as we do BBOX filters on GeoJSON feature layers like this:
    54 * http://bazaar.launchpad.net/~flavour/sahana-eden/trunk/view/head:/modules/s3/s3rest.py#L1773
     55* https://github.com/flavour/eden/blob/master/modules/s3/s3rest.py#L4612
    5556Instead of this query:
    5657{{{
    57 bbox_filter = ((db.location.lon > minLon) & (db.location.lon < maxLon) & (db.location.lat > minLat) & (db.location.lat < maxLat))
     58bbox_filter = ((table.lon > minLon) & (table.lon < maxLon) & (table.lat > minLat) & (table.lat < maxLat))
    5859}}}
    5960We want to:
    6061{{{
    61 bbox_filter = (db.location.ST_Overlaps([minLon, minLat, maxLon, maxLat]))
     62bbox_filter = (table.ST_Overlaps([minLon, minLat, maxLon, maxLat]))
    6263}}}
    6364
     
    6667
    6768
    68 We could also want to be able to specify that a table is spatialised, so an option to db.define_table(spatial=True).
     69We also want to be able to specify that a table is spatialised, so an option to db.define_table(spatial=True).
    6970If this is on then we should send AddGeometryColumn() to the SQL Adapter
    7071
     
    7576There are also some new field types, but I don't think we need to worry about those right now.
    7677
    77 Full specs are here:
    78 * http://www.opengeospatial.org/standards/sfs
    79 
    8078----
    8179[wiki:BluePrintGeographicInformationSystems GIS BluePrints]