Class GeoServiceHelper

java.lang.Object
org.tailormap.api.persistence.helper.GeoServiceHelper
All Implemented Interfaces:
CapabilitiesLoadingProgressReporting

@Service public class GeoServiceHelper extends Object implements CapabilitiesLoadingProgressReporting
  • Constructor Details

    • GeoServiceHelper

      public GeoServiceHelper(TailormapConfig tailormapConfig, ch.rasc.sse.eventbus.SseEventBus eventBus, tools.jackson.databind.json.JsonMapper mapper)
  • Method Details

    • guessServerTypeFromUrl

      public static Service.ServerTypeEnum guessServerTypeFromUrl(String url)
    • getWmsRequest

      public static String getWmsRequest(String uri)
    • getWmsRequest

      public static String getWmsRequest(URI uri)
      Extracts the value of the WMS "REQUEST" parameter (case-insensitive) from the given URI.
      Parameters:
      uri - the URI to extract the request parameter from
      Returns:
      the value of the request parameter, or null if not found
    • loadServiceCapabilities

      public GeoService loadServiceCapabilities(GeoService geoService) throws IOException, IllegalArgumentException, URISyntaxException, org.geotools.ows.ServiceException, UnsupportedOperationException
      Throws:
      IOException
      IllegalArgumentException
      URISyntaxException
      org.geotools.ows.ServiceException
      UnsupportedOperationException
    • getLayerLegendUrlFromStyles

      public static URI getLayerLegendUrlFromStyles(GeoService service, GeoServiceLayer serviceLayer)
      Try to extract the legend url from the styles of the layer. This works by getting all styles for the layer and then removing any styles attached to other (parent) layers from the list of all styles. What remains is/are the legend url(s) for the layer. NOTE: when a layer has more than one -not an inherited style- style the first style is used.
      Parameters:
      service - the service that has the layer
      serviceLayer - the layer to get the legend url for
      Returns:
      a URI to the legend image or null if not found
    • reportCapabilitiesLoadingProgress

      public void reportCapabilitiesLoadingProgress(CapabilitiesLoadingEvent event)
      Description copied from interface: CapabilitiesLoadingProgressReporting
      Emit a capabilities loading progress event to the event bus. An implementing class could use this method to report progress of loading capabilities from a feature source on a SSE event bus or a logging framework.
      Specified by:
      reportCapabilitiesLoadingProgress in interface CapabilitiesLoadingProgressReporting
      Parameters:
      event - The capabilities loading event to report