What is the best way to work with PostGIS and OpenLayers?

I have a postgresql db table with a City table, in which there is a geography field with city coordinates.

I made a php page that looks at these records, converts the geo-field to latit / longit and draws a marker on the OpenLayers map in the city during an ajax call.

I don’t know if this is the right thing to do: is there a way to directly bind the SQL query to the map without the need to quote? Is there a more direct link between the database and OpenLayers maps?

+5
source share
1 answer

I'm not sure what the software stack you are using is, but usually OpenLayers do not work directly with PostGIS.

- PostGIS β†’ GeoServer β†’ OpenLayers

GeoServer ( ) openlayers, wms.

https://gis.stackexchange.com/

+9

All Articles