Class FeatureTiles
- java.lang.Object
-
- mil.nga.geopackage.tiles.features.FeatureTiles
-
- Direct Known Subclasses:
DefaultFeatureTiles
public abstract class FeatureTiles extends Object
Tiles drawn from or linked to features. Used to query features and optionally draw tiles from those features.
-
-
Field Summary
Fields Modifier and Type Field Description protected Bitmap.CompressFormatcompressFormatCompress formatprotected ContextcontextContextprotected floatdensityTile density based upon the device-independent pixelsTileUtils.TILE_DPprotected FeatureDaofeatureDaoTile data access objectprotected FeatureTableStylesfeatureTableStylesFeature Style extensionprotected booleanfillPolygonFill polygon flagprotected floatheightOverlapHeight overlapping pixels between tile imagesprotected FeatureIndexManagerindexManagerWhen not null, features are retrieved using a feature indexprotected PaintlinePaintLine paintprotected floatlineStrokeWidthLine stroke widthprotected IntegermaxFeaturesPerTileOptional max features per tile.protected CustomFeaturesTilemaxFeaturesTileDrawWhen not null and the number of features is greater than the max features per tile, used to draw tiles for those tiles with more features than the maxprotected FeatureTilePointIconpointIconOptional point icon in place of a drawn circleprotected PaintpointPaintPoint paintprotected floatpointRadiusPoint radiusprotected PaintpolygonFillPaintPolygon fill paintprotected PaintpolygonPaintPolygon paintprotected floatpolygonStrokeWidthPolygon stroke widthprotected ProjectionprojectionFeature DAO Projectionprotected booleansimplifyGeometriesWhen true, geometries are simplified before being drawn.protected inttileHeightTile heightprotected inttileWidthTile widthprotected static ProjectionWEB_MERCATOR_PROJECTIONWeb Mercator Projectionprotected static ProjectionWGS_84_PROJECTIONWGS84 Projectionprotected floatwidthOverlapWidth overlapping pixels between tile images
-
Constructor Summary
Constructors Constructor Description FeatureTiles(Context context, FeatureDao featureDao)ConstructorFeatureTiles(Context context, FeatureDao featureDao, float density)ConstructorFeatureTiles(Context context, FeatureDao featureDao, int width, int height)ConstructorFeatureTiles(Context context, GeoPackage geoPackage, FeatureDao featureDao)Constructor, auto creates the index manager for indexed tables and feature styles for styled tablesFeatureTiles(Context context, GeoPackage geoPackage, FeatureDao featureDao, float density)Constructor, auto creates the index manager for indexed tables and feature styles for styled tablesFeatureTiles(Context context, GeoPackage geoPackage, FeatureDao featureDao, float density, int width, int height)Constructor, auto creates the index manager for indexed tables and feature styles for styled tablesFeatureTiles(Context context, GeoPackage geoPackage, FeatureDao featureDao, int width, int height)Constructor, auto creates the index manager for indexed tables and feature styles for styled tables
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcalculateDrawOverlap()Call after making changes to the point icon, point radius, or paint stroke widths.protected BitmapcheckIfDrawn(Bitmap bitmap)Check if the bitmap was drawn upon (non null and not transparent).voidclearCache()Clear all cachesvoidclearIconCache()Clear the icon cachevoidclearStylePaintCache()Clear the style paint cachevoidclose()Close the feature tiles connectionprotected BitmapcreateNewBitmap()Create a new empty BitmapBitmapdrawTile(int x, int y, int zoom)Draw a tile bitmap from the x, y, and zoom levelabstract BitmapdrawTile(int zoom, BoundingBox webMercatorBoundingBox, List<FeatureRow> featureRow)Draw a tile bitmap from the feature rowsabstract BitmapdrawTile(int zoom, BoundingBox webMercatorBoundingBox, FeatureIndexResults results)Draw a tile bitmap from feature index resultsabstract BitmapdrawTile(int zoom, BoundingBox webMercatorBoundingBox, FeatureCursor cursor)Draw a tile bitmap from feature geometries in the provided cursorbyte[]drawTileBytes(int x, int y, int zoom)Draw the tile and get the bytes from the x, y, and zoom levelBitmapdrawTileQueryAll(int x, int y, int zoom)Draw a tile bitmap from the x, y, and zoom level by querying all features.BitmapdrawTileQueryIndex(int x, int y, int zoom)Draw a tile bitmap from the x, y, and zoom level by querying features in the tile locationBoundingBoxexpandBoundingBox(BoundingBox webMercatorBoundingBox)Create an expanded bounding box to handle features outside the tile that overlapBoundingBoxexpandBoundingBox(BoundingBox webMercatorBoundingBox, BoundingBox tileWebMercatorBoundingBox)Create an expanded bounding box to handle features outside the tile that overlapBoundingBoxexpandBoundingBox(BoundingBox boundingBox, Projection projection)Create an expanded bounding box to handle features outside the tile that overlapBitmap.CompressFormatgetCompressFormat()Get the compress formatfloatgetDensity()Get the densityFeatureDaogetFeatureDao()Get the feature DAOprotected FeatureStylegetFeatureStyle(FeatureRow featureRow)Get the feature style for the feature row and geometry typeprotected FeatureStylegetFeatureStyle(FeatureRow featureRow, GeometryType geometryType)Get the feature style for the feature row and geometry typeFeatureTableStylesgetFeatureTableStyles()Get the feature table stylesfloatgetHeightDrawOverlap()Get the height draw overlapprotected BitmapgetIcon(IconRow iconRow)Get the icon bitmap from the icon rowFeatureIndexManagergetIndexManager()Get the index managerintgetLineAlpha()Get line alphaintgetLineColor()Get line colorprotected PaintgetLinePaint(FeatureStyle featureStyle)Get the line paint for the feature style, or return the default paintPaintgetLinePaintCopy()Get a copy of the line paint, must callsetLinePaint(Paint)to update the paintfloatgetLineStrokeWidth()Get line stroke widthIntegergetMaxFeaturesPerTile()Get the max features per tileCustomFeaturesTilegetMaxFeaturesTileDraw()Get the max features tile draw, the custom tile drawing implementation for tiles with more features than the max at #getMaxFeaturesPerTileFeatureTilePointIcongetPointIcon()Get the point iconPaintgetPointPaint()Get point paintprotected PaintgetPointPaint(FeatureStyle featureStyle)Get the point paint for the feature style, or return the default paintfloatgetPointRadius()Get the point radiusintgetPolygonAlpha()Get polygon alphaintgetPolygonColor()Get polygon colorintgetPolygonFillAlpha()Get polygon fill alphaintgetPolygonFillColor()Get polygon fill colorprotected PaintgetPolygonFillPaint(FeatureStyle featureStyle)Get the polygon fill paint for the feature style, or return the default paintPaintgetPolygonFillPaintCopy()Get the polygon fill paintprotected PaintgetPolygonPaint(FeatureStyle featureStyle)Get the polygon paint for the feature style, or return the default paintPaintgetPolygonPaintCopy()Get a copy of the polygon paint, must callsetPolygonPaint(Paint)to update the paintfloatgetPolygonStrokeWidth()Get polygon stroke widthprotected GeometryTransformgetProjectionToWebMercatorTransform(Projection projection)Create a projection transformation from provided projection to Web MercatorintgetTileHeight()Get the tile heightintgetTileWidth()Get the tile widthprotected ProjectionTransformgetWgs84ToWebMercatorTransform()Create a projection transformation from WGS84 to Web MercatorfloatgetWidthDrawOverlap()Get the width draw overlapvoidignoreFeatureTableStyles()Ignore the feature table styles within the GeoPackagebooleanisFillPolygon()Is fill polygonbooleanisIndexQuery()Is index querybooleanisSimplifyGeometries()Is the simplify geometries flag set? Default is trueprotected booleanisTransparent(Bitmap bitmap)Determine if the bitmap is a transparent image (must be in expected tile dimensions)FeatureIndexResultsqueryIndexedFeatures(int x, int y, int zoom)Query for feature results in the x, y, and zoom level by querying features in the tile locationFeatureIndexResultsqueryIndexedFeatures(BoundingBox webMercatorBoundingBox)Query for feature results in the bounding boxlongqueryIndexedFeaturesCount(int x, int y, int zoom)Query for feature result count in the x, y, and zoomlongqueryIndexedFeaturesCount(BoundingBox webMercatorBoundingBox)Query for feature result count in the bounding boxvoidsetCompressFormat(Bitmap.CompressFormat compressFormat)Set the compress formatvoidsetDensity(float density)Set the densityvoidsetDrawOverlap(float pixels)Manually set the width and height draw overlapvoidsetFeatureTableStyles(FeatureTableStyles featureTableStyles)Set the feature table stylesvoidsetFillPolygon(boolean fillPolygon)Set the fill polygonvoidsetHeightDrawOverlap(float pixels)Manually set the height draw overlapvoidsetIconCacheSize(int size)Set / resize the icon cache sizevoidsetIndexManager(FeatureIndexManager indexManager)Set the indexvoidsetLineAlpha(int lineAlpha)Set line alphavoidsetLineColor(int lineColor)Set line colorvoidsetLinePaint(Paint linePaint)Set the line paintvoidsetLineStrokeWidth(float lineStrokeWidth)Set line stroke widthvoidsetMaxFeaturesPerTile(Integer maxFeaturesPerTile)Set the max features per tile.voidsetMaxFeaturesTileDraw(CustomFeaturesTile maxFeaturesTileDraw)Set the max features tile draw, used to draw tiles when more features for a single tile than the max at #getMaxFeaturesPerTile existvoidsetPointIcon(FeatureTilePointIcon pointIcon)Set the point iconvoidsetPointPaint(Paint pointPaint)Set the point paintvoidsetPointRadius(float pointRadius)Set the point radiusvoidsetPolygonAlpha(int polygonAlpha)Set polygon alphavoidsetPolygonColor(int polygonColor)Set polygon colorvoidsetPolygonFillAlpha(int polygonFillAlpha)Set polygon fill alphavoidsetPolygonFillColor(int polygonFillColor)Set polygon fill colorvoidsetPolygonFillPaint(Paint polygonFillPaint)Set the polygon fill paintvoidsetPolygonPaint(Paint polygonPaint)Set the polygon paintvoidsetPolygonStrokeWidth(float polygonStrokeWidth)Set polygon stroke widthvoidsetSimplifyGeometries(boolean simplifyGeometries)Set the simplify geometries flagvoidsetStylePaintCacheSize(int size)Set / resize the style paint cache sizevoidsetTileHeight(int tileHeight)Set the tile heightvoidsetTileWidth(int tileWidth)Set the tile widthvoidsetWidthDrawOverlap(float pixels)Manually set the width draw overlapprotected List<Point>simplifyPoints(double simplifyTolerance, List<Point> points)When the simplify tolerance is set, simplify the points to a similar curve with fewer points.
-
-
-
Field Detail
-
WGS_84_PROJECTION
protected static final Projection WGS_84_PROJECTION
WGS84 Projection
-
WEB_MERCATOR_PROJECTION
protected static final Projection WEB_MERCATOR_PROJECTION
Web Mercator Projection
-
context
protected final Context context
Context
-
featureDao
protected final FeatureDao featureDao
Tile data access object
-
projection
protected Projection projection
Feature DAO Projection
-
indexManager
protected FeatureIndexManager indexManager
When not null, features are retrieved using a feature index
-
featureTableStyles
protected FeatureTableStyles featureTableStyles
Feature Style extension
-
tileWidth
protected int tileWidth
Tile width
-
tileHeight
protected int tileHeight
Tile height
-
compressFormat
protected Bitmap.CompressFormat compressFormat
Compress format
-
pointRadius
protected float pointRadius
Point radius
-
pointPaint
protected Paint pointPaint
Point paint
-
pointIcon
protected FeatureTilePointIcon pointIcon
Optional point icon in place of a drawn circle
-
linePaint
protected Paint linePaint
Line paint
-
lineStrokeWidth
protected float lineStrokeWidth
Line stroke width
-
polygonPaint
protected Paint polygonPaint
Polygon paint
-
polygonStrokeWidth
protected float polygonStrokeWidth
Polygon stroke width
-
fillPolygon
protected boolean fillPolygon
Fill polygon flag
-
polygonFillPaint
protected Paint polygonFillPaint
Polygon fill paint
-
heightOverlap
protected float heightOverlap
Height overlapping pixels between tile images
-
widthOverlap
protected float widthOverlap
Width overlapping pixels between tile images
-
maxFeaturesPerTile
protected Integer maxFeaturesPerTile
Optional max features per tile. When more features than this value exist for creating a single tile, the tile is not created
-
maxFeaturesTileDraw
protected CustomFeaturesTile maxFeaturesTileDraw
When not null and the number of features is greater than the max features per tile, used to draw tiles for those tiles with more features than the max
-
simplifyGeometries
protected boolean simplifyGeometries
When true, geometries are simplified before being drawn. Default is true
-
density
protected float density
Tile density based upon the device-independent pixelsTileUtils.TILE_DP
-
-
Constructor Detail
-
FeatureTiles
public FeatureTiles(Context context, FeatureDao featureDao)
Constructor- Parameters:
context- contextfeatureDao- feature dao
-
FeatureTiles
public FeatureTiles(Context context, FeatureDao featureDao, float density)
Constructor- Parameters:
context- contextfeatureDao- feature daodensity- display density:DisplayMetrics.density- Since:
- 3.2.0
-
FeatureTiles
public FeatureTiles(Context context, FeatureDao featureDao, int width, int height)
Constructor- Parameters:
context- contextfeatureDao- feature daowidth- drawn tile widthheight- drawn tile height- Since:
- 3.2.0
-
FeatureTiles
public FeatureTiles(Context context, GeoPackage geoPackage, FeatureDao featureDao)
Constructor, auto creates the index manager for indexed tables and feature styles for styled tables- Parameters:
context- contextgeoPackage- GeoPackagefeatureDao- feature dao- Since:
- 3.2.0
-
FeatureTiles
public FeatureTiles(Context context, GeoPackage geoPackage, FeatureDao featureDao, float density)
Constructor, auto creates the index manager for indexed tables and feature styles for styled tables- Parameters:
context- contextgeoPackage- GeoPackagefeatureDao- feature daodensity- display density:DisplayMetrics.density- Since:
- 3.2.0
-
FeatureTiles
public FeatureTiles(Context context, GeoPackage geoPackage, FeatureDao featureDao, int width, int height)
Constructor, auto creates the index manager for indexed tables and feature styles for styled tables- Parameters:
context- contextgeoPackage- GeoPackagefeatureDao- feature daowidth- drawn tile widthheight- drawn tile height- Since:
- 3.2.0
-
FeatureTiles
public FeatureTiles(Context context, GeoPackage geoPackage, FeatureDao featureDao, float density, int width, int height)
Constructor, auto creates the index manager for indexed tables and feature styles for styled tables- Parameters:
context- contextgeoPackage- GeoPackagefeatureDao- feature daodensity- display density:DisplayMetrics.densitywidth- drawn tile widthheight- drawn tile height- Since:
- 3.2.0
-
-
Method Detail
-
close
public void close()
Close the feature tiles connection- Since:
- 1.2.7
-
calculateDrawOverlap
public void calculateDrawOverlap()
Call after making changes to the point icon, point radius, or paint stroke widths. Determines the pixel overlap between tiles
-
setDensity
public void setDensity(float density)
Set the density- Parameters:
density- density- Since:
- 3.2.0
-
getDensity
public float getDensity()
Get the density- Returns:
- density
- Since:
- 3.2.0
-
setDrawOverlap
public void setDrawOverlap(float pixels)
Manually set the width and height draw overlap- Parameters:
pixels- overlap pixels
-
getWidthDrawOverlap
public float getWidthDrawOverlap()
Get the width draw overlap- Returns:
- width pixels
-
setWidthDrawOverlap
public void setWidthDrawOverlap(float pixels)
Manually set the width draw overlap- Parameters:
pixels- overlap pixels
-
getHeightDrawOverlap
public float getHeightDrawOverlap()
Get the height draw overlap- Returns:
- height pixels
-
setHeightDrawOverlap
public void setHeightDrawOverlap(float pixels)
Manually set the height draw overlap- Parameters:
pixels- overlap pixels
-
getFeatureDao
public FeatureDao getFeatureDao()
Get the feature DAO- Returns:
- feature dao
-
isIndexQuery
public boolean isIndexQuery()
Is index query- Returns:
- true if an index query
-
getIndexManager
public FeatureIndexManager getIndexManager()
Get the index manager- Returns:
- index manager or null
- Since:
- 1.1.0
-
setIndexManager
public void setIndexManager(FeatureIndexManager indexManager)
Set the index- Parameters:
indexManager- index manager- Since:
- 1.1.0
-
getFeatureTableStyles
public FeatureTableStyles getFeatureTableStyles()
Get the feature table styles- Returns:
- feature table styles
- Since:
- 3.2.0
-
setFeatureTableStyles
public void setFeatureTableStyles(FeatureTableStyles featureTableStyles)
Set the feature table styles- Parameters:
featureTableStyles- feature table styles- Since:
- 3.2.0
-
ignoreFeatureTableStyles
public void ignoreFeatureTableStyles()
Ignore the feature table styles within the GeoPackage- Since:
- 3.2.0
-
clearCache
public void clearCache()
Clear all caches- Since:
- 3.3.0
-
clearStylePaintCache
public void clearStylePaintCache()
Clear the style paint cache- Since:
- 3.2.0
-
setStylePaintCacheSize
public void setStylePaintCacheSize(int size)
Set / resize the style paint cache size- Parameters:
size- new size- Since:
- 3.2.0
-
clearIconCache
public void clearIconCache()
Clear the icon cache- Since:
- 3.2.0
-
setIconCacheSize
public void setIconCacheSize(int size)
Set / resize the icon cache size- Parameters:
size- new size- Since:
- 3.2.0
-
getTileWidth
public int getTileWidth()
Get the tile width- Returns:
- tile width
-
setTileWidth
public void setTileWidth(int tileWidth)
Set the tile width- Parameters:
tileWidth- tile width
-
getTileHeight
public int getTileHeight()
Get the tile height- Returns:
- tile height
-
setTileHeight
public void setTileHeight(int tileHeight)
Set the tile height- Parameters:
tileHeight- tile height
-
getCompressFormat
public Bitmap.CompressFormat getCompressFormat()
Get the compress format- Returns:
- compress format
-
setCompressFormat
public void setCompressFormat(Bitmap.CompressFormat compressFormat)
Set the compress format- Parameters:
compressFormat- compress format
-
getPointRadius
public float getPointRadius()
Get the point radius- Returns:
- point radius
-
setPointRadius
public void setPointRadius(float pointRadius)
Set the point radius- Parameters:
pointRadius- point radius
-
getPointPaint
public Paint getPointPaint()
Get point paint- Returns:
- point paint
-
setPointPaint
public void setPointPaint(Paint pointPaint)
Set the point paint- Parameters:
pointPaint- point paint
-
getPointIcon
public FeatureTilePointIcon getPointIcon()
Get the point icon- Returns:
- point icon
-
setPointIcon
public void setPointIcon(FeatureTilePointIcon pointIcon)
Set the point icon- Parameters:
pointIcon- point icon
-
getLinePaintCopy
public Paint getLinePaintCopy()
Get a copy of the line paint, must callsetLinePaint(Paint)to update the paint- Returns:
- line paint
- Since:
- 3.2.0
-
setLinePaint
public void setLinePaint(Paint linePaint)
Set the line paint- Parameters:
linePaint- line paint
-
getLineStrokeWidth
public float getLineStrokeWidth()
Get line stroke width- Returns:
- width
- Since:
- 3.2.0
-
setLineStrokeWidth
public void setLineStrokeWidth(float lineStrokeWidth)
Set line stroke width- Parameters:
lineStrokeWidth- line stroke width- Since:
- 3.2.0
-
getLineColor
public int getLineColor()
Get line color- Returns:
- color
- Since:
- 3.2.0
-
setLineColor
public void setLineColor(int lineColor)
Set line color- Parameters:
lineColor- line color- Since:
- 3.2.0
-
getLineAlpha
public int getLineAlpha()
Get line alpha- Returns:
- alpha
- Since:
- 3.2.0
-
setLineAlpha
public void setLineAlpha(int lineAlpha)
Set line alpha- Parameters:
lineAlpha- line alpha- Since:
- 3.2.0
-
getPolygonPaintCopy
public Paint getPolygonPaintCopy()
Get a copy of the polygon paint, must callsetPolygonPaint(Paint)to update the paint- Returns:
- polygon paint
- Since:
- 3.2.0
-
setPolygonPaint
public void setPolygonPaint(Paint polygonPaint)
Set the polygon paint- Parameters:
polygonPaint- polygon paint
-
getPolygonStrokeWidth
public float getPolygonStrokeWidth()
Get polygon stroke width- Returns:
- width
- Since:
- 3.2.0
-
setPolygonStrokeWidth
public void setPolygonStrokeWidth(float polygonStrokeWidth)
Set polygon stroke width- Parameters:
polygonStrokeWidth- polygon stroke width- Since:
- 3.2.0
-
getPolygonColor
public int getPolygonColor()
Get polygon color- Returns:
- color
- Since:
- 3.2.0
-
setPolygonColor
public void setPolygonColor(int polygonColor)
Set polygon color- Parameters:
polygonColor- polygon color- Since:
- 3.2.0
-
getPolygonAlpha
public int getPolygonAlpha()
Get polygon alpha- Returns:
- alpha
- Since:
- 3.2.0
-
setPolygonAlpha
public void setPolygonAlpha(int polygonAlpha)
Set polygon alpha- Parameters:
polygonAlpha- polygon alpha- Since:
- 3.2.0
-
isFillPolygon
public boolean isFillPolygon()
Is fill polygon- Returns:
- fill polygon
-
setFillPolygon
public void setFillPolygon(boolean fillPolygon)
Set the fill polygon- Parameters:
fillPolygon- fill polygon
-
getPolygonFillPaintCopy
public Paint getPolygonFillPaintCopy()
Get the polygon fill paint- Returns:
- polygon fill paint
- Since:
- 3.2.0
-
setPolygonFillPaint
public void setPolygonFillPaint(Paint polygonFillPaint)
Set the polygon fill paint- Parameters:
polygonFillPaint- polygon fill paint
-
getPolygonFillColor
public int getPolygonFillColor()
Get polygon fill color- Returns:
- color
- Since:
- 3.2.0
-
setPolygonFillColor
public void setPolygonFillColor(int polygonFillColor)
Set polygon fill color- Parameters:
polygonFillColor- polygon fill color- Since:
- 3.2.0
-
getPolygonFillAlpha
public int getPolygonFillAlpha()
Get polygon fill alpha- Returns:
- alpha
- Since:
- 3.2.0
-
setPolygonFillAlpha
public void setPolygonFillAlpha(int polygonFillAlpha)
Set polygon fill alpha- Parameters:
polygonFillAlpha- polygon fill alpha- Since:
- 3.2.0
-
getMaxFeaturesPerTile
public Integer getMaxFeaturesPerTile()
Get the max features per tile- Returns:
- max features per tile or null
- Since:
- 1.1.0
-
setMaxFeaturesPerTile
public void setMaxFeaturesPerTile(Integer maxFeaturesPerTile)
Set the max features per tile. When more features are returned in a query to create a single tile, the tile is not created.- Parameters:
maxFeaturesPerTile- max features per tile- Since:
- 1.1.0
-
getMaxFeaturesTileDraw
public CustomFeaturesTile getMaxFeaturesTileDraw()
Get the max features tile draw, the custom tile drawing implementation for tiles with more features than the max at #getMaxFeaturesPerTile- Returns:
- max features tile draw or null
- Since:
- 1.1.0
- See Also:
CustomFeaturesTile,custom features tile implementation
-
setMaxFeaturesTileDraw
public void setMaxFeaturesTileDraw(CustomFeaturesTile maxFeaturesTileDraw)
Set the max features tile draw, used to draw tiles when more features for a single tile than the max at #getMaxFeaturesPerTile exist- Parameters:
maxFeaturesTileDraw- max features tile draw- Since:
- 1.1.0
- See Also:
CustomFeaturesTile,custom features tile implementation
-
isSimplifyGeometries
public boolean isSimplifyGeometries()
Is the simplify geometries flag set? Default is true- Returns:
- simplify geometries flag
- Since:
- 2.0.0
-
setSimplifyGeometries
public void setSimplifyGeometries(boolean simplifyGeometries)
Set the simplify geometries flag- Parameters:
simplifyGeometries- simplify geometries flag- Since:
- 2.0.0
-
drawTileBytes
public byte[] drawTileBytes(int x, int y, int zoom)Draw the tile and get the bytes from the x, y, and zoom level- Parameters:
x- x coordinatey- y coordinatezoom- zoom level- Returns:
- tile bytes, or null
-
drawTile
public Bitmap drawTile(int x, int y, int zoom)
Draw a tile bitmap from the x, y, and zoom level- Parameters:
x- x coordinatey- y coordinatezoom- zoom level- Returns:
- tile bitmap, or null
-
drawTileQueryIndex
public Bitmap drawTileQueryIndex(int x, int y, int zoom)
Draw a tile bitmap from the x, y, and zoom level by querying features in the tile location- Parameters:
x- x coordinatey- y coordinatezoom- zoom level- Returns:
- drawn bitmap, or null
-
queryIndexedFeaturesCount
public long queryIndexedFeaturesCount(int x, int y, int zoom)Query for feature result count in the x, y, and zoom- Parameters:
x- x coordinatey- y coordinatezoom- zoom level- Returns:
- feature count
- Since:
- 1.1.0
-
queryIndexedFeaturesCount
public long queryIndexedFeaturesCount(BoundingBox webMercatorBoundingBox)
Query for feature result count in the bounding box- Parameters:
webMercatorBoundingBox- web mercator bounding box- Returns:
- feature count
- Since:
- 3.2.0
-
queryIndexedFeatures
public FeatureIndexResults queryIndexedFeatures(int x, int y, int zoom)
Query for feature results in the x, y, and zoom level by querying features in the tile location- Parameters:
x- x coordinatey- y coordinatezoom- zoom level- Returns:
- feature index results
- Since:
- 3.2.0
-
queryIndexedFeatures
public FeatureIndexResults queryIndexedFeatures(BoundingBox webMercatorBoundingBox)
Query for feature results in the bounding box- Parameters:
webMercatorBoundingBox- web mercator bounding box- Returns:
- feature index results
- Since:
- 1.1.0
-
expandBoundingBox
public BoundingBox expandBoundingBox(BoundingBox boundingBox, Projection projection)
Create an expanded bounding box to handle features outside the tile that overlap- Parameters:
boundingBox- bounding boxprojection- bounding box projection- Returns:
- bounding box
- Since:
- 3.2.0
-
expandBoundingBox
public BoundingBox expandBoundingBox(BoundingBox webMercatorBoundingBox)
Create an expanded bounding box to handle features outside the tile that overlap- Parameters:
webMercatorBoundingBox- web mercator bounding box- Returns:
- bounding box
- Since:
- 3.2.0
-
expandBoundingBox
public BoundingBox expandBoundingBox(BoundingBox webMercatorBoundingBox, BoundingBox tileWebMercatorBoundingBox)
Create an expanded bounding box to handle features outside the tile that overlap- Parameters:
webMercatorBoundingBox- web mercator bounding boxtileWebMercatorBoundingBox- tile web mercator bounding box- Returns:
- bounding box
- Since:
- 3.2.0
-
drawTileQueryAll
public Bitmap drawTileQueryAll(int x, int y, int zoom)
Draw a tile bitmap from the x, y, and zoom level by querying all features. This could be very slow if there are a lot of features- Parameters:
x- x coordinatey- y coordinatezoom- zoom level- Returns:
- drawn bitmap, or null
-
createNewBitmap
protected Bitmap createNewBitmap()
Create a new empty Bitmap- Returns:
- bitmap
-
getWgs84ToWebMercatorTransform
protected ProjectionTransform getWgs84ToWebMercatorTransform()
Create a projection transformation from WGS84 to Web Mercator- Returns:
- transform
-
getProjectionToWebMercatorTransform
protected GeometryTransform getProjectionToWebMercatorTransform(Projection projection)
Create a projection transformation from provided projection to Web Mercator- Parameters:
projection- projection from- Returns:
- transform
-
simplifyPoints
protected List<Point> simplifyPoints(double simplifyTolerance, List<Point> points)
When the simplify tolerance is set, simplify the points to a similar curve with fewer points.- Parameters:
simplifyTolerance- simplify tolerance in meterspoints- ordered points- Returns:
- simplified points
- Since:
- 2.0.0
-
getFeatureStyle
protected FeatureStyle getFeatureStyle(FeatureRow featureRow)
Get the feature style for the feature row and geometry type- Parameters:
featureRow- feature row- Returns:
- feature style
-
getFeatureStyle
protected FeatureStyle getFeatureStyle(FeatureRow featureRow, GeometryType geometryType)
Get the feature style for the feature row and geometry type- Parameters:
featureRow- feature rowgeometryType- geometry type- Returns:
- feature style
-
getIcon
protected Bitmap getIcon(IconRow iconRow)
Get the icon bitmap from the icon row- Parameters:
iconRow- icon row- Returns:
- icon bitmap
-
getPointPaint
protected Paint getPointPaint(FeatureStyle featureStyle)
Get the point paint for the feature style, or return the default paint- Parameters:
featureStyle- feature style- Returns:
- paint
-
getLinePaint
protected Paint getLinePaint(FeatureStyle featureStyle)
Get the line paint for the feature style, or return the default paint- Parameters:
featureStyle- feature style- Returns:
- paint
-
getPolygonPaint
protected Paint getPolygonPaint(FeatureStyle featureStyle)
Get the polygon paint for the feature style, or return the default paint- Parameters:
featureStyle- feature style- Returns:
- paint
-
getPolygonFillPaint
protected Paint getPolygonFillPaint(FeatureStyle featureStyle)
Get the polygon fill paint for the feature style, or return the default paint- Parameters:
featureStyle- feature style- Returns:
- paint
-
isTransparent
protected boolean isTransparent(Bitmap bitmap)
Determine if the bitmap is a transparent image (must be in expected tile dimensions)- Parameters:
bitmap- bitmap- Returns:
- true if transparent
-
checkIfDrawn
protected Bitmap checkIfDrawn(Bitmap bitmap)
Check if the bitmap was drawn upon (non null and not transparent). Return the same bitmap if drawn, else recycle non null bitmaps and return null- Parameters:
bitmap- bitmap- Returns:
- drawn bitmap or null
-
drawTile
public abstract Bitmap drawTile(int zoom, BoundingBox webMercatorBoundingBox, FeatureIndexResults results)
Draw a tile bitmap from feature index results- Parameters:
zoom- zoom levelwebMercatorBoundingBox- web mercator bounding boxresults- feature index results- Returns:
- tile
- Since:
- 2.0.0
-
drawTile
public abstract Bitmap drawTile(int zoom, BoundingBox webMercatorBoundingBox, FeatureCursor cursor)
Draw a tile bitmap from feature geometries in the provided cursor- Parameters:
zoom- zoom levelwebMercatorBoundingBox- web mercator bounding boxcursor- feature cursor- Returns:
- tile
- Since:
- 2.0.0
-
drawTile
public abstract Bitmap drawTile(int zoom, BoundingBox webMercatorBoundingBox, List<FeatureRow> featureRow)
Draw a tile bitmap from the feature rows- Parameters:
zoom- zoom levelwebMercatorBoundingBox- web mercator bounding boxfeatureRow- feature row- Returns:
- tile
- Since:
- 2.0.0
-
-