public class UGCMapProvider extends java.lang.Object implements MapProvider, ChartMapProvider, Disposable, ProviderContextAware, DynamicProjectionable
SuperMap map service provider.
UGCMapProvider provides services related to SuperMap maps and encapsulates the GIS functions related to SuperMap maps.
Constructor and Description |
---|
UGCMapProvider()
The default constructor.
|
UGCMapProvider(UGCMapProviderSetting providerSetting)
Constructs a UGCMapProvider object based on the configuration information of a SuperMap map service provider.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkExcludedFieldsInMapsSetting(ExcludedFieldsInMap[] excludedFieldsInMaps) |
protected static void |
checkParameterNull(java.lang.Object obj, java.lang.String parameterName)
Checks whether the parameter is null.
|
void |
clearCache(java.lang.String mapName, Rectangle2D bounds)
Clears the cache of the specified region according to the map name and the bounds.
|
void |
dispose()
Releases the resources used by SuperMap map service provider.
|
protected void |
finalize() |
QueryResult |
findNearest(java.lang.String mapName, Geometry geometry, double maxDistance, QueryParameterSet queryParameterSet)
Queries the geometric objects on a specified map whose distances to a specified geometry are within a certain value.
|
java.util.List<ChartFeatureInfoSpec> |
getChartFeatureInfoSpecs()
Gets all the chart feature 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)
Gets the list of the supported dynamic projections of the specified map.
|
MapImage |
getMapImage(MapParameter mapParameter, ImageOutputOption outputOption)
Gets map images according to map parameters and image output settings.
|
MapParameter |
getMapParameter(java.lang.String mapName)
Gets the status of a map (the map parameters) after outputting map images last time.
|
java.util.List<java.lang.String> |
getNames()
Gets all the map names corresponding to the current SuperMap map service provider.
|
Overview |
getOverview(MapParameter mapParameter, ImageOutputOption outputOption)
Gets eagle-eye map according to map parameters and image output settings.
|
protected com.supermap.services.providers.InnerUGCMapProvider |
getProvider(java.lang.String name)
Gets the inner map provider.
|
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.
|
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.
|
void |
pauseForRefreshWorkspace()
Pauses the service.
|
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)
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)
Chart feature.
|
QueryResult |
queryChart(java.lang.String mapName, java.lang.String[] chartLayerNames, ChartQueryParameterSet chartQueryParams, Rectangle2D bounds)
Chart feature.
|
void |
refreshWorkspace()
Refreshes the workspace.
|
void |
refreshWorkspaceFinished()
Refreshing the workspace has finished.
|
MapParameter |
setDefaultMapParameter(MapParameter mapParameter)
Sets the default map parameters.
|
void |
setProviderContext(ProviderContext context)
Sets the context of SuperMap map service provider.
|
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.
|
public UGCMapProvider()
The default constructor.
public UGCMapProvider(UGCMapProviderSetting providerSetting)
Constructs a UGCMapProvider object based on the configuration information of a SuperMap map service provider.
providerSetting
- The configuration information of SuperMap map service provider.public QueryResult findNearest(java.lang.String mapName, Geometry geometry, double maxDistance, QueryParameterSet queryParameterSet)
Queries the geometric objects on a specified map whose distances to a specified geometry are 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
- Map name, can not be null.geometry
- Geometry Object. The projected coordinate system is the same as map coordinates.maxDistance
- Tolerance range. The projected coordinate system is the same as map coordinates.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 getDefaultMapParameter(java.lang.String mapName)
Gets the default map parameters of the specified map.
The initial default map parameter is determined by the accessed service type. For example, when accessing the GIS capability provided by SuperMap Objects Java, the initial default map parameter is gotten from the workspace file.
getDefaultMapParameter
in interface MapProvider
mapName
- Map name, can not be null.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 boolean updateMap(MapParameter mapParameter)
MapProvider
updateMap
in interface MapProvider
mapParameter
- The map status to update to.public MapParameter getMapParameter(java.lang.String mapName)
Gets the status of a map (the map parameters) after outputting map images last time.
getMapParameter
in interface MapProvider
mapName
- Map name, can not be null.public java.util.List<java.lang.String> getNames()
Gets all the map names corresponding to the current SuperMap map service provider.
getNames
in interface MapProvider
public Overview getOverview(MapParameter mapParameter, ImageOutputOption outputOption)
Gets eagle-eye map according to map parameters and image output settings.
getOverview
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 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 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.
measureArea
in interface MapProvider
mapName
- Map name, can not be null.points
- The array of 2D geographic coordinates.measureParam
- The measuring parameter.public 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.
measureDistance
in interface MapProvider
mapName
- Map name, can not be null.points
- The array of 2D geographic coordinates.measureParam
- The measuring parameter.public 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. When you limit the number of the returned geometries (specified by QueryParameterSet.expectCount
), the query result is the expectCount object extracting randomly from the total query records.
Which means to query all the geometries within a circle whose center is the specified geometry.
queryByDistance
in interface MapProvider
mapName
- Map name, can not be null.geometry
- Geometry Object. The projected coordinate system is the same as map coordinates.distance
- The specified distance. The projected coordinate system is the same as map coordinates.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)
Queries the geometries within a specified range on the map.
queryByBounds
in interface MapProvider
mapName
- The map name.bounds
- The specified query range. The projected coordinate system is the same as the coordinates of the map.queryParameterSet
- Query parameters can query multiple layers of a map. The query parameters in a single layer can be set in queryParameters.queryParams[i]
.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
- Map name, can not be null.geometry
- The specified geometry, which only contains spatial information, shape information and so on, doesn't contain attribute information. The projected coordinate system is the same as the coordinate of the map.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 queryBySQL(java.lang.String mapName, QueryParameterSet queryParameterSet)
Performs SQL query on specified map.
queryBySQL
in interface MapProvider
mapName
- Map name, can not be null.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)
Sets the default map parameters.
setDefaultMapParameter
in interface MapProvider
mapParameter
- Map parameter, can not be null.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 layer name specified with the parameter determines the full geographic map extent, which takes the minimum circumscribed rectangle of the layer as the full map displayed extent.
viewEntire
in interface MapProvider
layerName
- Layer name, used to determine the full map extent.mapParameter
- Map parameters.outputOption
- Image output settings.protected static void checkParameterNull(java.lang.Object obj, java.lang.String parameterName)
Checks whether the parameter is null.
The IllegalArgumentException will be thrown if parameterName is null.
obj
- The type of the parameter to be checked.parameterName
- The name of the parameter to be checked.protected com.supermap.services.providers.InnerUGCMapProvider getProvider(java.lang.String name)
name
- The map name.public void dispose()
Releases the resources used by SuperMap map service provider.
dispose
in interface Disposable
public void setProviderContext(ProviderContext context)
Sets the context of SuperMap map service provider.
setProviderContext
in interface ProviderContextAware
context
- The context of SuperMap map service provider.protected void checkExcludedFieldsInMapsSetting(ExcludedFieldsInMap[] excludedFieldsInMaps)
public void pauseForRefreshWorkspace()
Pauses the service.
public void refreshWorkspaceFinished()
Refreshing the workspace has finished.
public void refreshWorkspace()
Refreshes the workspace.
public void clearCache(java.lang.String mapName, Rectangle2D bounds)
Clears the cache of the specified region according to the map name and the bounds.
clearCache
in interface MapProvider
mapName
- The map name.bounds
- The bounds of the region.public java.util.List<PrjCoordSys> getDynamicPrjCoordsyses(java.lang.String mapName)
Gets the list of the supported dynamic projections of the specified map.
getDynamicPrjCoordsyses
in interface DynamicProjectionable
public java.util.List<ChartFeatureInfoSpec> getChartFeatureInfoSpecs()
getChartFeatureInfoSpecs
in interface ChartMapProvider
public QueryResult queryChart(java.lang.String mapName, java.lang.String[] chartLayerNames, ChartQueryParameterSet chartQueryParams)
queryChart
in interface ChartMapProvider
public QueryResult queryChart(java.lang.String mapName, java.lang.String[] chartLayerNames, ChartQueryParameterSet chartQueryParams, Rectangle2D bounds)
queryChart
in interface ChartMapProvider
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
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.