4

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?

closed as unclear what you're asking by Mapperz Nov 23 '16 at 18:23

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

5

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.

  • 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
1

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...

  • 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.