I tried publishing an existing PostGis table with geometry column named "wkb_geometry" to Geoserver using its REST API. I used the following command:
curl -v -u admin:geoserver -X POST -H "Content-type: text/xml" -d "<featureType><name>boundary</name></featureType>" http://mygeoserver:8080/geoserver/rest/workspaces/myworkspace/datastores/mypostgis/featuretypes
however, the server returned:
> <featureType><name>adminbnd_prov_xxx</name></featureType>HTTP/1.1 500 Internal Server Error < Content-Type: text/plain < Transfer-Encoding: chunked < Server: Jetty(6.1.8) :java.io.IOException: Error occured calculating bounds* Connection #0 to host mygeoserver left intact * Closing connection #0
One thing I found out is that if I renamed my geometry column from "wkb_geometry" to "geom" and execute again the command, the PostGis table is published successfully.
Using Geoserver's web interface, this is a not an issue. You can publish PostGis tables regardless of its geometry column name.
Is this the default behaviour for the REST api? Is there any workaround on this? What does "error occured calculating bounds" has to do with it?
Thanks a lot!