Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am stevenhorner on github.
* I am shorner (https://keybase.io/shorner) on keybase.
* I have a public key ASDWWl-ArR_5MKBPivlnCUsauTKZtIokMCKp2HpTzWS81go
To claim this, I am signing this object:
<?php
/**
* PostGIS to GeoJSON
* Query a PostGIS table or view and return the results in GeoJSON format, suitable for use in OpenLayers, Leaflet, etc.
*
* @param string $geotable The PostGIS layer name *REQUIRED*
* @param string $geomfield The PostGIS geometry field *REQUIRED*
* @param string $srid The SRID of the returned GeoJSON *OPTIONAL (If omitted, EPSG: 4326 will be used)*
* @param string $fields Fields to be returned *OPTIONAL (If omitted, all fields will be returned)* NOTE- Uppercase field names should be wrapped in double quotes
* @param string $parameters SQL WHERE clause parameters *OPTIONAL*