Class GeoServiceHelper
java.lang.Object
org.tailormap.api.persistence.helper.GeoServiceHelper
- All Implemented Interfaces:
CapabilitiesLoadingProgressReporting
@Service
public class GeoServiceHelper
extends Object
implements CapabilitiesLoadingProgressReporting
-
Constructor Summary
ConstructorsConstructorDescriptionGeoServiceHelper(TailormapConfig tailormapConfig, ch.rasc.sse.eventbus.SseEventBus eventBus, tools.jackson.databind.json.JsonMapper mapper) -
Method Summary
Modifier and TypeMethodDescriptionstatic URIgetLayerLegendUrlFromStyles(GeoService service, GeoServiceLayer serviceLayer) Try to extract the legend url from the styles of the layer.static StringgetWmsRequest(String uri) static StringgetWmsRequest(URI uri) Extracts the value of the WMS "REQUEST" parameter (case-insensitive) from the given URI.static Service.ServerTypeEnumloadServiceCapabilities(GeoService geoService) voidEmit a capabilities loading progress event to the event bus.
-
Constructor Details
-
GeoServiceHelper
public GeoServiceHelper(TailormapConfig tailormapConfig, ch.rasc.sse.eventbus.SseEventBus eventBus, tools.jackson.databind.json.JsonMapper mapper)
-
-
Method Details
-
guessServerTypeFromUrl
-
getWmsRequest
-
getWmsRequest
-
loadServiceCapabilities
public GeoService loadServiceCapabilities(GeoService geoService) throws IOException, IllegalArgumentException, URISyntaxException, org.geotools.ows.ServiceException, UnsupportedOperationException - Throws:
IOExceptionIllegalArgumentExceptionURISyntaxExceptionorg.geotools.ows.ServiceExceptionUnsupportedOperationException
-
getLayerLegendUrlFromStyles
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 layerserviceLayer- the layer to get the legend url for- Returns:
- a URI to the legend image or null if not found
-
reportCapabilitiesLoadingProgress
Description copied from interface:CapabilitiesLoadingProgressReportingEmit 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:
reportCapabilitiesLoadingProgressin interfaceCapabilitiesLoadingProgressReporting- Parameters:
event- The capabilities loading event to report
-