I am new to GeoServer and using version 2.9.2.

I have a store based on a shapefile with multiple multipolygon features. And I want to create multiple layer based on CQL attribute query from that single store.

I try to add new layer and choose that store, but all I found is "Publish again" and "Create new feature type" link. I try the "Create..." link but it gives me error and I can't find any documentation about it.

Is it possible?


If you follow Publish again it will allow you to create a second (or more) layer from the same store. Just take care to change the name of the layer so that there is no name clash.

I suspect that you could also achieve the same effect using a single layer and filters in you SLD files.

| improve this answer | |
  • I think this is a good idea, @iant, as i don't think you can do SQL views on a SHP layer? – Alex Leith Nov 23 '16 at 9:07
  • 1
    SQL views requires a SQL back-end. – simogeo Nov 23 '16 at 10:48

You can do it using SQL Views: http://docs.geoserver.org/latest/en/user/data/database/sqlview.html

I don't think you can do this on SHP files. I tried using my GeoServer, version 2.10 and it's not possible.

Perhaps you'd like to try using a spatial database? GeoPackage might be fun to try: http://docs.geoserver.org/latest/en/user/community/geopkg/. Of course, PostGIS is best, but it does require infrastructure...

| improve this answer | |
  • Thank you Alex for your suggestions, I'll try your first suggestion. – JerryQM Nov 23 '16 at 7:20

Not the answer you're looking for? Browse other questions tagged or ask your own question.