public abstract class FeatureTiles extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Bitmap.CompressFormat |
compressFormat
Compress format
|
protected Context |
context
Context
|
protected float |
density
Tile density based upon the device-independent pixels
TileUtils.TILE_DP |
protected FeatureDao |
featureDao
Tile data access object
|
protected FeatureTableStyles |
featureTableStyles
Feature Style extension
|
protected boolean |
fillPolygon
Fill polygon flag
|
protected float |
heightOverlap
Height overlapping pixels between tile images
|
protected FeatureIndexManager |
indexManager
When not null, features are retrieved using a feature index
|
protected Paint |
linePaint
Line paint
|
protected float |
lineStrokeWidth
Line stroke width
|
protected Integer |
maxFeaturesPerTile
Optional max features per tile.
|
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
|
protected FeatureTilePointIcon |
pointIcon
Optional point icon in place of a drawn circle
|
protected Paint |
pointPaint
Point paint
|
protected float |
pointRadius
Point radius
|
protected Paint |
polygonFillPaint
Polygon fill paint
|
protected Paint |
polygonPaint
Polygon paint
|
protected float |
polygonStrokeWidth
Polygon stroke width
|
protected mil.nga.sf.proj.Projection |
projection
Feature DAO Projection
|
protected boolean |
simplifyGeometries
When true, geometries are simplified before being drawn.
|
protected int |
tileHeight
Tile height
|
protected int |
tileWidth
Tile width
|
protected static mil.nga.sf.proj.Projection |
WEB_MERCATOR_PROJECTION
Web Mercator Projection
|
protected static mil.nga.sf.proj.Projection |
WGS_84_PROJECTION
WGS84 Projection
|
protected float |
widthOverlap
Width overlapping pixels between tile images
|
| Constructor and Description |
|---|
FeatureTiles(Context context,
FeatureDao featureDao)
Constructor
|
FeatureTiles(Context context,
FeatureDao featureDao,
float density)
Constructor
|
FeatureTiles(Context context,
FeatureDao featureDao,
int width,
int height)
Constructor
|
FeatureTiles(Context context,
GeoPackage geoPackage,
FeatureDao featureDao)
Constructor, auto creates the index manager for indexed tables and feature styles for styled tables
|
FeatureTiles(Context context,
GeoPackage geoPackage,
FeatureDao featureDao,
float density)
Constructor, auto creates the index manager for indexed tables and feature styles for styled tables
|
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
|
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
|
| Modifier and Type | Method and Description |
|---|---|
void |
calculateDrawOverlap()
Call after making changes to the point icon, point radius, or paint stroke widths.
|
protected Bitmap |
checkIfDrawn(Bitmap bitmap)
Check if the bitmap was drawn upon (non null and not transparent).
|
void |
clearCache()
Clear all caches
|
void |
clearIconCache()
Clear the icon cache
|
void |
clearStylePaintCache()
Clear the style paint cache
|
void |
close()
Close the feature tiles connection
|
protected Bitmap |
createNewBitmap()
Create a new empty Bitmap
|
abstract Bitmap |
drawTile(int zoom,
BoundingBox webMercatorBoundingBox,
FeatureCursor cursor)
Draw a tile bitmap from feature geometries in the provided cursor
|
abstract Bitmap |
drawTile(int zoom,
BoundingBox webMercatorBoundingBox,
FeatureIndexResults results)
Draw a tile bitmap from feature index results
|
abstract Bitmap |
drawTile(int zoom,
BoundingBox webMercatorBoundingBox,
List<FeatureRow> featureRow)
Draw a tile bitmap from the feature rows
|
Bitmap |
drawTile(int x,
int y,
int zoom)
Draw a tile bitmap from the x, y, and zoom level
|
byte[] |
drawTileBytes(int x,
int y,
int zoom)
Draw the tile and get the bytes from the x, y, and zoom level
|
Bitmap |
drawTileQueryAll(int x,
int y,
int zoom)
Draw a tile bitmap from the x, y, and zoom level by querying all features.
|
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
|
BoundingBox |
expandBoundingBox(BoundingBox webMercatorBoundingBox)
Create an expanded bounding box to handle features outside the tile that
overlap
|
BoundingBox |
expandBoundingBox(BoundingBox webMercatorBoundingBox,
BoundingBox tileWebMercatorBoundingBox)
Create an expanded bounding box to handle features outside the tile that
overlap
|
BoundingBox |
expandBoundingBox(BoundingBox boundingBox,
mil.nga.sf.proj.Projection projection)
Create an expanded bounding box to handle features outside the tile that
overlap
|
Bitmap.CompressFormat |
getCompressFormat()
Get the compress format
|
float |
getDensity()
Get the density
|
FeatureDao |
getFeatureDao()
Get the feature DAO
|
protected FeatureStyle |
getFeatureStyle(FeatureRow featureRow)
Get the feature style for the feature row and geometry type
|
protected FeatureStyle |
getFeatureStyle(FeatureRow featureRow,
mil.nga.sf.GeometryType geometryType)
Get the feature style for the feature row and geometry type
|
FeatureTableStyles |
getFeatureTableStyles()
Get the feature table styles
|
float |
getHeightDrawOverlap()
Get the height draw overlap
|
protected Bitmap |
getIcon(IconRow iconRow)
Get the icon bitmap from the icon row
|
FeatureIndexManager |
getIndexManager()
Get the index manager
|
int |
getLineAlpha()
Get line alpha
|
int |
getLineColor()
Get line color
|
protected Paint |
getLinePaint(FeatureStyle featureStyle)
Get the line paint for the feature style, or return the default paint
|
Paint |
getLinePaintCopy()
Get a copy of the line paint, must call
setLinePaint(Paint) to update the paint |
float |
getLineStrokeWidth()
Get line stroke width
|
Integer |
getMaxFeaturesPerTile()
Get the max features per tile
|
CustomFeaturesTile |
getMaxFeaturesTileDraw()
Get the max features tile draw, the custom tile drawing implementation for tiles with more
features than the max at #getMaxFeaturesPerTile
|
FeatureTilePointIcon |
getPointIcon()
Get the point icon
|
Paint |
getPointPaint()
Get point paint
|
protected Paint |
getPointPaint(FeatureStyle featureStyle)
Get the point paint for the feature style, or return the default paint
|
float |
getPointRadius()
Get the point radius
|
int |
getPolygonAlpha()
Get polygon alpha
|
int |
getPolygonColor()
Get polygon color
|
int |
getPolygonFillAlpha()
Get polygon fill alpha
|
int |
getPolygonFillColor()
Get polygon fill color
|
protected Paint |
getPolygonFillPaint(FeatureStyle featureStyle)
Get the polygon fill paint for the feature style, or return the default paint
|
Paint |
getPolygonFillPaintCopy()
Get the polygon fill paint
|
protected Paint |
getPolygonPaint(FeatureStyle featureStyle)
Get the polygon paint for the feature style, or return the default paint
|
Paint |
getPolygonPaintCopy()
Get a copy of the polygon paint, must call
setPolygonPaint(Paint) to update the paint |
float |
getPolygonStrokeWidth()
Get polygon stroke width
|
protected mil.nga.sf.proj.ProjectionTransform |
getProjectionToWebMercatorTransform(mil.nga.sf.proj.Projection projection)
Create a projection transformation from provided projection to Web Mercator
|
int |
getTileHeight()
Get the tile height
|
int |
getTileWidth()
Get the tile width
|
protected mil.nga.sf.proj.ProjectionTransform |
getWgs84ToWebMercatorTransform()
Create a projection transformation from WGS84 to Web Mercator
|
float |
getWidthDrawOverlap()
Get the width draw overlap
|
void |
ignoreFeatureTableStyles()
Ignore the feature table styles within the GeoPackage
|
boolean |
isFillPolygon()
Is fill polygon
|
boolean |
isIndexQuery()
Is index query
|
boolean |
isSimplifyGeometries()
Is the simplify geometries flag set? Default is true
|
protected boolean |
isTransparent(Bitmap bitmap)
Determine if the bitmap is a transparent image (must be in expected tile dimensions)
|
FeatureIndexResults |
queryIndexedFeatures(BoundingBox webMercatorBoundingBox)
Query for feature results in the bounding box
|
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
|
long |
queryIndexedFeaturesCount(BoundingBox webMercatorBoundingBox)
Query for feature result count in the bounding box
|
long |
queryIndexedFeaturesCount(int x,
int y,
int zoom)
Query for feature result count in the x, y, and zoom
|
void |
setCompressFormat(Bitmap.CompressFormat compressFormat)
Set the compress format
|
void |
setDensity(float density)
Set the density
|
void |
setDrawOverlap(float pixels)
Manually set the width and height draw overlap
|
void |
setFeatureTableStyles(FeatureTableStyles featureTableStyles)
Set the feature table styles
|
void |
setFillPolygon(boolean fillPolygon)
Set the fill polygon
|
void |
setHeightDrawOverlap(float pixels)
Manually set the height draw overlap
|
void |
setIconCacheSize(int size)
Set / resize the icon cache size
|
void |
setIndexManager(FeatureIndexManager indexManager)
Set the index
|
void |
setLineAlpha(int lineAlpha)
Set line alpha
|
void |
setLineColor(int lineColor)
Set line color
|
void |
setLinePaint(Paint linePaint)
Set the line paint
|
void |
setLineStrokeWidth(float lineStrokeWidth)
Set line stroke width
|
void |
setMaxFeaturesPerTile(Integer maxFeaturesPerTile)
Set the max features per tile.
|
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
|
void |
setPointIcon(FeatureTilePointIcon pointIcon)
Set the point icon
|
void |
setPointPaint(Paint pointPaint)
Set the point paint
|
void |
setPointRadius(float pointRadius)
Set the point radius
|
void |
setPolygonAlpha(int polygonAlpha)
Set polygon alpha
|
void |
setPolygonColor(int polygonColor)
Set polygon color
|
void |
setPolygonFillAlpha(int polygonFillAlpha)
Set polygon fill alpha
|
void |
setPolygonFillColor(int polygonFillColor)
Set polygon fill color
|
void |
setPolygonFillPaint(Paint polygonFillPaint)
Set the polygon fill paint
|
void |
setPolygonPaint(Paint polygonPaint)
Set the polygon paint
|
void |
setPolygonStrokeWidth(float polygonStrokeWidth)
Set polygon stroke width
|
void |
setSimplifyGeometries(boolean simplifyGeometries)
Set the simplify geometries flag
|
void |
setStylePaintCacheSize(int size)
Set / resize the style paint cache size
|
void |
setTileHeight(int tileHeight)
Set the tile height
|
void |
setTileWidth(int tileWidth)
Set the tile width
|
void |
setWidthDrawOverlap(float pixels)
Manually set the width draw overlap
|
protected List<mil.nga.sf.Point> |
simplifyPoints(double simplifyTolerance,
List<mil.nga.sf.Point> points)
When the simplify tolerance is set, simplify the points to a similar
curve with fewer points.
|
protected static final mil.nga.sf.proj.Projection WGS_84_PROJECTION
protected static final mil.nga.sf.proj.Projection WEB_MERCATOR_PROJECTION
protected final Context context
protected final FeatureDao featureDao
protected mil.nga.sf.proj.Projection projection
protected FeatureIndexManager indexManager
protected FeatureTableStyles featureTableStyles
protected int tileWidth
protected int tileHeight
protected Bitmap.CompressFormat compressFormat
protected float pointRadius
protected Paint pointPaint
protected FeatureTilePointIcon pointIcon
protected Paint linePaint
protected float lineStrokeWidth
protected Paint polygonPaint
protected float polygonStrokeWidth
protected boolean fillPolygon
protected Paint polygonFillPaint
protected float heightOverlap
protected float widthOverlap
protected Integer maxFeaturesPerTile
protected CustomFeaturesTile maxFeaturesTileDraw
protected boolean simplifyGeometries
protected float density
TileUtils.TILE_DPpublic FeatureTiles(Context context, FeatureDao featureDao)
context - contextfeatureDao - feature daopublic FeatureTiles(Context context, FeatureDao featureDao, float density)
context - contextfeatureDao - feature daodensity - display density: DisplayMetrics.densitypublic FeatureTiles(Context context, FeatureDao featureDao, int width, int height)
context - contextfeatureDao - feature daowidth - drawn tile widthheight - drawn tile heightpublic FeatureTiles(Context context, GeoPackage geoPackage, FeatureDao featureDao)
context - contextgeoPackage - GeoPackagefeatureDao - feature daopublic FeatureTiles(Context context, GeoPackage geoPackage, FeatureDao featureDao, float density)
context - contextgeoPackage - GeoPackagefeatureDao - feature daodensity - display density: DisplayMetrics.densitypublic FeatureTiles(Context context, GeoPackage geoPackage, FeatureDao featureDao, int width, int height)
context - contextgeoPackage - GeoPackagefeatureDao - feature daowidth - drawn tile widthheight - drawn tile heightpublic FeatureTiles(Context context, GeoPackage geoPackage, FeatureDao featureDao, float density, int width, int height)
context - contextgeoPackage - GeoPackagefeatureDao - feature daodensity - display density: DisplayMetrics.densitywidth - drawn tile widthheight - drawn tile heightpublic void close()
public void calculateDrawOverlap()
public void setDensity(float density)
density - densitypublic float getDensity()
public void setDrawOverlap(float pixels)
pixels - overlap pixelspublic float getWidthDrawOverlap()
public void setWidthDrawOverlap(float pixels)
pixels - overlap pixelspublic float getHeightDrawOverlap()
public void setHeightDrawOverlap(float pixels)
pixels - overlap pixelspublic FeatureDao getFeatureDao()
public boolean isIndexQuery()
public FeatureIndexManager getIndexManager()
public void setIndexManager(FeatureIndexManager indexManager)
indexManager - index managerpublic FeatureTableStyles getFeatureTableStyles()
public void setFeatureTableStyles(FeatureTableStyles featureTableStyles)
featureTableStyles - feature table stylespublic void ignoreFeatureTableStyles()
public void clearCache()
public void clearStylePaintCache()
public void setStylePaintCacheSize(int size)
size - new sizepublic void clearIconCache()
public void setIconCacheSize(int size)
size - new sizepublic int getTileWidth()
public void setTileWidth(int tileWidth)
tileWidth - tile widthpublic int getTileHeight()
public void setTileHeight(int tileHeight)
tileHeight - tile heightpublic Bitmap.CompressFormat getCompressFormat()
public void setCompressFormat(Bitmap.CompressFormat compressFormat)
compressFormat - compress formatpublic float getPointRadius()
public void setPointRadius(float pointRadius)
pointRadius - point radiuspublic Paint getPointPaint()
public void setPointPaint(Paint pointPaint)
pointPaint - point paintpublic FeatureTilePointIcon getPointIcon()
public void setPointIcon(FeatureTilePointIcon pointIcon)
pointIcon - point iconpublic Paint getLinePaintCopy()
setLinePaint(Paint) to update the paintpublic void setLinePaint(Paint linePaint)
linePaint - line paintpublic float getLineStrokeWidth()
public void setLineStrokeWidth(float lineStrokeWidth)
lineStrokeWidth - line stroke widthpublic int getLineColor()
public void setLineColor(int lineColor)
lineColor - line colorpublic int getLineAlpha()
public void setLineAlpha(int lineAlpha)
lineAlpha - line alphapublic Paint getPolygonPaintCopy()
setPolygonPaint(Paint) to update the paintpublic void setPolygonPaint(Paint polygonPaint)
polygonPaint - polygon paintpublic float getPolygonStrokeWidth()
public void setPolygonStrokeWidth(float polygonStrokeWidth)
polygonStrokeWidth - polygon stroke widthpublic int getPolygonColor()
public void setPolygonColor(int polygonColor)
polygonColor - polygon colorpublic int getPolygonAlpha()
public void setPolygonAlpha(int polygonAlpha)
polygonAlpha - polygon alphapublic boolean isFillPolygon()
public void setFillPolygon(boolean fillPolygon)
fillPolygon - fill polygonpublic Paint getPolygonFillPaintCopy()
public void setPolygonFillPaint(Paint polygonFillPaint)
polygonFillPaint - polygon fill paintpublic int getPolygonFillColor()
public void setPolygonFillColor(int polygonFillColor)
polygonFillColor - polygon fill colorpublic int getPolygonFillAlpha()
public void setPolygonFillAlpha(int polygonFillAlpha)
polygonFillAlpha - polygon fill alphapublic Integer getMaxFeaturesPerTile()
public void setMaxFeaturesPerTile(Integer maxFeaturesPerTile)
maxFeaturesPerTile - max features per tilepublic CustomFeaturesTile getMaxFeaturesTileDraw()
CustomFeaturesTile,
custom features tile implementationpublic void setMaxFeaturesTileDraw(CustomFeaturesTile maxFeaturesTileDraw)
maxFeaturesTileDraw - max features tile drawCustomFeaturesTile,
custom features tile implementationpublic boolean isSimplifyGeometries()
public void setSimplifyGeometries(boolean simplifyGeometries)
simplifyGeometries - simplify geometries flagpublic byte[] drawTileBytes(int x,
int y,
int zoom)
x - x coordinatey - y coordinatezoom - zoom levelpublic Bitmap drawTile(int x, int y, int zoom)
x - x coordinatey - y coordinatezoom - zoom levelpublic Bitmap drawTileQueryIndex(int x, int y, int zoom)
x - x coordinatey - y coordinatezoom - zoom levelpublic long queryIndexedFeaturesCount(int x,
int y,
int zoom)
x - x coordinatey - y coordinatezoom - zoom levelpublic long queryIndexedFeaturesCount(BoundingBox webMercatorBoundingBox)
webMercatorBoundingBox - web mercator bounding boxpublic FeatureIndexResults queryIndexedFeatures(int x, int y, int zoom)
x - x coordinatey - y coordinatezoom - zoom levelpublic FeatureIndexResults queryIndexedFeatures(BoundingBox webMercatorBoundingBox)
webMercatorBoundingBox - web mercator bounding boxpublic BoundingBox expandBoundingBox(BoundingBox boundingBox, mil.nga.sf.proj.Projection projection)
boundingBox - bounding boxprojection - bounding box projectionpublic BoundingBox expandBoundingBox(BoundingBox webMercatorBoundingBox)
webMercatorBoundingBox - web mercator bounding boxpublic BoundingBox expandBoundingBox(BoundingBox webMercatorBoundingBox, BoundingBox tileWebMercatorBoundingBox)
webMercatorBoundingBox - web mercator bounding boxtileWebMercatorBoundingBox - tile web mercator bounding boxpublic Bitmap drawTileQueryAll(int x, int y, int zoom)
x - x coordinatey - y coordinatezoom - zoom levelprotected Bitmap createNewBitmap()
protected mil.nga.sf.proj.ProjectionTransform getWgs84ToWebMercatorTransform()
protected mil.nga.sf.proj.ProjectionTransform getProjectionToWebMercatorTransform(mil.nga.sf.proj.Projection projection)
projection - projection fromprotected List<mil.nga.sf.Point> simplifyPoints(double simplifyTolerance, List<mil.nga.sf.Point> points)
simplifyTolerance - simplify tolerance in meterspoints - ordered pointsprotected FeatureStyle getFeatureStyle(FeatureRow featureRow)
featureRow - feature rowprotected FeatureStyle getFeatureStyle(FeatureRow featureRow, mil.nga.sf.GeometryType geometryType)
featureRow - feature rowgeometryType - geometry typeprotected Bitmap getIcon(IconRow iconRow)
iconRow - icon rowprotected Paint getPointPaint(FeatureStyle featureStyle)
featureStyle - feature styleprotected Paint getLinePaint(FeatureStyle featureStyle)
featureStyle - feature styleprotected Paint getPolygonPaint(FeatureStyle featureStyle)
featureStyle - feature styleprotected Paint getPolygonFillPaint(FeatureStyle featureStyle)
featureStyle - feature styleprotected boolean isTransparent(Bitmap bitmap)
bitmap - bitmapprotected Bitmap checkIfDrawn(Bitmap bitmap)
bitmap - bitmappublic abstract Bitmap drawTile(int zoom, BoundingBox webMercatorBoundingBox, FeatureIndexResults results)
zoom - zoom levelwebMercatorBoundingBox - web mercator bounding boxresults - feature index resultspublic abstract Bitmap drawTile(int zoom, BoundingBox webMercatorBoundingBox, FeatureCursor cursor)
zoom - zoom levelwebMercatorBoundingBox - web mercator bounding boxcursor - feature cursorpublic abstract Bitmap drawTile(int zoom, BoundingBox webMercatorBoundingBox, List<FeatureRow> featureRow)
zoom - zoom levelwebMercatorBoundingBox - web mercator bounding boxfeatureRow - feature row