Changes between Version 14 and Version 15 of BluePrintGISStorage
- Timestamp:
- 02/07/12 09:48:18 (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BluePrintGISStorage
v14 v15 1 = GIS Storage = 1 2 [[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]. 3 For portability, the default storage for Features is the normal database via Web2Py's [http://web2py.com/books/default/chapter/29/6 DAL]. 4 4 5 5 In order to support Lines & Polygons we store as [http://en.wikipedia.org/wiki/Well-known_text WKT] … … 10 10 11 11 We 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 optim sied 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. 13 13 14 14 We could [http://groups.google.com/group/web2py/browse_thread/thread/7551b50ef3ca72a8 bypass DAL completely] & use an ORM like [http://geoalchemy.org/ GeoAlchemy]: 15 15 {{{ 16 response.custom_commit =lambda: do_commit()16 response.custom_commit = lambda: do_commit() 17 17 }}} 18 18 … … 46 46 I guess we have a PostGIS Adapter which inherits from the PostgreSQL one & a Spatialite adapter which inherits from the Sqlite one. 47 47 48 Both should inherit the OpenGIS set of SQL syntax 49 48 Both should inherit the OpenGIS set of SQL syntax: 49 * http://www.opengeospatial.org/standards/sfs 50 50 51 51 We need to be able to do spatial queries like this: 52 52 * http://postgis.refractions.net/docs/ST_Overlaps.html 53 53 54 This 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#L177355 * https://github.com/flavour/eden/blob/master/modules/s3/s3rest.py#L4612 55 56 Instead of this query: 56 57 {{{ 57 bbox_filter = (( db.location.lon > minLon) & (db.location.lon < maxLon) & (db.location.lat > minLat) & (db.location.lat < maxLat))58 bbox_filter = ((table.lon > minLon) & (table.lon < maxLon) & (table.lat > minLat) & (table.lat < maxLat)) 58 59 }}} 59 60 We want to: 60 61 {{{ 61 bbox_filter = ( db.location.ST_Overlaps([minLon, minLat, maxLon, maxLat]))62 bbox_filter = (table.ST_Overlaps([minLon, minLat, maxLon, maxLat])) 62 63 }}} 63 64 … … 66 67 67 68 68 We couldalso want to be able to specify that a table is spatialised, so an option to db.define_table(spatial=True).69 We also want to be able to specify that a table is spatialised, so an option to db.define_table(spatial=True). 69 70 If this is on then we should send AddGeometryColumn() to the SQL Adapter 70 71 … … 75 76 There are also some new field types, but I don't think we need to worry about those right now. 76 77 77 Full specs are here:78 * http://www.opengeospatial.org/standards/sfs79 80 78 ---- 81 79 [wiki:BluePrintGeographicInformationSystems GIS BluePrints]