public class WMSMapProvider extends java.lang.Object implements MapProvider, ProviderContextAware, DynamicProjectionable
WMS service provider.
WMSMapProvider is the type of service provider for accessing WMS service-related functions. Different versions of WMS services have different instantiated WMSMapProvider objects.
WMSMapProvider obtains functions provided by the WMS service through calling methods getCapabilities, getMap, and getFeatureInfo of WMSClient (e.g., WMSClient
).
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
URL_CHARSET
The url charset.
|
Constructor and Description |
---|
WMSMapProvider()
The default constructor.
|
WMSMapProvider(java.lang.String url, java.lang.String version, java.lang.String userName, java.lang.String password)
${services_components_spi_ogc_WMSMapProvider_contructor_WMSMapProvider_Title}
|
WMSMapProvider(java.lang.String url, java.lang.String version, java.lang.String userName, java.lang.String password, boolean cacheEnabled, java.lang.String outputPath, java.lang.String outputSite)
Constructs a WMSMapProvider object according to the URL, version, user name, password and cache related settings of the WMS services.
|
Modifier and Type | Method and Description |
---|---|
void |
clearCache(java.lang.String mapName, Rectangle2D bounds)
Clears the cached tiles within the specified bounds.
|
QueryResult |
findNearest(java.lang.String mapName, Geometry geometry, double maxDistance, QueryParameterSet queryParameterSet)
WMS standard does not support this method.
|
MapParameter |
getDefaultMapParameter(java.lang.String mapName)
${services_components_spi_ogc_WMSMapProvider_method_getDefaultMapParameter_Title}
|
java.util.List<PrjCoordSys> |
getDynamicPrjCoordsyses(java.lang.String mapName)
Map supported dynamic projection lists.
|
MapImage |
getMapImage(MapParameter pMapParameter, ImageOutputOption outputOption)
${services_components_spi_ogc_WMSMapProvider_method_getMapImage_Title}
|
MapParameter |
getMapParameter(java.lang.String mapName)
Gets the map parameters of the specified map.
|
java.util.List<java.lang.String> |
getNames()
Gets all the map names corresponding to the current service provider.
|
Overview |
getOverview(MapParameter mapParameter, ImageOutputOption outputOption)
WMSMapProvider currently does not support this method.
|
java.lang.String |
getResource(java.lang.String mapName, ResourceParameter resourceParameter)
WMS standard does not support this method.
|
byte[] |
getResource(java.lang.String mapName, ResourceParameter resourceParameter, Point2D[] points)
Gets the resource image of a specified map according to a resource image parameter.
|
VectorStyle |
getVectorStyle(java.lang.String mapName, java.lang.String[] layerNames, VectorStyleType type)
Gets the specified vector layer style in the specified map.
|
MeasureResult |
measureArea(java.lang.String mapName, Point2D[] points, MeasureParameter measureParam)
WMS standard does not support this method.
|
MeasureResult |
measureDistance(java.lang.String mapName, Point2D[] points, MeasureParameter measureParam)
WMS standard does not support this method.
|
QueryResult |
queryByBounds(java.lang.String mapName, Rectangle2D bounds, QueryParameterSet queryParameterSet)
Queries the geometries within a specified range on the map.
|
QueryResult |
queryByDistance(java.lang.String mapName, Geometry geometry, double distance, QueryParameterSet queryParameterSet)
WMS standard does not support this method.
|
QueryResult |
queryByGeometry(java.lang.String mapName, Geometry geometry, SpatialQueryMode spatialQueryMode, QueryParameterSet queryParameterSet)
Queries geometric objects that satisfy a certain spatial relationship with a specified geometric object and meet query conditions on a specified map.
|
QueryResult |
queryBySQL(java.lang.String mapName, QueryParameterSet queryParameterSet)
WMS standard does not support this method.
|
MapParameter |
setDefaultMapParameter(MapParameter mapParameter)
WMS standard does not support this method.
|
void |
setProviderContext(ProviderContext context)
Sets the service provider context.
|
boolean |
support(java.lang.String mapName, MapCapability capability)
Determines whether the map supports the specified function.
|
protected Rectangle2D |
unitConvert(Rectangle2D bounds, Unit oldUnit, Unit newUnit) |
boolean |
updateMap(MapParameter mapParameter)
Updates the map status permanently, which will do a persistence in the disk.
|
MapImage |
viewEntire(java.lang.String layerName, MapParameter mapParameter, ImageOutputOption outputOption)
Displays a map in the Full Extent mode according to map layer name, map parameters and image output settings.
|
public static final java.lang.String URL_CHARSET
public WMSMapProvider()
public WMSMapProvider(java.lang.String url, java.lang.String version, java.lang.String userName, java.lang.String password) throws WMSServiceException
${services_components_spi_ogc_WMSMapProvider_contructor_WMSMapProvider_Title}
${services_components_spi_ogc_WMSMapProvider_contructor_WMSMapProvider_Description}
url
- ${services_components_spi_ogc_WMSMapProvider_contructor_param_url}version
- ${services_components_spi_ogc_WMSMapProvider_contructor_param_version}userName
- ${services_components_spi_ogc_WMSMapProvider_contructor_param_userName}password
- ${services_components_spi_ogc_WMSMapProvider_contructor_param_password}java.lang.IllegalArgumentException
- ${services_components_spi_ogc_WMSMapProvider_contructor_throws_IllegalArgumentException}WMSServiceException
public WMSMapProvider(java.lang.String url, java.lang.String version, java.lang.String userName, java.lang.String password, boolean cacheEnabled, java.lang.String outputPath, java.lang.String outputSite) throws WMSServiceException
Constructs a WMSMapProvider object according to the URL, version, user name, password and cache related settings of the WMS services.
url
- The URL of the WMS service, can't be null.version
- The WMS service version number, e.g., "1.1.1".userName
- The user name for accessing the WMS service.password
- The password for accessing the WMS service.cacheEnabled
- Whether to enable the cache.outputPath
- Map images output path.outputSite
- The site for publishing map images.WMSServiceException
- The illegal argument exception.public QueryResult findNearest(java.lang.String mapName, Geometry geometry, double maxDistance, QueryParameterSet queryParameterSet)
WMS standard does not support this method.
Queries the nearest geometric object on a specified map whose distance to a specified geometry is within a certain value.
findNearest
in interface MapProvider
mapName
- The map name.geometry
- The geometric object.maxDistance
- The maximum distance.queryParameterSet
- Query parameter set.java.lang.UnsupportedOperationException
- An exception will be thrown, because the WMSMapProvider object doesn't support the method.public MapParameter getDefaultMapParameter(java.lang.String mapName)
${services_components_spi_ogc_WMSMapProvider_method_getDefaultMapParameter_Title}
${services_components_spi_ogc_WMSMapProvider_method_getDefaultMapParameter_Description}
getDefaultMapParameter
in interface MapProvider
mapName
- The map name.public MapImage getMapImage(MapParameter pMapParameter, ImageOutputOption outputOption) throws WMSServiceException
${services_components_spi_ogc_WMSMapProvider_method_getMapImage_Title}
${services_components_spi_ogc_WMSMapProvider_method_getMapImage_Description}
getMapImage
in interface MapProvider
mapParameter
- ${services_components_spi_ogc_WMSMapProvider_method_getMapImage_param_mapParameter}outputOption
- ${services_components_spi_ogc_WMSMapProvider_method_getMapImage_param_outputOption}java.lang.IllegalArgumentException
- ${services_components_spi_ogc_WMSMapProvider_method_getMapImage_throws_IllegalArgumentException}WMSServiceException
protected Rectangle2D unitConvert(Rectangle2D bounds, Unit oldUnit, Unit newUnit)
public MapParameter getMapParameter(java.lang.String mapName)
Gets the map parameters of the specified map.
getMapParameter
in interface MapProvider
mapName
- The map name.public java.util.List<java.lang.String> getNames()
Gets all the map names corresponding to the current service provider.
getNames
in interface MapProvider
public Overview getOverview(MapParameter mapParameter, ImageOutputOption outputOption)
WMSMapProvider currently does not support this method.
Gets eagle-eye map according to map parameters and image output settings.
getOverview
in interface MapProvider
mapParameter
- Map parameters.outputOption
- Image output settings.java.lang.UnsupportedOperationException
- An exception will be thrown, because the WMSMapProvider object doesn't support the method.public java.lang.String getResource(java.lang.String mapName, ResourceParameter resourceParameter)
WMS standard does not support this method.
Gets the resource image of a specified map according to a resource image parameter.
getResource
in interface MapProvider
mapName
- The map name.resourceParameter
- The resource image parameter.java.lang.UnsupportedOperationException
- An exception will be thrown, because the WMSMapProvider object doesn't support the method.public MeasureResult measureArea(java.lang.String mapName, Point2D[] points, MeasureParameter measureParam)
WMS standard does not support this method.
Measures areas on a specified map based on 2D geographic coordinates and a measuring parameter.
measureArea
in interface MapProvider
mapName
- The map name.points
- The array of 2D geographic coordinates.measureParam
- The measuring parameter.java.lang.UnsupportedOperationException
- An exception will be thrown, because the WMSMapProvider object doesn't support the method.public MeasureResult measureDistance(java.lang.String mapName, Point2D[] points, MeasureParameter measureParam)
WMS standard does not support this method.
Measures distances on a specified map based on 2D geographic coordinates and a measuring parameter.
measureDistance
in interface MapProvider
mapName
- The map name.points
- The array of 2D geographic coordinates.measureParam
- The measuring parameter.java.lang.UnsupportedOperationException
- An exception will be thrown, because the WMSMapProvider object doesn't support the method.public QueryResult queryByDistance(java.lang.String mapName, Geometry geometry, double distance, QueryParameterSet queryParameterSet)
WMS standard does not support this method.
Queries all the geometric objects on a specified map whose distances to a specified geometry are within a certain value.
Which means to query all the geometries within a circle whose center is the specified geometry.
queryByDistance
in interface MapProvider
mapName
- The map name.geometry
- The geometric object.distance
- The unit of the distance extent is identical to that of dataset coordinates corresponding to the current map.queryParameterSet
- Query parameter set.java.lang.UnsupportedOperationException
- An exception will be thrown, because the WMSMapProvider object doesn't support the method.public QueryResult queryByGeometry(java.lang.String mapName, Geometry geometry, SpatialQueryMode spatialQueryMode, QueryParameterSet queryParameterSet)
Queries geometric objects that satisfy a certain spatial relationship with a specified geometric object and meet query conditions on a specified map.
queryByGeometry
in interface MapProvider
mapName
- The map name.geometry
- The geometric object, which has spatial information and shape information, but no attribute information.spatialQueryMode
- The query mode between the spatial geometry objects.queryParameterSet
- Query parameter set.java.lang.IllegalArgumentException
- the illegal argument exception, thrown when one of the following errors occur:public QueryResult queryByBounds(java.lang.String mapName, Rectangle2D bounds, QueryParameterSet queryParameterSet)
Queries the geometries within a specified range on the map.
queryByBounds
in interface MapProvider
mapName
- The map name.bounds
- The specified extent of Bounds.queryParameters
- Query parameters can query multiple layers of a map. The query parameters in a single layer can be set in queryParameters.queryParams[i]
.public MapImage viewEntire(java.lang.String layerName, MapParameter mapParameter, ImageOutputOption outputOption)
Displays a map in the Full Extent mode according to map layer name, map parameters and image output settings.
The full geographic map extent to display is the minimum circumscribed rectangle of the specified layer.
viewEntire
in interface MapProvider
layerName
- Layer name, used to determine the full map extent.mapParameter
- Map parameters.outputOption
- Image output settings.java.lang.IllegalArgumentException
- ${services_components_spi_ogc_WMSMapProvider_method_viewEntire_throws_IllegalArgumentException}public QueryResult queryBySQL(java.lang.String mapName, QueryParameterSet queryParameterSet)
WMS standard does not support this method.
Performs SQL query on specified map.
queryBySQL
in interface MapProvider
mapName
- The map name.queryParameterSet
- Query parameter set.java.lang.UnsupportedOperationException
- An exception will be thrown, because the WMSMapProvider object doesn't support the method.public MapParameter setDefaultMapParameter(MapParameter mapParameter)
WMS standard does not support this method.
Sets the default map parameters.
setDefaultMapParameter
in interface MapProvider
mapParameter
- Map parameters.java.lang.UnsupportedOperationException
- An exception will be thrown, because the WMSMapProvider object doesn't support the method.public void setProviderContext(ProviderContext context)
setProviderContext
in interface ProviderContextAware
context
- The service provider context.public void clearCache(java.lang.String mapName, Rectangle2D bounds)
Clears the cached tiles within the specified bounds.
clearCache
in interface MapProvider
mapName
- The map name.bounds
- The specified map extent.public java.util.List<PrjCoordSys> getDynamicPrjCoordsyses(java.lang.String mapName)
DynamicProjectionable
getDynamicPrjCoordsyses
in interface DynamicProjectionable
public boolean support(java.lang.String mapName, MapCapability capability)
MapProvider
support
in interface MapProvider
mapName
- The map name.capability
- Function type.public VectorStyle getVectorStyle(java.lang.String mapName, java.lang.String[] layerNames, VectorStyleType type)
MapProvider
getVectorStyle
in interface MapProvider
mapName
- The map name.layerNames
- The layer name.type
- The vector style type.public byte[] getResource(java.lang.String mapName, ResourceParameter resourceParameter, Point2D[] points)
MapProvider
Gets the resource image of a specified map according to a resource image parameter.
getResource
in interface MapProvider
mapName
- The map name.resourceParameter
- The resource image parameter.points
- The points used to draw resource images.public boolean updateMap(MapParameter mapParameter)
MapProvider
updateMap
in interface MapProvider
mapParameter
- The map status to update to.