public abstract class FeatureTiles extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Bitmap.CompressFormat |
compressFormat
Compress format
|
protected Context |
context
Context
|
protected FeatureDao |
featureDao
Tile data access object
|
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 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 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 height
|
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
|
| Modifier and Type | Method and Description |
|---|---|
void |
calculateDrawOverlap()
Call after making changes to the point icon, point radius, or paint stroke widths.
|
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
|
protected BoundingBox |
expandBoundingBox(BoundingBox webMercatorBoundingBox)
Create an expanded bounding box to handle features outside the tile that
overlap
|
Bitmap.CompressFormat |
getCompressFormat()
Get the compress format
|
FeatureDao |
getFeatureDao()
Get the feature DAO
|
float |
getHeightDrawOverlap()
Get the height draw overlap
|
FeatureIndexManager |
getIndexManager()
Get the index manager
|
Paint |
getLinePaint()
Get the line paint
|
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
|
float |
getPointRadius()
Get the point radius
|
Paint |
getPolygonFillPaint()
Get the polygon fill paint
|
Paint |
getPolygonPaint()
Get the polygon paint
|
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
|
boolean |
isFillPolygon()
Is fill polygon
|
boolean |
isIndexQuery()
Is index query
|
boolean |
isSimplifyGeometries()
Is the simplify geometries flag set? Default is true
|
FeatureIndexResults |
queryIndexedFeatures(BoundingBox webMercatorBoundingBox)
Query for feature results in the x, y, and zoom level by querying features in the tile location
|
long |
queryIndexedFeaturesCount(int x,
int y,
int zoom)
Draw a tile bitmap from the x, y, and zoom level by querying features in the tile location
|
void |
setCompressFormat(Bitmap.CompressFormat compressFormat)
Set the compress format
|
void |
setDrawOverlap(float pixels)
Manually set the width and height draw overlap
|
void |
setFillPolygon(boolean fillPolygon)
Set the fill polygon
|
void |
setHeightDrawOverlap(float pixels)
Manually set the height draw overlap
|
void |
setIndexManager(FeatureIndexManager indexManager)
Set the index
|
void |
setLinePaint(Paint linePaint)
Set the line paint
|
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 |
setPolygonFillPaint(Paint polygonFillPaint)
Set the polygon fill paint
|
void |
setPolygonPaint(Paint polygonPaint)
Set the polygon paint
|
void |
setSimplifyGeometries(boolean simplifyGeometries)
Set the simplify geometries flag
|
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 int tileWidth
protected int tileHeight
protected Bitmap.CompressFormat compressFormat
protected float pointRadius
protected Paint pointPaint
protected FeatureTilePointIcon pointIcon
protected Paint linePaint
protected Paint polygonPaint
protected boolean fillPolygon
protected Paint polygonFillPaint
protected float heightOverlap
protected float widthOverlap
protected Integer maxFeaturesPerTile
protected CustomFeaturesTile maxFeaturesTileDraw
protected boolean simplifyGeometries
public FeatureTiles(Context context, FeatureDao featureDao)
context - featureDao - public void close()
public void calculateDrawOverlap()
public void setDrawOverlap(float pixels)
pixels - public float getWidthDrawOverlap()
public void setWidthDrawOverlap(float pixels)
pixels - public float getHeightDrawOverlap()
public void setHeightDrawOverlap(float pixels)
pixels - public FeatureDao getFeatureDao()
public boolean isIndexQuery()
public FeatureIndexManager getIndexManager()
public void setIndexManager(FeatureIndexManager indexManager)
indexManager - public int getTileWidth()
public void setTileWidth(int tileWidth)
tileWidth - public int getTileHeight()
public void setTileHeight(int tileHeight)
tileHeight - public Bitmap.CompressFormat getCompressFormat()
public void setCompressFormat(Bitmap.CompressFormat compressFormat)
compressFormat - public float getPointRadius()
public void setPointRadius(float pointRadius)
pointRadius - public Paint getPointPaint()
public void setPointPaint(Paint pointPaint)
pointPaint - public FeatureTilePointIcon getPointIcon()
public void setPointIcon(FeatureTilePointIcon pointIcon)
pointIcon - public Paint getLinePaint()
public void setLinePaint(Paint linePaint)
linePaint - public Paint getPolygonPaint()
public void setPolygonPaint(Paint polygonPaint)
polygonPaint - public boolean isFillPolygon()
public void setFillPolygon(boolean fillPolygon)
fillPolygon - public Paint getPolygonFillPaint()
public void setPolygonFillPaint(Paint polygonFillPaint)
polygonFillPaint - public Integer getMaxFeaturesPerTile()
public void setMaxFeaturesPerTile(Integer maxFeaturesPerTile)
maxFeaturesPerTile - public CustomFeaturesTile getMaxFeaturesTileDraw()
CustomFeaturesTile,
custom features tile implementationpublic void setMaxFeaturesTileDraw(CustomFeaturesTile maxFeaturesTileDraw)
maxFeaturesTileDraw - CustomFeaturesTile,
custom features tile implementationpublic boolean isSimplifyGeometries()
public void setSimplifyGeometries(boolean simplifyGeometries)
simplifyGeometries - simplify geometries flagpublic byte[] drawTileBytes(int x,
int y,
int zoom)
x - y - zoom - public Bitmap drawTile(int x, int y, int zoom)
x - y - zoom - public Bitmap drawTileQueryIndex(int x, int y, int zoom)
x - y - zoom - public long queryIndexedFeaturesCount(int x,
int y,
int zoom)
x - y - zoom - public FeatureIndexResults queryIndexedFeatures(BoundingBox webMercatorBoundingBox)
webMercatorBoundingBox - protected BoundingBox expandBoundingBox(BoundingBox webMercatorBoundingBox)
webMercatorBoundingBox - public Bitmap drawTileQueryAll(int x, int y, int zoom)
x - y - zoom - protected 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 pointspublic abstract Bitmap drawTile(int zoom, BoundingBox webMercatorBoundingBox, FeatureIndexResults results)
zoom - zoom levelwebMercatorBoundingBox - results - public abstract Bitmap drawTile(int zoom, BoundingBox webMercatorBoundingBox, FeatureCursor cursor)
zoom - zoom levelwebMercatorBoundingBox - cursor - public abstract Bitmap drawTile(int zoom, BoundingBox webMercatorBoundingBox, List<FeatureRow> featureRow)
zoom - zoom levelwebMercatorBoundingBox - featureRow -