Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recalculate Feature Type Bounding Boxes #199

Open
cschroedl-gov opened this issue Sep 12, 2016 · 3 comments
Open

Recalculate Feature Type Bounding Boxes #199

cschroedl-gov opened this issue Sep 12, 2016 · 3 comments

Comments

@cschroedl-gov
Copy link

cschroedl-gov commented Sep 12, 2016

This issue addresses a post in Google Groups:
https://groups.google.com/d/msg/geoserver-manager-devs/xmUQ9VgI8_8/ju7k7cATty0J

According to @marcjansen:

there is currently no way of issuing a RESTful request
through geoserver-managers
(https://github.com/geosolutions-it/geoserver-manager) public methods to
recalculate a FeatureTypes native and projected BBOX

Geoserver offers the interface (see e.g.
http://docs.geoserver.org/stable/en/user/rest/api/featuretypes.html#recalculate)
and it is working as expected through a curl call like e.g.

     curl -i -H 'Content-type: text/xml' \ 
         -d 
'<featureType><name>myfeaturetype</name><enabled>true</enabled></featureType>'\ 
         -X PUT \ 
http://user:passwd@url/to/geoserver/rest/workspaces/<ws>/datastores/<ds>featuretypes/myfeaturetype.xml?recalculate=nativebbox

enhance the GeoServerRESTPublisher to have
such method. with ... sth. that looks like below:

public boolean recalculateFeatureTypeBBox(RESTFeatureType ft, 
BboxRecalculationMode calculationMode) { 
   // implementation 
} 

where BboxRecalculationMode is a public enum of the allowed modes

According to @ccancellieri:

Put the Enum as public enum into the GeoServerRESTPublisher (to keep things aligned with others enums) and call the method:

private recalculateBBox(StoreType type, String workspace, String storeName, String layerName, BboxRecalculationMode calculationMode){
 // take a look here to see an example of how to build the URL
// https://github.com/geosolutions-it/geoserver-manager/blob/master/src/main/java/it/geosolutions/geoserver/rest/GeoServerRESTPublisher.java#L2059
}

Then add also public wrappers:

public recalculateFeatureTypeBBox(String workspace, String storeName, String layerName, BboxRecalculationMode calculationMode){
 return  recalculateBBox(StoreType.DATASTORES, workspace, storeName, layerName, calculationMode);
}

public recalculateCoverageBBox(String workspace, String storeName, String layerName, BboxRecalculationMode calculationMode){
// this is not very well documented but should work in the same way of the featureType:
// example
// http://localhost:8081/geoserver/rest/workspaces/WORKSPACE/coveragestores/STORENAME/coverages/LAYERNAME.xml
//  so simply call the 
 return  recalculateBBox(StoreType.COVERAGESTORES, workspace, storeName, layerName, calculationMode);
}
@cschroedl-gov
Copy link
Author

Which branch should I branch off of? master? 1.7.x?

@cschroedl-gov
Copy link
Author

@ccancellieri could you recommend a place to test such a method?

@cschroedl-gov
Copy link
Author

What versions of GeoServer do you recommend testing against? I tried running the integration tests against a local install of 2.8.5 war running in tomcat with the following env vars:

gsmgr_resttest=true
gsmgr_resturl=http://localhost:8080/geoserver/

All the setup method calls in GeoserverRESTTest failed on line 145 with "GeoServer version (-1) does not match the desired one (2.8)" When I hit http://localhost:8080/geoserver/rest/about/version.xml directly with a browser I get the following response:

<about/>

When I step through a test I see the setup code trying to parse a version out of the same empty about element.

cschroedl-gov added a commit to cschroedl-gov/geoserver-manager that referenced this issue Sep 12, 2016
cschroedl-gov added a commit to cschroedl-gov/geoserver-manager that referenced this issue Sep 13, 2016
cschroedl-gov added a commit to cschroedl-gov/geoserver-manager that referenced this issue Sep 20, 2016
cschroedl-gov added a commit to cschroedl-gov/geoserver-manager that referenced this issue Sep 20, 2016
cschroedl-gov added a commit to cschroedl-gov/geoserver-manager that referenced this issue Sep 20, 2016
cschroedl-gov added a commit to cschroedl-gov/geoserver-manager that referenced this issue Sep 20, 2016
cschroedl-gov added a commit to cschroedl-gov/geoserver-manager that referenced this issue Sep 22, 2016
cschroedl-gov added a commit to cschroedl-gov/geoserver-manager that referenced this issue Sep 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant