Class GeoPackageMapProvider
- java.lang.Object
-
- com.supermap.services.components.spi.TiledMapProviderBase
-
- com.supermap.services.providers.LocalTileProviderBase
-
- com.supermap.services.providers.GeoPackageMapProvider
-
- All Implemented Interfaces:
- Disposable, MapProvider, ProviderContextAware
public class GeoPackageMapProvider extends LocalTileProviderBase
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.supermap.services.components.spi.TiledMapProviderBase
TiledMapProviderBase.TileDataConverter, TiledMapProviderBase.TileImageDrawer, TiledMapProviderBase.TileImageParameter
-
-
Field Summary
-
Fields inherited from class com.supermap.services.providers.LocalTileProviderBase
localTileResource
-
Fields inherited from class com.supermap.services.components.spi.TiledMapProviderBase
CACHE_DIR, LINK_MARK, lock, logger, message, QUESTION_MARK, REGEX, REPLACEMENT, tilePixHeight, tilePixWidth
-
-
Constructor Summary
Constructors Constructor and Description GeoPackageMapProvider()GeoPackageMapProvider(GeoPackageMapProviderSetting providerSetting)
-
Method Summary
Methods Modifier and Type Method and Description protected booleancacheEnabled()voidclearCache(java.lang.String mapName, Rectangle2D bounds)Clears the cache corresponding to a specified area.voiddispose()Release the resource object.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.MapParametergetMapParameter(java.lang.String mapName)Gets the status of a map (the map parameters) after outputting map images last time.protected Point2DgetOrigin(java.lang.String mapName)Get the geographical coordinate of left upper corner of the map.OverviewgetOverview(MapParameter mapParameter, ImageOutputOption outputOption)Gets the overview map image 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.OutputFormat[]getSupportImageFormat(java.lang.String mapName)Return the supported image formats.double[]getSupportResolutions(java.lang.String mapName)Returns the resolution of the current service support.
protected byte[]getTileImage(TiledMapProviderBase.TileImageParameter tileParam)VectorStylegetVectorStyle(java.lang.String mapName, java.lang.String[] layerNames, VectorStyleType type)Gets the specified vector layer style in the specified map.protected java.util.Map<java.lang.String,MapParameter>initDefaultMapParameter()Initializing the default map status, a mapping object will be returned, of which the key is map name, valude is map parameter object.protected java.util.List<java.lang.String>initSupportedMapNames()Initializes the supported map list.protected booleanisResolutionEquals(double resolution1, double resolution2)Determines if two resolutions are within the tolerance (1.0E-6)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 byte[]outputImage(MapParameter param, ImageOutputOption outputOption, double currentResolution)Output image in real time.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.QueryResultqueryBySQL(java.lang.String mapName, QueryParameterSet queryParameterSet)Performs SQL query on specified map.MapParametersetDefaultMapParameter(MapParameter mapParameter)Sets the default map parameters.booleansupport(java.lang.String mapName, MapCapability capability)Determines whether the map supports the specified function.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 com.supermap.services.providers.LocalTileProviderBase
generateBigImage
-
Methods inherited from class com.supermap.services.components.spi.TiledMapProviderBase
checkSetting, fillWatermark, getDefaultMapParameters, getMapProviderSetting, getNames, getProximalResolution, getProximalResolution, getResolutoinByScale, getResource, getTileDataConverter, init, outputImage, outputImageToFile, outputImageToFile, rectifyMapParameter, setDefaultMapParameters, setMapProviderSetting, setProviderContext, updateMap
-
-
-
-
Constructor Detail
-
GeoPackageMapProvider
public GeoPackageMapProvider()
-
GeoPackageMapProvider
public GeoPackageMapProvider(GeoPackageMapProviderSetting providerSetting)
-
-
Method Detail
-
dispose
public void dispose()
Description copied from class:TiledMapProviderBaseRelease the resource object.
- Specified by:
disposein interfaceDisposable- Overrides:
disposein classTiledMapProviderBase
-
getMapParameter
public MapParameter getMapParameter(java.lang.String mapName)
Description copied from interface:MapProviderGets the status of a map (the map parameters) after outputting map images last time.
- Specified by:
getMapParameterin interfaceMapProvider- Overrides:
getMapParameterin classTiledMapProviderBase- Parameters:
mapName- The specified map name.- Returns:
- Map parameters.
-
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- Overrides:
clearCachein classTiledMapProviderBase
-
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- Overrides:
getMapImagein classTiledMapProviderBase- Parameters:
mapParameter- Map parameters.outputOption- Image output settings.- Returns:
- The map image object.
-
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- Overrides:
getResourcein classTiledMapProviderBase- Parameters:
mapName- The map name.resourceParameter- The resource image parameter.- Returns:
- The resource image address.
-
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- Overrides:
measureDistancein classTiledMapProviderBase- 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- Overrides:
measureAreain classTiledMapProviderBase- 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- Overrides:
queryByDistancein classTiledMapProviderBase- 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- Overrides:
queryByGeometryin classTiledMapProviderBase- 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- Overrides:
queryByBoundsin classTiledMapProviderBase- 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- Overrides:
queryBySQLin classTiledMapProviderBase- 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- Overrides:
setDefaultMapParameterin classTiledMapProviderBase- Parameters:
mapParameter- Map parameters.- Returns:
- The map parameter 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- Overrides:
getDefaultMapParameterin classTiledMapProviderBase- Parameters:
mapName- The map name.- 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- Overrides:
viewEntirein classTiledMapProviderBase- 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 class:TiledMapProviderBaseGets the overview map image according to map parameters and image output settings.
- Specified by:
getOverviewin interfaceMapProvider- Overrides:
getOverviewin classTiledMapProviderBase- Parameters:
mapParameter- Map parameters.outputOption- Image output settings.- Returns:
- The overview map image 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- Overrides:
findNearestin classTiledMapProviderBase- 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.
-
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- Overrides:
supportin classTiledMapProviderBase- Parameters:
mapName- The map name.capability- Function type.- Returns:
- true means to support; otherwise, false.
-
outputImage
protected byte[] outputImage(MapParameter param, ImageOutputOption outputOption, double currentResolution)
Description copied from class:TiledMapProviderBaseOutput image in real time. It is stored in the specified path according to the map parameter.
- Overrides:
outputImagein classTiledMapProviderBase- Parameters:
param- Map statusoutputOption- Image parametercurrentResolution- Resolution
-
getTileImage
protected byte[] getTileImage(TiledMapProviderBase.TileImageParameter tileParam)
- Specified by:
getTileImagein classLocalTileProviderBase
-
getSupportResolutions
public double[] getSupportResolutions(java.lang.String mapName)
Description copied from class:TiledMapProviderBaseReturns the resolution of the current service support. If all resolutions are supported, empty is returned.
- Specified by:
getSupportResolutionsin classTiledMapProviderBase- Parameters:
mapName- The map name.- Returns:
- The resolution array.
-
initSupportedMapNames
protected java.util.List<java.lang.String> initSupportedMapNames()
Description copied from class:TiledMapProviderBaseInitializes the supported map list.- Specified by:
initSupportedMapNamesin classTiledMapProviderBase- Returns:
- The map name list.
-
initDefaultMapParameter
protected java.util.Map<java.lang.String,MapParameter> initDefaultMapParameter()
Description copied from class:TiledMapProviderBaseInitializing the default map status, a mapping object will be returned, of which the key is map name, valude is map parameter object.
- Specified by:
initDefaultMapParameterin classTiledMapProviderBase- Returns:
- Map status mapping. The key is the map name, and the value is the map parameter object.
-
getSupportImageFormat
public OutputFormat[] getSupportImageFormat(java.lang.String mapName)
Description copied from class:TiledMapProviderBaseReturn the supported image formats.
- Specified by:
getSupportImageFormatin classTiledMapProviderBase- Parameters:
mapName- The map name.- Returns:
- Supported image format array
-
getOrigin
protected Point2D getOrigin(java.lang.String mapName)
Description copied from class:TiledMapProviderBaseGet the geographical coordinate of left upper corner of the map.
- Specified by:
getOriginin classTiledMapProviderBase- Parameters:
mapName- The map name.- Returns:
- The geographical coordinate of left upper corner of the map.
-
cacheEnabled
protected boolean cacheEnabled()
- Specified by:
cacheEnabledin classTiledMapProviderBase
-
isResolutionEquals
protected boolean isResolutionEquals(double resolution1, double resolution2)Description copied from class:TiledMapProviderBaseDetermines if two resolutions are within the tolerance (1.0E-6)
- Overrides:
isResolutionEqualsin classTiledMapProviderBase- Parameters:
resolution1- doubleresolution2- double- Returns:
- Is it equal
-
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- Overrides:
getVectorStylein classTiledMapProviderBase- Parameters:
mapName- The map name.layerNames- The layer name.type- The vector style type.- Returns:
- Vector layer style.
-
-