public class AggregationMapProvider extends java.lang.Object implements MapProvider, Disposable, ProviderContextAware
The map service provider with aggregation capabilities.
The GIS service provider with aggregation capabilities is a special kind of GIS service provider, which is also known as the service aggregator in SuperMap iServer. The map service provider with aggregation capabilities can be called the map service aggregator, which is an aggregator with aggregation capabilities.
Unlike other service providers (such as WMSMapProvider
, WMS service providers), the service aggregator does not access the remote or local services directly or encapsulate GIS functionalities directly, however, it implements GIS functionalities by calling different types of GIS service providers. These GIS service providers encapsulate and integrate a variety of services of different types and sources
For example, AggregationMapProvider
can implement the aggregation of map functionalities provided by the local SuperMap Objects and by the remote WFS service by calling the UGCMapProvider
(the UGC map service providers) and the WMSMapProvider
(the WFS service providers). As shown in the following image:
Map aggregation capabilities supported by AggregationMapProvider
currently include:
AggregationMapProvider
currently doesn't support following functions:
Constructor and Description |
---|
AggregationMapProvider()
The default constructor.
|
AggregationMapProvider(AggregationMapProviderSetting mapProviderSetting)
Constructs a new AggregationMapProvider instance according to settings of the aggregation map service provider.
|
Modifier and Type | Method and Description |
---|---|
void |
clearCache(java.lang.String mapName, Rectangle2D bounds)
Clears the cached tiles within the specified bounds.
|
void |
dispose()
Releases the resources used by the current service provider.
|
QueryResult |
findNearest(java.lang.String mapName, Geometry geometry, double maxDistance, QueryParameterSet queryParameters)
Queries the nearest geometric object whose distance to a specified geometry is within a certain value.
|
MapParameter |
getDefaultMapParameter(java.lang.String mapName)
Gets the default map parameters of a specified map, and the name of that is the map name after aggregation.
|
protected QueryResult |
getExpectedResult(java.util.List<QueryResult> queryResultList, int start, int expectedCount)
Gets the expected query result according to multiple query results.
|
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 of a specified map, and the name of that is the map name after aggregation.
|
java.util.List<java.lang.String> |
getNames()
Gets the map name list corresponding to the current map service provider.
|
Overview |
getOverview(MapParameter mapParameter, ImageOutputOption outputOption)
Currently does not support this method.
|
protected QueryParameterSet |
getQueryParameters(QueryParameterSet referQueryParam, int index)
Gets the valid query parameters.
|
protected Recordset |
getRecordset(Recordset recordset, int start, int count)
Copies a new recordset with a specified recordset.
|
java.lang.String |
getResource(java.lang.String mapName, ResourceParameter resourceParameter)
Gets the resource image of the map after aggregation 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 the map after aggregation based on 2D geographic coordinates and a measuring parameter.
|
MeasureResult |
measureDistance(java.lang.String mapName, Point2D[] points, MeasureParameter measureParam)
Measures distances on the map after aggregation based on 2D geographic coordinates and a measuring parameter.
|
protected MapParameter |
merge(java.util.List<MapParameter> mapParameters)
Merges map parameters of multiple maps.
|
protected Rectangle2D |
merge(Rectangle2D bounds, Rectangle2D bounds2)
Merges map extent 1 and map extent 2.
|
protected void |
mergeByUrl(java.util.List<java.lang.String> urls, java.lang.String outputPath)
Performs the overlay operation on multiple map images and outputs new images.
|
QueryResult |
queryByBounds(java.lang.String mapName, Rectangle2D bounds, QueryParameterSet queryParameterSet)
Queries the geometries within a specified range on the map after aggregation.
|
QueryResult |
queryByDistance(java.lang.String mapName, Geometry geometry, double distance, QueryParameterSet queryParam)
Queries all the geometric objects on the map after aggregation whose distances to a specified geometry are within a certain value.
|
QueryResult |
queryByGeometry(java.lang.String mapName, Geometry geometry, SpatialQueryMode spatialQueryMode, QueryParameterSet queryParam)
Queries geometric objects that satisfy a certain spatial relationship with a specified geometric object and meet query conditions on the map after aggregation.
|
QueryResult |
queryBySQL(java.lang.String mapName, QueryParameterSet queryParam)
Performs SQL query on the map after aggregation.
|
MapParameter |
setDefaultMapParameter(MapParameter mapParameter)
Currently does not support this method.
|
void |
setProviderContext(ProviderContext context)
Sets the context of the aggregation 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 AggregationMapProvider()
The default constructor.
public AggregationMapProvider(AggregationMapProviderSetting mapProviderSetting)
Constructs a new AggregationMapProvider instance according to settings of the aggregation map service provider.
mapProviderSetting
- The aggregation map service provider setting, can not be null.public java.util.List<java.lang.String> getNames()
Gets the map name list corresponding to the current map service provider.
getNames
in interface MapProvider
public MapParameter getMapParameter(java.lang.String mapName)
Gets map parameters of a specified map, and the name of that is the map name after aggregation.
When aggregating several maps, you can get map parameters after aggregation by this method , where the layer list (MapParameter.layers
) stores all layers of several maps in aggregation.
getMapParameter
in interface MapProvider
mapName
- The map name after aggregation.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 parameters.outputOption
- Image output settings.public java.lang.String getResource(java.lang.String mapName, ResourceParameter resourceParameter)
Gets the resource image of the map after aggregation according to a resource image parameter.
getResource
in interface MapProvider
mapName
- The map name.resourceParameter
- The resource image parameter.public MeasureResult measureDistance(java.lang.String mapName, Point2D[] points, MeasureParameter measureParam)
Measures distances on the map after aggregation based on 2D geographic coordinates and a measuring parameter.
measureDistance
in interface MapProvider
mapName
- The map name after aggregation.points
- The array of 2D geographic coordinates.measureParam
- The measuring parameter.public MeasureResult measureArea(java.lang.String mapName, Point2D[] points, MeasureParameter measureParam)
Measures areas on the map after aggregation based on 2D geographic coordinates and a measuring parameter.
measureArea
in interface MapProvider
mapName
- The map name after aggregation.points
- The array of 2D geographic coordinates.measureParam
- The measuring parameter.public QueryResult queryByDistance(java.lang.String mapName, Geometry geometry, double distance, QueryParameterSet queryParam)
Queries all the geometric objects on the map after aggregation 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.
This method will return all the geometries that satisfy the filter condition.
queryByDistance
in interface MapProvider
mapName
- The map name after aggregation.geometry
- The geometric object, which has spatial information and shape information, but no attribute information.distance
- The querying distance.queryParam
- Query parameters can query multiple layers of a map. The query parameters in a single layer can be set in queryParam.queryParams[i]
.public QueryResult queryByGeometry(java.lang.String mapName, Geometry geometry, SpatialQueryMode spatialQueryMode, QueryParameterSet queryParam)
Queries geometric objects that satisfy a certain spatial relationship with a specified geometric object and meet query conditions on the map after aggregation.
This method will return all the geometries that satisfy the filter condition.
queryByGeometry
in interface MapProvider
mapName
- The map name after aggregation.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.queryParam
- Query parameters can query multiple layers of a map. The query parameters in a single layer can be set in queryParam.queryParams[i]
.public QueryResult queryByBounds(java.lang.String mapName, Rectangle2D bounds, QueryParameterSet queryParameterSet)
Queries the geometries within a specified range on the map after aggregation.
queryByBounds
in interface MapProvider
mapName
-bounds
-queryParameterSet
-public QueryResult queryBySQL(java.lang.String mapName, QueryParameterSet queryParam)
Performs SQL query on the map after aggregation.
This method will return all the geometries that satisfy the filter condition.
queryBySQL
in interface MapProvider
mapName
- The map name after aggregation.queryParam
- Query parameters can query multiple layers of a map. The query parameters in a single layer can be set in queryParam.queryParams[i]
.public MapParameter setDefaultMapParameter(MapParameter mapParameter)
Currently does not support this method.
Sets the default map parameters.
setDefaultMapParameter
in interface MapProvider
mapParameter
- Map parameters.public MapParameter getDefaultMapParameter(java.lang.String mapName)
Gets the default map parameters of a specified map, and the name of that is the map name after aggregation.
When aggregating several maps, you can get map parameters after aggregation by this method , where the map name (MapParameter.name
) is the aggregation name, and the layer list (MapParameter.layers
) stores all layers of several maps in aggregation.
getDefaultMapParameter
in interface MapProvider
mapName
- The map name after aggregation.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)
Currently does not support this method.
Gets the overview after maps are overlaid together.
getOverview
in interface MapProvider
mapParameter
- Map parameters.outputOption
- Image output settings.public QueryResult findNearest(java.lang.String mapName, Geometry geometry, double maxDistance, QueryParameterSet queryParameters)
Queries the nearest geometric object whose distance to a specified geometry is within a certain value.
This method will return all the geometries that satisfy the filter condition.
findNearest
in interface MapProvider
mapName
- The specified map name.geometry
- The specified Geometric object.maxDistance
- The maximum distance.queryParameters
- Query parameters can query multiple layers of a map. The query parameters in a single layer can be set in queryParam.queryParams[i]
.public void dispose()
Releases the resources used by the current service provider.
dispose
in interface Disposable
public void setProviderContext(ProviderContext context)
Sets the context of the aggregation service provider.
setProviderContext
in interface ProviderContextAware
context
- The context of the aggregation service provider.protected MapParameter merge(java.util.List<MapParameter> mapParameters)
Merges map parameters of multiple maps.
SuperMap iServer chooses the map parameter of the last map in the map list as the merged map parameter, and then adds layers of all maps to the layer list (MapParameter.layers
) of the merged map parameters.
mapParameters
- The map parameter list.protected void mergeByUrl(java.util.List<java.lang.String> urls, java.lang.String outputPath)
Performs the overlay operation on multiple map images and outputs new images.
The default format of the new image is PNG.
urls
- The image URL list.outputPath
- The path of the new image after overlay.protected Rectangle2D merge(Rectangle2D bounds, Rectangle2D bounds2)
Merges map extent 1 and map extent 2.
The returned map contains map extent 1 and map extent 2.
bounds
- The specified map extent 1.bounds2
- The specified map extent 2.protected QueryParameterSet getQueryParameters(QueryParameterSet referQueryParam, int index)
Gets the valid query parameters.
Valid means the dataset (referQueryParam.queryParams[i].name
) of the query parameters exists in the sublayer (Layer.subLayers
) of the layers (MapParameter.layers
) of the current map parameter.
referQueryParam
- Query parameters can query multiple layers of a map. The query parameters in a single layer can be set in queryParam.queryParams[i]
.index
- The element index in the map parameter list.protected QueryResult getExpectedResult(java.util.List<QueryResult> queryResultList, int start, int expectedCount)
Gets the expected query result according to multiple query results.
queryResultList
- The query result list, indicating the list of the query result of each map.start
- The start record index (QueryParameterSet.startRecord
).expectedCount
- The expected count of the returned records (QueryParameterSet.expectCount
).protected Recordset getRecordset(Recordset recordset, int start, int count)
Copies a new recordset with a specified recordset. The new recordset starts from the specified position (parameter start) in the original recordset and ends at he position calculated by paramter count.
recordset
- The specified recordset.start
- The start location of the feature array.count
- The number of feature array elements to be copied.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.