[GIS] Options for displaying PostGIS vectors in OpenLayers

openlayerspostgissoftware-recommendationsweb-mapping

I am very new to web-mapping, so this question may be a little misguided.

I want to have a very simple web interface using OpenLayers (or even Google Maps if that will be easier) which can display a number of point and polygon tables that are currently in PostGIS.

I want this to be as simple (and as low maintainence) as possible:

  • I don't want to have to create tiles (unless there is a very good reason), or have a massive, complex layer of middleware.
  • Performance doesn't need to be phenomenal, as this is for internal use and thus doesn't need to scale beyond a couple of concurrent users.
  • Styling of the vector layers is of minimal importance.
  • Open source tools are much preferred as I have almost no budget for this.

What is the recommended approach for this?

Best Answer

The easiest way to set up an online map from PostGIS sources is using Geoserver. The Geoserver User Manual contains a good introduction for using PostGIS as a data source. You basically add a data store containing the connection information and after that you can publish any table containing geometries. Besides PostGIS, you can use many other data sources as well:

alt text

From inside Geoserver's web interface, you can also preview the layers on an OpenLayers web page. You can use the source of this preview page to build your own OpenLayers application.

Geoserver offers many styling options for both vector and raster data. For the start, you might be happy enough with just customizing some of the pre-made styles that come with the installation.

By default, Geoserver doesn't tile and OpenLayers doesn't request tiles. If you don't need high-performance, you don't need to bother with tiles anyway.

Personally, I think that OpenLayers is easier to use than Google Maps API and you'll be independent from Google. If you need a background map, you might want to look into OpenStreetMap instead.