Class UGCMapProvider
- java.lang.Object
-
- com.supermap.services.providers.UGCMapProvider
-
- All Implemented Interfaces:
- ChartMapProvider, Disposable, DynamicProjectionable, MapProvider, ProviderContextAware
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 Summary
Constructors 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.
-
Method Summary
Methods Modifier and Type Method and Description protected voidcheckExcludedFieldsInMapsSetting(ExcludedFieldsInMap[] excludedFieldsInMaps)protected static voidcheckParameterNull(java.lang.Object obj, java.lang.String parameterName)Checks whether the parameter is null.voidclearCache(java.lang.String mapName, Rectangle2D bounds)Clears the cache of the specified region according to the map name and the bounds.voiddispose()Releases the resources used by SuperMap map service provider.protected voidfinalize()QueryResultfindNearest(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.MapParametergetDefaultMapParameter(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.MapImagegetMapImage(MapParameter mapParameter, ImageOutputOption outputOption)Gets map images according to map parameters and image output settings.MapParametergetMapParameter(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.OverviewgetOverview(MapParameter mapParameter, ImageOutputOption outputOption)Gets eagle-eye map according to map parameters and image output settings.protected com.supermap.services.providers.InnerUGCMapProvidergetProvider(java.lang.String name)Gets the inner map provider.java.lang.StringgetResource(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.VectorStylegetVectorStyle(java.lang.String mapName, java.lang.String[] layerNames, VectorStyleType type)Gets the specified vector layer style in the specified map.MeasureResultmeasureArea(java.lang.String mapName, Point2D[] points, MeasureParameter measureParam)Measures areas on a specified map based on 2D geographic coordinates and a measuring parameter.MeasureResultmeasureDistance(java.lang.String mapName, Point2D[] points, MeasureParameter measureParam)Measures distances on a specified map based on 2D geographic coordinates and a measuring parameter.voidpauseForRefreshWorkspace()Pauses the service.QueryResultqueryByBounds(java.lang.String mapName, Rectangle2D bounds, QueryParameterSet queryParameterSet)Queries the geometries within a specified range on the map.QueryResultqueryByDistance(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.QueryResultqueryByGeometry(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.QueryResultqueryBySQL(java.lang.String mapName, QueryParameterSet queryParameterSet)Performs SQL query on specified map.QueryResultqueryChart(java.lang.String mapName, java.lang.String[] chartLayerNames, ChartQueryParameterSet chartQueryParams)Chart feature.QueryResultqueryChart(java.lang.String mapName, java.lang.String[] chartLayerNames, ChartQueryParameterSet chartQueryParams, Rectangle2D bounds)Chart feature.voidrefreshWorkspace()Refreshes the workspace.voidrefreshWorkspaceFinished()Refreshing the workspace has finished.MapParametersetDefaultMapParameter(MapParameter mapParameter)Sets the default map parameters.voidsetProviderContext(ProviderContext context)Sets the context of SuperMap map service provider.booleansupport(java.lang.String mapName, MapCapability capability)Determines whether the map supports the specified function.booleanupdateMap(MapParameter mapParameter)Updates the map status permanently, which will do a persistence in the disk.MapImageviewEntire(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.
-
-
-
Constructor Detail
-
UGCMapProvider
public UGCMapProvider()
The default constructor.
-
UGCMapProvider
public UGCMapProvider(UGCMapProviderSetting providerSetting)
Constructs a UGCMapProvider object based on the configuration information of a SuperMap map service provider.
- Parameters:
providerSetting- The configuration information of SuperMap map service provider.
-
-
Method Detail
-
findNearest
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.- Specified by:
findNearestin interfaceMapProvider- Parameters:
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 inqueryParameterSet.queryParams[i].- Returns:
- Query result object.
-
getDefaultMapParameter
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.
- Specified by:
getDefaultMapParameterin interfaceMapProvider- Parameters:
mapName- Map name, can not be null.- Returns:
- The map parameter object.
-
getMapImage
public MapImage getMapImage(MapParameter mapParameter, ImageOutputOption outputOption)
Gets map images according to map parameters and image output settings.
- Specified by:
getMapImagein interfaceMapProvider- Parameters:
mapParameter- Map parameter, can not be null.outputOption- Image output settings.- Returns:
- The map image object.
-
updateMap
public boolean updateMap(MapParameter mapParameter)
Description copied from interface:MapProviderUpdates the map status permanently, which will do a persistence in the disk.- Specified by:
updateMapin interfaceMapProvider- Parameters:
mapParameter- The map status to update to.- Returns:
- Whether the update is successful.
-
getMapParameter
public MapParameter getMapParameter(java.lang.String mapName)
Gets the status of a map (the map parameters) after outputting map images last time.
- Specified by:
getMapParameterin interfaceMapProvider- Parameters:
mapName- Map name, can not be null.- Returns:
- Map parameters.
-
getNames
public java.util.List<java.lang.String> getNames()
Gets all the map names corresponding to the current SuperMap map service provider.
- Specified by:
getNamesin interfaceMapProvider- Returns:
- The list of map names.
-
getOverview
public Overview getOverview(MapParameter mapParameter, ImageOutputOption outputOption)
Gets eagle-eye map according to map parameters and image output settings.
- Specified by:
getOverviewin interfaceMapProvider- Parameters:
mapParameter- Map parameter, can not be null.outputOption- Image output settings.- Returns:
- Eagle-eye object.
-
getResource
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.
- Specified by:
getResourcein interfaceMapProvider- Parameters:
mapName- Map name, can not be null.resourceParameter- The resource image parameter.- Returns:
- The resource image address.
-
getResource
public byte[] getResource(java.lang.String mapName, ResourceParameter resourceParameter, Point2D[] points)Description copied from interface:MapProviderGets the resource image of a specified map according to a resource image parameter.
- Specified by:
getResourcein interfaceMapProvider- Parameters:
mapName- The map name.resourceParameter- The resource image parameter.points- The points used to draw resource images.- Returns:
- Binary stream of the image.
-
measureArea
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.
- Specified by:
measureAreain interfaceMapProvider- Parameters:
mapName- Map name, can not be null.points- The array of 2D geographic coordinates.measureParam- The measuring parameter.- Returns:
- Measurement result object.
-
measureDistance
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.
- Specified by:
measureDistancein interfaceMapProvider- Parameters:
mapName- Map name, can not be null.points- The array of 2D geographic coordinates.measureParam- The measuring parameter.- Returns:
- Measurement result object.
-
queryByDistance
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.
- Specified by:
queryByDistancein interfaceMapProvider- Parameters:
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 inqueryParameterSet.queryParams[i].- Returns:
- Query result object.
-
queryByBounds
public QueryResult queryByBounds(java.lang.String mapName, Rectangle2D bounds, QueryParameterSet queryParameterSet)
Queries the geometries within a specified range on the map.
- Specified by:
queryByBoundsin interfaceMapProvider- Parameters:
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 inqueryParameters.queryParams[i].- Returns:
- Query result object.
-
queryByGeometry
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.
- Specified by:
queryByGeometryin interfaceMapProvider- Parameters:
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 inqueryParameterSet.queryParams[i].- Returns:
- Query result object.
-
queryBySQL
public QueryResult queryBySQL(java.lang.String mapName, QueryParameterSet queryParameterSet)
Performs SQL query on specified map.
- Specified by:
queryBySQLin interfaceMapProvider- Parameters:
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 inqueryParameterSet.queryParams[i].- Returns:
- Query result object.
-
setDefaultMapParameter
public MapParameter setDefaultMapParameter(MapParameter mapParameter)
Sets the default map parameters.
- Specified by:
setDefaultMapParameterin interfaceMapProvider- Parameters:
mapParameter- Map parameter, can not be null.- Returns:
- The map parameter object.
-
viewEntire
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.
- Specified by:
viewEntirein interfaceMapProvider- Parameters:
layerName- Layer name, used to determine the full map extent.mapParameter- Map parameters.outputOption- Image output settings.- Returns:
- The Map object.
-
checkParameterNull
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.
- Parameters:
obj- The type of the parameter to be checked.parameterName- The name of the parameter to be checked.
-
getProvider
protected com.supermap.services.providers.InnerUGCMapProvider getProvider(java.lang.String name)
Gets the inner map provider.- Parameters:
name- The map name.- Returns:
- The inner map provider.
-
dispose
public void dispose()
Releases the resources used by SuperMap map service provider.
- Specified by:
disposein interfaceDisposable
-
setProviderContext
public void setProviderContext(ProviderContext context)
Sets the context of SuperMap map service provider.
- Specified by:
setProviderContextin interfaceProviderContextAware- Parameters:
context- The context of SuperMap map service provider.
-
checkExcludedFieldsInMapsSetting
protected void checkExcludedFieldsInMapsSetting(ExcludedFieldsInMap[] excludedFieldsInMaps)
-
pauseForRefreshWorkspace
public void pauseForRefreshWorkspace()
Pauses the service.
-
refreshWorkspaceFinished
public void refreshWorkspaceFinished()
Refreshing the workspace has finished.
-
refreshWorkspace
public void refreshWorkspace()
Refreshes the workspace.
-
clearCache
public void clearCache(java.lang.String mapName, Rectangle2D bounds)Clears the cache of the specified region according to the map name and the bounds.
- Specified by:
clearCachein interfaceMapProvider- Parameters:
mapName- The map name.bounds- The bounds of the region.
-
getDynamicPrjCoordsyses
public java.util.List<PrjCoordSys> getDynamicPrjCoordsyses(java.lang.String mapName)
Gets the list of the supported dynamic projections of the specified map.
- Specified by:
getDynamicPrjCoordsysesin interfaceDynamicProjectionable- Returns:
-
getChartFeatureInfoSpecs
public java.util.List<ChartFeatureInfoSpec> getChartFeatureInfoSpecs()
Gets all the chart feature types.- Specified by:
getChartFeatureInfoSpecsin interfaceChartMapProvider
-
queryChart
public QueryResult queryChart(java.lang.String mapName, java.lang.String[] chartLayerNames, ChartQueryParameterSet chartQueryParams)
Chart feature. Feature attribute query.- Specified by:
queryChartin interfaceChartMapProvider
-
queryChart
public QueryResult queryChart(java.lang.String mapName, java.lang.String[] chartLayerNames, ChartQueryParameterSet chartQueryParams, Rectangle2D bounds)
Chart feature. Feature bounds query.- Specified by:
queryChartin interfaceChartMapProvider
-
finalize
protected void finalize() throws java.lang.Throwable- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable
-
support
public boolean support(java.lang.String mapName, MapCapability capability)Description copied from interface:MapProviderDetermines whether the map supports the specified function.- Specified by:
supportin interfaceMapProvider- Parameters:
mapName- The map name.capability- Function type.- Returns:
- true means to support; otherwise, false.
-
getVectorStyle
public VectorStyle getVectorStyle(java.lang.String mapName, java.lang.String[] layerNames, VectorStyleType type)
Description copied from interface:MapProviderGets the specified vector layer style in the specified map.- Specified by:
getVectorStylein interfaceMapProvider- Parameters:
mapName- The map name.layerNames- The layer name.type- The vector style type.- Returns:
- Vector layer style.
-
-