Class AbstractVectorTileProviderBase
- java.lang.Object
-
- com.supermap.services.providers.AbstractVectorTileProviderBase
-
- All Implemented Interfaces:
- Disposable, KeywordsQueryable, MapProvider, ProviderContextAware, TiledVectorProvider
- Direct Known Subclasses:
- MVTTileProvider, SVTilesMapProvider
public abstract class AbstractVectorTileProviderBase extends java.lang.Object implements MapProvider, TiledVectorProvider, ProviderContextAware, Disposable
-
-
Field Summary
Fields Modifier and Type Field and Description protected static doubleDEFAULTDPIprotected MapParameterdefaultMapParameterprotected doubledpi
-
Constructor Summary
Constructors Constructor and Description AbstractVectorTileProviderBase()
-
Method Summary
Methods Modifier and Type Method and Description voidclearCache(java.lang.String mapName, Rectangle2D bounds)Clears the cache corresponding to a specified area.QueryResultfindNearest(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.MapParametergetDefaultMapParameter(java.lang.String mapName)Gets the default map parameters of the specified map.MapImagegetMapImage(MapParameter mapParameter, ImageOutputOption outputOption)Gets map images according to map parameters and image output settings.protected MapParametergetMapParameter(MapMetaData metaData)Gets the status of a map (the map parameters) after outputting map images last time.java.lang.StringgetMVTSpriteJson(java.lang.String spriteName)Gets the json of the MVT Sprite.byte[]getMVTSpriteResource(java.lang.String spriteName)Gets the resource of the MVT Sprite.byte[]getMVTTile(VectorTileParameter vectorTileParameter)Gets the mvt tile.java.util.List<java.lang.String>getNames()Gets all the map names corresponding to the current map service provider.OverviewgetOverview(MapParameter mapParameter, ImageOutputOption outputOption)Gets eagle-eye map according to map parameters and image output settings.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.byte[]getSDFFonts(java.lang.String fontstack, java.lang.String range)Gets data of sdf format.byte[]getSymbolData(java.lang.String symbolId, OutputFormat format)Gets the symbol image.VectorStylegetVectorStyle(java.lang.String mapName, java.lang.String[] layerNames, VectorStyleType type)Gets the specified vector layer style in the specified map.VectorTileDatagetVectorTile(VectorTileParameter vectorTileParameter)Gets vector tile of the map.java.lang.String[]listMVTSprites()Lists all the Sprites names of the MVT.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.protected doublepixelToMillMeter(int pixel)QueryResultqueryByBounds(java.lang.String mapName, Rectangle2D bounds, QueryParameterSet queryParameterSet)Queries the geometries in the 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.QueryResultqueryByKeywords(java.lang.String mapName, KeywordsQueryParameterSet queryParameterSet)Querys the features on the map based on the keywords.QueryResultqueryBySQL(java.lang.String mapName, QueryParameterSet queryParameterSet)Performs SQL query on specified map.MapParametersetDefaultMapParameter(MapParameter mapParameter)Sets the default map parameters.booleanupdateMap(MapParameter mapParameter)Updates the map status permanently, which will do a persistence in the disk.voidupdateVectorStyle(java.lang.String layerName, VectorStyleType type, java.lang.String style)Updates the vector tile style according to the input layer name and the input vector style type.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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.supermap.services.components.spi.MapProvider
support
-
Methods inherited from interface com.supermap.services.components.spi.ProviderContextAware
setProviderContext
-
Methods inherited from interface com.supermap.services.components.spi.Disposable
dispose
-
-
-
-
Field Detail
-
DEFAULTDPI
protected static final double DEFAULTDPI
-
dpi
protected double dpi
-
defaultMapParameter
protected MapParameter defaultMapParameter
-
-
Method Detail
-
getMapParameter
protected MapParameter getMapParameter(MapMetaData metaData)
Description copied from interface:MapProviderGets the status of a map (the map parameters) after outputting map images last time.
- Specified by:
getMapParameterin interfaceMapProvider- Parameters:
metaData- The specified map name.- Returns:
- Map parameters.
-
getMapImage
public MapImage getMapImage(MapParameter mapParameter, ImageOutputOption outputOption)
Description copied from interface:MapProviderGets map images according to map parameters and image output settings.
- Specified by:
getMapImagein interfaceMapProvider- Parameters:
mapParameter- Map parameters.outputOption- Image output settings.- Returns:
- The map image object.
-
getDefaultMapParameter
public MapParameter getDefaultMapParameter(java.lang.String mapName)
Description copied from interface:MapProviderGets 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.
- Specified by:
getDefaultMapParameterin interfaceMapProvider- Parameters:
mapName- The map name.- Returns:
- The map parameter object.
-
pixelToMillMeter
protected double pixelToMillMeter(int pixel)
-
getNames
public java.util.List<java.lang.String> getNames()
Description copied from interface:MapProviderGets all the map names corresponding to the current map service provider.
- Specified by:
getNamesin interfaceMapProvider- Returns:
- The list of map names.
-
measureDistance
public MeasureResult measureDistance(java.lang.String mapName, Point2D[] points, MeasureParameter measureParam)
Description copied from interface:MapProviderMeasures distances on a specified map based on 2D geographic coordinates and a measuring parameter.
- Specified by:
measureDistancein interfaceMapProvider- Parameters:
mapName- The map name.points- The array of 2D geographic coordinates.measureParam- The measuring parameter.- Returns:
- Measurement result object.
-
measureArea
public MeasureResult measureArea(java.lang.String mapName, Point2D[] points, MeasureParameter measureParam)
Description copied from interface:MapProviderMeasures areas on a specified map based on 2D geographic coordinates and a measuring parameter.
- Specified by:
measureAreain interfaceMapProvider- Parameters:
mapName- The map name.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)
Description copied from interface:MapProviderQueries 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.
- Specified by:
queryByDistancein interfaceMapProvider- Parameters:
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 inqueryParameterSet.queryParams[i].- Returns:
- Query result object.
-
queryByGeometry
public QueryResult queryByGeometry(java.lang.String mapName, Geometry geometry, SpatialQueryMode spatialQueryMode, QueryParameterSet queryParameterSet)
Description copied from interface:MapProviderQueries 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- 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 inqueryParameterSet.queryParams[i].- Returns:
- Query result object.
-
queryByBounds
public QueryResult queryByBounds(java.lang.String mapName, Rectangle2D bounds, QueryParameterSet queryParameterSet)
Description copied from interface:MapProviderQueries the geometries in the specified range on the map.
- Specified by:
queryByBoundsin interfaceMapProvider- Parameters:
mapName- The map name.bounds- The specified query bounds.- Returns:
- Query result object.
-
queryBySQL
public QueryResult queryBySQL(java.lang.String mapName, QueryParameterSet queryParameterSet)
Description copied from interface:MapProviderPerforms SQL query on specified map.
- Specified by:
queryBySQLin interfaceMapProvider- Parameters:
mapName- The map name.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)
Description copied from interface:MapProviderSets the default map parameters.
- Specified by:
setDefaultMapParameterin interfaceMapProvider- Parameters:
mapParameter- Map parameters.- Returns:
- The map parameter object.
-
viewEntire
public MapImage viewEntire(java.lang.String layerName, MapParameter mapParameter, ImageOutputOption outputOption)
Description copied from interface:MapProviderDisplays 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.
- 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.
-
getOverview
public Overview getOverview(MapParameter mapParameter, ImageOutputOption outputOption)
Description copied from interface:MapProviderGets eagle-eye map according to map parameters and image output settings.
- Specified by:
getOverviewin interfaceMapProvider- Parameters:
mapParameter- Map parameters.outputOption- Image output settings.- Returns:
- Eagle-eye object.
-
findNearest
public QueryResult findNearest(java.lang.String mapName, Geometry geometry, double maxDistance, QueryParameterSet queryParameterSet)
Description copied from interface:MapProviderQueries 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.- Specified by:
findNearestin interfaceMapProvider- Parameters:
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 inqueryParameterSet.queryParams[i].- Returns:
- Query result object.
-
clearCache
public void clearCache(java.lang.String mapName, Rectangle2D bounds)Description copied from interface:MapProviderClears the cache corresponding to a specified area.
- Specified by:
clearCachein interfaceMapProvider
-
queryByKeywords
public QueryResult queryByKeywords(java.lang.String mapName, KeywordsQueryParameterSet queryParameterSet)
Description copied from interface:KeywordsQueryableQuerys the features on the map based on the keywords.- Specified by:
queryByKeywordsin interfaceKeywordsQueryable- Parameters:
mapName- Map name.- Returns:
-
getVectorTile
public VectorTileData getVectorTile(VectorTileParameter vectorTileParameter)
Description copied from interface:TiledVectorProviderGets vector tile of the map.
- Specified by:
getVectorTilein interfaceTiledVectorProvider- Parameters:
vectorTileParameter- The parameters of the vector tile.- Returns:
- The vector tiles of map.
-
updateVectorStyle
public void updateVectorStyle(java.lang.String layerName, VectorStyleType type, java.lang.String style)Description copied from interface:TiledVectorProviderUpdates the vector tile style according to the input layer name and the input vector style type.- Specified by:
updateVectorStylein interfaceTiledVectorProvider- Parameters:
layerName- The layer name.type- The vector style type.style- The vector tile style to be updated.
-
getSymbolData
public byte[] getSymbolData(java.lang.String symbolId, OutputFormat format)Description copied from interface:TiledVectorProviderGets the symbol image.- Specified by:
getSymbolDatain interfaceTiledVectorProvider- Parameters:
symbolId- Symbol id.format- Symbol format.- Returns:
- The symbol data.
-
getMVTTile
public byte[] getMVTTile(VectorTileParameter vectorTileParameter)
Description copied from interface:TiledVectorProviderGets the mvt tile.- Specified by:
getMVTTilein interfaceTiledVectorProvider- Parameters:
vectorTileParameter- The parameters of the vector tile.- Returns:
- The mvt tile data.
-
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.
-
getResource
public java.lang.String getResource(java.lang.String mapName, ResourceParameter resourceParameter)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.- 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.
-
listMVTSprites
public java.lang.String[] listMVTSprites()
Description copied from interface:TiledVectorProviderLists all the Sprites names of the MVT.- Specified by:
listMVTSpritesin interfaceTiledVectorProvider- Returns:
- Sprites names list.
-
getMVTSpriteJson
public java.lang.String getMVTSpriteJson(java.lang.String spriteName)
Description copied from interface:TiledVectorProviderGets the json of the MVT Sprite.- Specified by:
getMVTSpriteJsonin interfaceTiledVectorProvider- Parameters:
spriteName- Sprite name.- Returns:
- The json of the MVT Sprite.
-
getMVTSpriteResource
public byte[] getMVTSpriteResource(java.lang.String spriteName)
Description copied from interface:TiledVectorProviderGets the resource of the MVT Sprite.- Specified by:
getMVTSpriteResourcein interfaceTiledVectorProvider- Parameters:
spriteName- Sprite name.- Returns:
- The Sprite resource data.
-
getSDFFonts
public byte[] getSDFFonts(java.lang.String fontstack, java.lang.String range)Description copied from interface:TiledVectorProviderGets data of sdf format.- Specified by:
getSDFFontsin interfaceTiledVectorProvider- Parameters:
fontstack- The font name.range- Font- Returns:
- Font data.
-
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.
-
-