Geotagged Image KML Address GPXShapefiles KML Styles Maps Views GeoJSON Lat / Lon HTML5Draw on Map Layers Behaviors TileStache
Bounding BoxTopBottomLeftRight GeoPHP is used to Centroid calculate the Lat Bounding Box and Lon Centroid from the Geometry.GeometryStored in WKT Format Geometry Types:Soon will be WKB • PointWKT Example: • LineStringPOLYGON ((30 10, 10 20, • Polygon20 40, 40 40, 30 10)) • MultiPoint Query-able and indexable • MultiLineString • MultiPolygon Not Query-able. SELECTs only. • GeometryCollection
• User enters an address • KML (Google Earth) • Address is stored • GPX (Hand-held GPS) independently • Geo-tagged Image • Does not store lat / lon (smart-phone) Handlers call service Handlers parse • Google uploaded file into a • Yahoo geoPHP geometry • Yandex object • MapQuest Lat / LonDirect user input HTML5Is also supported Draw on Map More!
ESRI Shapefiles can imported intogeofields using OSGeo’s GDAL ogr2ogrlibraryRequires download and install of ogr2ogr
OpenLayers and Views Repeat after me“I need to create two views. One view holdthe layer. The other view holds the map.”
GeoJSON View (views_geojson module) GeoJSON Layer1. Create a page view2. Add geofield field to field list /feeds/layer.json3. Set format to GeoJSON feed Layer should automatically and select geofield appear in your layers list Exposed & Contextual Filters OpenLayers Map View1. Create a page, block or pane OpenLayers Map view2. Set format to OpenLayers Map 1. Add layer to map and3. Optional: set-up exposed configure map as desired filters identically to first view 2. Click “Preview” to make sure4. Profit! your map is working
GeometryStored in WKB Format Query-able and indexable-- Find all pubs located within 250 meters of a hospital.SELECT h.name, p.name FROM bc_hospitals h, bc_pubs p WHERE ST_DWithin(h.geom, p.geom, 250);-- What is the largest municipality in British Columbia, by area?SELECT name, ST_Area(geom) as areaFROM bc_municipality order by area limit 1;-- What is the total length of all roads in BC, in kilometers?SELECT sum(ST_Length(geom))/1000 as km_roads from bc_roads;
PostGIS can be used as a spatial-query service in the same way that solr is used as asearch-query service. This example show us associating “Location” nodes with “Region”nodes using Geofield, node-references, and SyncPostGIS. Sync PostGIS Entity-save or cron GeoField (Polygon) Spatial Query on entity-save SELECT id from postgis where bundle = ‘region’ AND Entity Type ST_WITHIN($point, geom) Entity ID GeoField (Point) Entity Bundle Node-Reference Field Name Node ID of region Field Delta