I am using OpenLayers and Geoserver in a web map application in which I'd like to implement editable layers by drawing features on it.

I followed this tutorial to save the created features with WFS-T and OpenLayers.Strategy.Save(), but since Shapefiles only deal with one geometry type at a time, I can't draw, for example, a polygon AND a line on the same layer.

Note: I can't use different layers for different geometry types, it has to be on a single layer due to a tool I am using: OLE ("OpenLayers Editor").

So my question is : is there any way to store multiple geometry types in a single layer with Geoserver/PostGIS ?

  • To start with you must create a PostGIS table that accepts all kind of geometries with create table foo (fid serial NOT NULL,attr text); and SELECT AddGeometryColumn('foo', 'geom', 4326, 'GEOMETRY', 2 ); Publish that with GeoServer and you may be able to save points, lines, and polygons with WFS-T.
    – user30184
    Apr 27, 2016 at 12:13


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.