public class GeoPackageMapProvider extends LocalTileProviderBase
TiledMapProviderBase.TileDataConverter, TiledMapProviderBase.TileImageDrawer, TiledMapProviderBase.TileImageParameter
localTileResource
CACHE_DIR, LINK_MARK, lock, logger, message, QUESTION_MARK, REGEX, REPLACEMENT, tilePixHeight, tilePixWidth
Constructor and Description |
---|
GeoPackageMapProvider() |
GeoPackageMapProvider(GeoPackageMapProviderSetting providerSetting) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
cacheEnabled() |
void |
clearCache(java.lang.String mapName, Rectangle2D bounds)
Clears the cache corresponding to a specified area.
|
void |
dispose()
Release the resource object.
|
QueryResult |
findNearest(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.
|
MapParameter |
getDefaultMapParameter(java.lang.String mapName)
Gets the default map parameters 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.
|
protected Point2D |
getOrigin(java.lang.String mapName)
Get the geographical coordinate of left upper corner of the map.
|
Overview |
getOverview(MapParameter mapParameter, ImageOutputOption outputOption)
Gets the overview map image according to map parameters and image output settings.
|
java.lang.String |
getResource(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) |
VectorStyle |
getVectorStyle(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 boolean |
isResolutionEquals(double resolution1, double resolution2)
Determines if two resolutions are within the tolerance (1.0E-6)
|
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.
|
protected byte[] |
outputImage(MapParameter param, ImageOutputOption outputOption, double currentResolution)
Output image in real time.
|
QueryResult |
queryByBounds(java.lang.String mapName, Rectangle2D bounds, QueryParameterSet queryParameterSet)
Queries the geometries in the 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.
|
MapParameter |
setDefaultMapParameter(MapParameter mapParameter)
Sets the default map parameters.
|
boolean |
support(java.lang.String mapName, MapCapability capability)
Determines whether the map supports the specified function.
|
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.
|
generateBigImage
checkSetting, fillWatermark, getDefaultMapParameters, getMapProviderSetting, getNames, getProximalResolution, getProximalResolution, getResolutoinByScale, getResource, getTileDataConverter, init, outputImage, outputImageToFile, outputImageToFile, rectifyMapParameter, setDefaultMapParameters, setMapProviderSetting, setProviderContext, updateMap
public GeoPackageMapProvider()
public GeoPackageMapProvider(GeoPackageMapProviderSetting providerSetting)
public void dispose()
TiledMapProviderBase
Release the resource object.
dispose
in interface Disposable
dispose
in class TiledMapProviderBase
public MapParameter getMapParameter(java.lang.String mapName)
MapProvider
Gets the status of a map (the map parameters) after outputting map images last time.
getMapParameter
in interface MapProvider
getMapParameter
in class TiledMapProviderBase
mapName
- The specified map name.public void clearCache(java.lang.String mapName, Rectangle2D bounds)
MapProvider
Clears the cache corresponding to a specified area.
clearCache
in interface MapProvider
clearCache
in class TiledMapProviderBase
public MapImage getMapImage(MapParameter mapParameter, ImageOutputOption outputOption)
MapProvider
Gets map images according to map parameters and image output settings.
getMapImage
in interface MapProvider
getMapImage
in class TiledMapProviderBase
mapParameter
- Map parameters.outputOption
- Image output settings.public java.lang.String getResource(java.lang.String mapName, ResourceParameter resourceParameter)
MapProvider
Gets the resource image of a specified map according to a resource image parameter.
getResource
in interface MapProvider
getResource
in class TiledMapProviderBase
mapName
- The map name.resourceParameter
- The resource image parameter.public MeasureResult measureDistance(java.lang.String mapName, Point2D[] points, MeasureParameter measureParam)
MapProvider
Measures distances on a specified map based on 2D geographic coordinates and a measuring parameter.
measureDistance
in interface MapProvider
measureDistance
in class TiledMapProviderBase
mapName
- The map name.points
- The array of 2D geographic coordinates.measureParam
- The measuring parameter.public MeasureResult measureArea(java.lang.String mapName, Point2D[] points, MeasureParameter measureParam)
MapProvider
Measures areas on a specified map based on 2D geographic coordinates and a measuring parameter.
measureArea
in interface MapProvider
measureArea
in class TiledMapProviderBase
mapName
- The map name.points
- The array of 2D geographic coordinates.measureParam
- The measuring parameter.public QueryResult queryByDistance(java.lang.String mapName, Geometry geometry, double distance, QueryParameterSet queryParameterSet)
MapProvider
Queries 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.
queryByDistance
in interface MapProvider
queryByDistance
in class TiledMapProviderBase
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 in queryParameterSet.queryParams[i]
.public QueryResult queryByGeometry(java.lang.String mapName, Geometry geometry, SpatialQueryMode spatialQueryMode, QueryParameterSet queryParameterSet)
MapProvider
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
queryByGeometry
in class TiledMapProviderBase
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 in queryParameterSet.queryParams[i]
.public QueryResult queryByBounds(java.lang.String mapName, Rectangle2D bounds, QueryParameterSet queryParameterSet)
MapProvider
Queries the geometries in the specified range on the map.
queryByBounds
in interface MapProvider
queryByBounds
in class TiledMapProviderBase
mapName
- The map name.bounds
- The specified query bounds.public QueryResult queryBySQL(java.lang.String mapName, QueryParameterSet queryParameterSet)
MapProvider
Performs SQL query on specified map.
queryBySQL
in interface MapProvider
queryBySQL
in class TiledMapProviderBase
mapName
- The map name.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)
MapProvider
Sets the default map parameters.
setDefaultMapParameter
in interface MapProvider
setDefaultMapParameter
in class TiledMapProviderBase
mapParameter
- Map parameters.public MapParameter getDefaultMapParameter(java.lang.String mapName)
MapProvider
Gets 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.
getDefaultMapParameter
in interface MapProvider
getDefaultMapParameter
in class TiledMapProviderBase
mapName
- The map name.public MapImage viewEntire(java.lang.String layerName, MapParameter mapParameter, ImageOutputOption outputOption)
MapProvider
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
viewEntire
in class TiledMapProviderBase
layerName
- Layer name, used to determine the full map extent.mapParameter
- Map parameters.outputOption
- Image output settings.public Overview getOverview(MapParameter mapParameter, ImageOutputOption outputOption)
TiledMapProviderBase
Gets the overview map image according to map parameters and image output settings.
getOverview
in interface MapProvider
getOverview
in class TiledMapProviderBase
mapParameter
- Map parameters.outputOption
- Image output settings.public QueryResult findNearest(java.lang.String mapName, Geometry geometry, double maxDistance, QueryParameterSet queryParameterSet)
MapProvider
Queries 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.
findNearest
in interface MapProvider
findNearest
in class TiledMapProviderBase
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 in queryParameterSet.queryParams[i]
.public boolean support(java.lang.String mapName, MapCapability capability)
MapProvider
support
in interface MapProvider
support
in class TiledMapProviderBase
mapName
- The map name.capability
- Function type.protected byte[] outputImage(MapParameter param, ImageOutputOption outputOption, double currentResolution)
TiledMapProviderBase
Output image in real time. It is stored in the specified path according to the map parameter.
outputImage
in class TiledMapProviderBase
param
- Map statusoutputOption
- Image parametercurrentResolution
- Resolutionprotected byte[] getTileImage(TiledMapProviderBase.TileImageParameter tileParam)
getTileImage
in class LocalTileProviderBase
public double[] getSupportResolutions(java.lang.String mapName)
TiledMapProviderBase
Returns the resolution of the current service support. If all resolutions are supported, empty is returned.
getSupportResolutions
in class TiledMapProviderBase
mapName
- The map name.protected java.util.List<java.lang.String> initSupportedMapNames()
TiledMapProviderBase
initSupportedMapNames
in class TiledMapProviderBase
protected java.util.Map<java.lang.String,MapParameter> initDefaultMapParameter()
TiledMapProviderBase
Initializing the default map status, a mapping object will be returned, of which the key is map name, valude is map parameter object.
initDefaultMapParameter
in class TiledMapProviderBase
public OutputFormat[] getSupportImageFormat(java.lang.String mapName)
TiledMapProviderBase
Return the supported image formats.
getSupportImageFormat
in class TiledMapProviderBase
mapName
- The map name.protected Point2D getOrigin(java.lang.String mapName)
TiledMapProviderBase
Get the geographical coordinate of left upper corner of the map.
getOrigin
in class TiledMapProviderBase
mapName
- The map name.protected boolean cacheEnabled()
cacheEnabled
in class TiledMapProviderBase
protected boolean isResolutionEquals(double resolution1, double resolution2)
TiledMapProviderBase
Determines if two resolutions are within the tolerance (1.0E-6)
isResolutionEquals
in class TiledMapProviderBase
resolution1
- doubleresolution2
- doublepublic VectorStyle getVectorStyle(java.lang.String mapName, java.lang.String[] layerNames, VectorStyleType type)
MapProvider
getVectorStyle
in interface MapProvider
getVectorStyle
in class TiledMapProviderBase
mapName
- The map name.layerNames
- The layer name.type
- The vector style type.