I am hoping someone can help me on this one as i have been trying to find the solution for a long time without success.
I have a polygon shape-file which i am displaying on browser using geoserver . I have color-coded the polygons (by creating an SLD file) based on the values of one of the attributes(say "count") in the shape-file.
My problem is that i want to update the "count" attribute (which is an integer) regularly(on a daily basis) and hence i want to reflect this change in the geoserver. I am getting the values for "count" attribute through a java service which i have up and running . But so far , i have not been able to find out a way through which i can update a single attribute(for all features) in a shape-file through java . The geoTools library helps me to read a shape-file but i could not find a way to modify an attribute using this library .
How do i go about this?Please help me with the following questions:
Geoserver is commonly used with shapefiles when the underlying data does not change. If not is common to use postgis
I think that the best option is create a new user for you backed process and add a security rule that allows wfs.Transaction only for that user. You can use basic http authentication in your backed process to launch a POST http request that update the shapefile.
geojson directly show in the browser (without geoserver) -> shapefile + geoserver -> postgis + geoserver
I can't provide a full example right now to update a shapefile with geotools but check2 this links.