public class RestMapProvider extends RestProviderBase implements ProviderContextAware, DynamicProjectionable, MapProvider, ChartMapProvider
REST map service provider.
RESTMapProvider provides services for getting SuperMap iServer maps from the REST services and encapsulates GIS functionalities related to SuperMap iServer map.
RestProviderBase.CacheModel, RestProviderBase.RestRequestException
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DISTANCE |
JAVA_POSTFIX, javaConverter, JSON_POSTFIX, jsonConverter, jsonDecoder, lock, logger, message
Constructor and Description |
---|
RestMapProvider()
The constructor.
|
RestMapProvider(RestMapProviderSetting setting)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
protected static void |
checkParameterNull(java.lang.Object obj, java.lang.String parameterName) |
void |
clearCache(java.lang.String mapName, Rectangle2D bounds)
Clears the cached tiles within the specified bounds.
|
protected java.lang.String |
createMapParamKVPPart(MapParameter param, OutputFormat format, boolean transparent)
Serializes the MapParameter object to generate MapParameter related items for the Get method of the image resource.
|
void |
dispose()
Release the resource object.
|
QueryResult |
findNearest(java.lang.String mapName, Geometry geometry, double maxDistance, QueryParameterSet queryParameterSet)
Queries the nearest geometric object on a specified map whose distance to a specified geometry is within a certain value.
|
java.util.List<ChartFeatureInfoSpec> |
getChartFeatureInfoSpecs()
Gets all object types
|
MapParameter |
getDefaultMapParameter(java.lang.String mapName)
Gets the default map parameters of the specified map.
|
java.util.List<PrjCoordSys> |
getDynamicPrjCoordsyses(java.lang.String mapName)
Map supported dynamic projection lists.
|
protected java.util.List<Layer> |
getLayers(java.lang.String mapName) |
MapImage |
getMapImage(MapParameter mapParameter, ImageOutputOption outputOption)
Gets map images according to map parameters and image output settings.
|
MapParameter |
getMapParameter(java.lang.String mapName)
Gets map parameters.
|
java.util.List<java.lang.String> |
getNames()
Returns the list of map names.
|
Overview |
getOverview(MapParameter mapParameter, ImageOutputOption outputOption)
Gets eagle-eye map according to map parameters and image output settings.
|
java.lang.String |
getResource(java.lang.String mapName, ResourceParameter resourceParameter)
Gets the resource image of a specified map according to a resource image parameter.
|
byte[] |
getResource(java.lang.String mapName, ResourceParameter resourceParameter, Point2D[] points)
Gets the resource image of a specified map according to a resource image parameter.
|
protected RestProviderSetting |
getRestProviderSetting()
Return the rest service provider configuration information.
|
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)
Measures areas on a specified map based on 2D geographic coordinates and a measuring parameter.
|
MeasureResult |
measureDistance(java.lang.String mapName, Point2D[] points, MeasureParameter measureParam)
Measures distances on a specified map based on 2D geographic coordinates and a measuring parameter.
|
QueryResult |
queryByBounds(java.lang.String mapName, Rectangle2D bounds, QueryParameterSet queryParameterSet)
Queries the geometries in the specified range on the map.
|
QueryResult |
queryByDistance(java.lang.String mapName, Geometry geometry, double distance, QueryParameterSet queryParameterSet)
Queries all the geometric objects on a specified map whose distances to a specified geometry are within a certain value.
|
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)
Performs SQL query on specified map.
|
QueryResult |
queryChart(java.lang.String mapName, java.lang.String[] chartLayerNames, ChartQueryParameterSet chartQueryParams)
Sea chart function, object attribute query.
|
QueryResult |
queryChart(java.lang.String mapName, java.lang.String[] chartLayerNames, ChartQueryParameterSet chartQueryParams, Rectangle2D bounds)
Sea chart function, object bounds query.
|
MapParameter |
setDefaultMapParameter(MapParameter mapParameter)
Sets the default map parameters.
|
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.
|
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.
|
clearCache, executeRequest, executeRequest, executeRequest, executeRequestForByteArray, executeRequestForByteArray, executeRequestForByteArray, executeRequestForByteArray, executeRequestForList, executeRequestForList, executeRequestForList, executeRequestForList, executeRequestForStream, executeRequestForStream, executeRequestForStream, executeRequestForText, executeRequestForText, executeRequestForText, handleExeption, init, newAndSetClient, rectifyRestServiceRootURL
public RestMapProvider(RestMapProviderSetting setting)
The constructor.
setting
-public RestMapProvider()
The constructor.
protected static void checkParameterNull(java.lang.Object obj, java.lang.String parameterName)
public void setProviderContext(ProviderContext context)
Sets the service provider context.
setProviderContext
in interface ProviderContextAware
context
- The service provider context.public java.util.List<java.lang.String> getNames()
Returns the list of map names.
getNames
in interface MapProvider
public MapParameter getMapParameter(java.lang.String mapName)
Gets map parameters.
getMapParameter
in interface MapProvider
mapName
- The map name.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 MapImage getMapImage(MapParameter mapParameter, ImageOutputOption outputOption)
Gets map images according to map parameters and image output settings.
getMapImage
in interface MapProvider
mapParameter
- Map parameter, can not be null.outputOption
- Image output settings.public java.lang.String getResource(java.lang.String mapName, ResourceParameter resourceParameter)
Gets the resource image of a specified map according to a resource image parameter.
getResource
in interface MapProvider
mapName
- Map name, can not be null.resourceParameter
- The resource image parameter.public MeasureResult measureDistance(java.lang.String mapName, Point2D[] points, MeasureParameter measureParam)
MapProvider
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.public MeasureResult measureArea(java.lang.String mapName, Point2D[] points, MeasureParameter measureParam)
MapProvider
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.public QueryResult queryByDistance(java.lang.String mapName, Geometry geometry, double distance, QueryParameterSet queryParameterSet)
MapProvider
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 querying distance.queryParameterSet
- Query parameters can query multiple layers of a map. The query parameters in a single layer can be set in queryParameterSet.queryParams[i]
.public QueryResult queryByGeometry(java.lang.String mapName, Geometry geometry, SpatialQueryMode spatialQueryMode, QueryParameterSet queryParameterSet)
MapProvider
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 spatial query mode, which defines several spatial relationships between geometries, and it allows users to construct filter conditions to perform querying. For example, searching spatial objects which are contained in specified region object, or which have a disjoint or adjacent relationship with the specified region object.queryParameterSet
- Query parameters can query multiple layers of a map. The query parameters in a single layer can be set in queryParameterSet.queryParams[i]
.public QueryResult queryByBounds(java.lang.String mapName, Rectangle2D bounds, QueryParameterSet queryParameterSet)
MapProvider
Queries the geometries in the specified range on the map.
queryByBounds
in interface MapProvider
mapName
- The map name.bounds
- The specified query bounds.public QueryResult queryBySQL(java.lang.String mapName, QueryParameterSet queryParameterSet)
MapProvider
Performs SQL query on specified map.
queryBySQL
in interface MapProvider
mapName
- The map name.queryParameterSet
- Query parameters can query multiple layers of a map. The query parameters in a single layer can be set in queryParameterSet.queryParams[i]
.public MapParameter setDefaultMapParameter(MapParameter mapParameter)
MapProvider
Sets the default map parameters.
setDefaultMapParameter
in interface MapProvider
mapParameter
- Map parameters.public MapParameter getDefaultMapParameter(java.lang.String mapName)
MapProvider
Gets the default map parameters of the specified map.
Retrieval of the initial default map parameter depends on the type of the service accessed. For example, if the GIS functions provided by SuperMap Objects Java are accessed, the initial default map parameter is obtained from a workspace file; if the GIS functions of a WMS service are accessed, the default map parameter is determined in the WMS service.
getDefaultMapParameter
in interface MapProvider
mapName
- The map name.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.public Overview getOverview(MapParameter mapParameter, ImageOutputOption outputOption)
MapProvider
Gets eagle-eye map according to map parameters and image output settings.
getOverview
in interface MapProvider
mapParameter
- Map parameters.outputOption
- Image output settings.public QueryResult findNearest(java.lang.String mapName, Geometry geometry, double maxDistance, QueryParameterSet queryParameterSet)
MapProvider
Queries the nearest geometric object on a specified map whose distance to a specified geometry is within a certain value. When limit the number of returned geometric objects (specified by QueryParameterSet.expectCount
), the query result is the expectCount features nearest to the center in the records. There is no orders of expectCount.
findNearest
in interface MapProvider
mapName
- The map name.geometry
- The geometric object.maxDistance
- The maximum distance, of which the unit is identical with that of the map specified with mapName parameter.queryParameterSet
- Query parameters can query multiple layers of a map. The query parameters in a single layer can be set in queryParameterSet.queryParams[i]
.protected RestProviderSetting getRestProviderSetting()
RestProviderBase
getRestProviderSetting
in class RestProviderBase
public java.util.List<PrjCoordSys> getDynamicPrjCoordsyses(java.lang.String mapName)
DynamicProjectionable
getDynamicPrjCoordsyses
in interface DynamicProjectionable
public java.util.List<ChartFeatureInfoSpec> getChartFeatureInfoSpecs()
ChartMapProvider
getChartFeatureInfoSpecs
in interface ChartMapProvider
public QueryResult queryChart(java.lang.String mapName, java.lang.String[] chartLayerNames, ChartQueryParameterSet chartQueryParams)
ChartMapProvider
queryChart
in interface ChartMapProvider
public QueryResult queryChart(java.lang.String mapName, java.lang.String[] chartLayerNames, ChartQueryParameterSet chartQueryParams, Rectangle2D bounds)
ChartMapProvider
queryChart
in interface ChartMapProvider
protected java.util.List<Layer> getLayers(java.lang.String mapName)
protected java.lang.String createMapParamKVPPart(MapParameter param, OutputFormat format, boolean transparent)
Serializes the MapParameter object to generate MapParameter related items for the Get method of the image resource. The redirect parameters are not included. The function does not perform null or validity checks on the parameter, not checking whether MapParameter.name is correct for instance. However, it performs null check on the fields of the parameter.
param
- The MapParameter object that needs to be serialized.format
-transparent
-public boolean support(java.lang.String mapname, MapCapability capability)
MapProvider
support
in interface MapProvider
mapname
- The map name.capability
- Function 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 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 void dispose()
Disposable
Release the resource object.
dispose
in interface Disposable
dispose
in class RestProviderBase
public boolean updateMap(MapParameter mapParameter)
MapProvider
updateMap
in interface MapProvider
mapParameter
- The map status to update to.