Package gov.usgs.earthquake.geoserve
Class GeoserveLayersService
java.lang.Object
gov.usgs.earthquake.geoserve.GeoserveLayersService
Access layers from the Geoserve Layers service.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate a service using the default URL.GeoserveLayersService(String endpointUrl) Create a service using a custom URL. -
Method Summary
Modifier and TypeMethodDescriptionGet the endpoint URL.javax.json.JsonObjectFetch and parse a JSON response from the Geoserve layers service.voidsetEndpointURL(String url) Set the endpoint URL.
-
Field Details
-
DEFAULT_GEOSERVE_LAYERS_URL
Default URL for GeoServe Layers service.- See Also:
-
-
Constructor Details
-
GeoserveLayersService
public GeoserveLayersService()Create a service using the default URL. -
GeoserveLayersService
Create a service using a custom URL.- Parameters:
endpointUrl- layers service URL. Should contain the string{type}, which is replaced during the #getLayer(String).
-
-
Method Details
-
getEndpointURL
Get the endpoint URL.- Returns:
- endpoint URL
-
setEndpointURL
Set the endpoint URL.- Parameters:
url- endpoint URL to set
-
getLayer
Fetch and parse a JSON response from the Geoserve layers service.- Parameters:
type- type of response to fetch- Returns:
- JSONObject response
- Throws:
IOException- on IO errorMalformedURLException- Error on URL failure
-