[GIS] How import a shapefile on-the-fly and have GeoServer render it instantly

geoserveropenlayers-2shapefile

I am tasked with adding one feature to an existing app. It was built with OpenLayers and GeoServer. The task is to import a shapefile on-the-fly and have GeoServer render it instantly. However, I can't find any doc or tutorial.

Since a user can import any shapefile, the geometry type or the data structure can't be determined ahead of time.

Thanks,
Fred

Best Answer

There is nothing already done, but using REST config you can do the upload, it should auto-configure itself (watch out for missing or invalid .prj files though) and then you can use it like a normal WMS layer, previewing it where you prefer.

http://docs.geoserver.org/latest/en/user/restconfig/rest-config-api.html