Class GeoserveLayersService

java.lang.Object
gov.usgs.earthquake.geoserve.GeoserveLayersService

public class GeoserveLayersService extends Object
Access layers from the Geoserve Layers service.
  • Field Details

    • DEFAULT_GEOSERVE_LAYERS_URL

      public static final String 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

      public GeoserveLayersService(String endpointUrl)
      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

      public String getEndpointURL()
      Get the endpoint URL.
      Returns:
      endpoint URL
    • setEndpointURL

      public void setEndpointURL(String url)
      Set the endpoint URL.
      Parameters:
      url - endpoint URL to set
    • getLayer

      public javax.json.JsonObject getLayer(String type) throws IOException, MalformedURLException
      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 error
      MalformedURLException - Error on URL failure