Class FeatureTiles
- java.lang.Object
-
- mil.nga.geopackage.tiles.features.FeatureTiles
-
- Direct Known Subclasses:
DefaultFeatureTiles
public abstract class FeatureTiles extends Object
Tiles generated from features- Since:
- 1.1.2
- Author:
- osbornb
-
-
Field Summary
Fields Modifier and Type Field Description protected StringcompressFormatCompress formatprotected FeatureDaofeatureDaoTile data access objectprotected FeatureTableStylesfeatureTableStylesFeature Style extensionprotected booleanfillPolygonFill polygon flagprotected booleangeodesicDraw geometries using geodesic linesprotected 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 floatscaleScale factorprotected booleansimplifyGeometriesWhen true, geometries are simplified before being drawn.protected inttileHeightTile heightprotected inttileWidthTile heightprotected static ProjectionWEB_MERCATOR_PROJECTIONWeb Mercator Projectionprotected floatwidthOverlapWidth overlapping pixels between tile images
-
Constructor Summary
Constructors Constructor Description FeatureTiles(FeatureDao featureDao)ConstructorFeatureTiles(FeatureDao featureDao, boolean geodesic)ConstructorFeatureTiles(FeatureDao featureDao, float scale)ConstructorFeatureTiles(FeatureDao featureDao, float scale, boolean geodesic)ConstructorFeatureTiles(FeatureDao featureDao, int width, int height)ConstructorFeatureTiles(FeatureDao featureDao, int width, int height, boolean geodesic)ConstructorFeatureTiles(GeoPackage geoPackage, FeatureDao featureDao)Constructor, auto creates the index manager for indexed tables and feature styles for styled tablesFeatureTiles(GeoPackage geoPackage, FeatureDao featureDao, boolean geodesic)Constructor, auto creates the index manager for indexed tables and feature styles for styled tablesFeatureTiles(GeoPackage geoPackage, FeatureDao featureDao, float scale)Constructor, auto creates the index manager for indexed tables and feature styles for styled tablesFeatureTiles(GeoPackage geoPackage, FeatureDao featureDao, float scale, boolean geodesic)Constructor, auto creates the index manager for indexed tables and feature styles for styled tablesFeatureTiles(GeoPackage geoPackage, FeatureDao featureDao, float scale, int width, int height)Constructor, auto creates the index manager for indexed tables and feature styles for styled tablesFeatureTiles(GeoPackage geoPackage, FeatureDao featureDao, float scale, int width, int height, boolean geodesic)Constructor, auto creates the index manager for indexed tables and feature styles for styled tablesFeatureTiles(GeoPackage geoPackage, FeatureDao featureDao, int width, int height)Constructor, auto creates the index manager for indexed tables and feature styles for styled tablesFeatureTiles(GeoPackage geoPackage, FeatureDao featureDao, int width, int height, boolean geodesic)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.PixelBoundscalculateStylePixelBounds()Calculate style pixel boundsPixelBoundscalculateStylePixelBounds(float scale)Calculate style pixel boundsprotected BufferedImagecheckIfDrawn(BufferedImage image)Check if the image 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 BufferedImagecreateNewImage()Create a new empty imageBufferedImagedrawTile(int x, int y, int zoom)Draw a tile image from the x, y, and zoom levelabstract BufferedImagedrawTile(int zoom, BoundingBox webMercatorBoundingBox, List<FeatureRow> featureRow)Draw a tile image from the feature rowsabstract BufferedImagedrawTile(int zoom, BoundingBox webMercatorBoundingBox, FeatureIndexResults results)Draw a tile image from geometry index resultsabstract BufferedImagedrawTile(int zoom, BoundingBox webMercatorBoundingBox, FeatureResultSet resultSet)Draw a tile image from feature geometries in the provided result setbyte[]drawTileBytes(int x, int y, int zoom)Draw the tile and get the bytes from the x, y, and zoom levelBufferedImagedrawTileQueryAll(int x, int y, int zoom)Draw a tile image from the x, y, and zoom level by querying all features.BufferedImagedrawTileQueryIndex(int x, int y, int zoom)Draw a tile image 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 overlapprotected List<Point>geodesicPath(double maxDistance, List<Point> points)When geodesic is enabled, create a geodesic path of pointsStringgetCompressFormat()Get the compress formatFeatureDaogetFeatureDao()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 stylesprotected Graphics2DgetGraphics(BufferedImage image)Get a graphics for the imagefloatgetHeightDrawOverlap()Get the height draw overlapprotected BufferedImagegetIcon(IconRow iconRow)Get the icon image from the icon rowFeatureIndexManagergetIndexManager()Get the index managerColorgetLineColor()Get line colorprotected PaintgetLinePaint(FeatureStyle featureStyle)Get the line paint for the feature style, or return the default 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 #getMaxFeaturesPerTileColorgetPointColor()Get point colorFeatureTilePointIcongetPointIcon()Get the point iconprotected PaintgetPointPaint(FeatureStyle featureStyle)Get the point paint for the feature style, or return the default paintfloatgetPointRadius()Get the point radiusColorgetPolygonColor()Get polygon colorColorgetPolygonFillColor()Get polygon fill colorprotected PaintgetPolygonFillPaint(FeatureStyle featureStyle)Get the polygon fill paint for the feature style, or return the default paintprotected PaintgetPolygonPaint(FeatureStyle featureStyle)Get the polygon paint for the feature style, or return the default paintfloatgetPolygonStrokeWidth()Get polygon stroke widthfloatgetScale()Get the scaleintgetTileHeight()Get the tile heightintgetTileWidth()Get the tile widthprotected GeometryTransformgetWebMercatorTransform()Create a geometry transformation from the feature dao projection to Web MercatorfloatgetWidthDrawOverlap()Get the width draw overlapvoidignoreFeatureTableStyles()Ignore the feature table styles within the GeoPackagebooleanisFillPolygon()Is fill polygonbooleanisGeodesic()Are geometries drawn using geodesic lines? Default is falsebooleanisIndexQuery()Is index querybooleanisSimplifyGeometries()Is the simplify geometries flag set? Default is trueprotected booleanisTransparent(BufferedImage image)Determine if the image is transparentFeatureIndexResultsqueryIndexedFeatures(int x, int y, int zoom)Query for feature results in the x, y, and zoomFeatureIndexResultsqueryIndexedFeatures(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(String compressFormat)Set the compress formatvoidsetDrawOverlap(float pixels)Manually set the width and height draw overlapvoidsetFeatureTableStyles(FeatureTableStyles featureTableStyles)Set the feature table stylesvoidsetFillPolygon(boolean fillPolygon)Set the fill polygonvoidsetGeodesic(boolean geodesic)Set the geodestic flag, true to draw geodesic geometriesvoidsetHeightDrawOverlap(float pixels)Manually set the height draw overlapvoidsetIconCacheSize(int size)Set / resize the icon cache sizevoidsetIndexManager(FeatureIndexManager indexManager)Set the indexvoidsetLineColor(Color lineColor)Set line colorvoidsetLineStrokeWidth(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 existvoidsetPointColor(Color pointColor)Set point colorvoidsetPointIcon(FeatureTilePointIcon pointIcon)Set the point iconvoidsetPointRadius(float pointRadius)Set the point radiusvoidsetPolygonColor(Color polygonColor)Set polygon colorvoidsetPolygonFillColor(Color polygonFillColor)Set polygon fill colorvoidsetPolygonStrokeWidth(float polygonStrokeWidth)Set polygon stroke widthvoidsetScale(float scale)Set the scalevoidsetSimplifyGeometries(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
-
WEB_MERCATOR_PROJECTION
protected static final Projection WEB_MERCATOR_PROJECTION
Web Mercator Projection
-
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 height
-
tileHeight
protected int tileHeight
Tile height
-
compressFormat
protected String 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
-
geodesic
protected boolean geodesic
Draw geometries using geodesic lines
-
scale
protected float scale
Scale factor
-
-
Constructor Detail
-
FeatureTiles
public FeatureTiles(FeatureDao featureDao)
Constructor- Parameters:
featureDao- feature dao
-
FeatureTiles
public FeatureTiles(FeatureDao featureDao, boolean geodesic)
Constructor- Parameters:
featureDao- feature daogeodesic- draw geometries using geodesic lines- Since:
- 6.6.5
-
FeatureTiles
public FeatureTiles(FeatureDao featureDao, float scale)
Constructor- Parameters:
featureDao- feature daoscale- scale factor- Since:
- 3.2.0
-
FeatureTiles
public FeatureTiles(FeatureDao featureDao, float scale, boolean geodesic)
Constructor- Parameters:
featureDao- feature daoscale- scale factorgeodesic- draw geometries using geodesic lines- Since:
- 6.6.5
-
FeatureTiles
public FeatureTiles(FeatureDao featureDao, int width, int height)
Constructor- Parameters:
featureDao- feature daowidth- drawn tile widthheight- drawn tile height- Since:
- 3.2.0
-
FeatureTiles
public FeatureTiles(FeatureDao featureDao, int width, int height, boolean geodesic)
Constructor- Parameters:
featureDao- feature daowidth- drawn tile widthheight- drawn tile heightgeodesic- draw geometries using geodesic lines- Since:
- 6.6.5
-
FeatureTiles
public FeatureTiles(GeoPackage geoPackage, FeatureDao featureDao)
Constructor, auto creates the index manager for indexed tables and feature styles for styled tables- Parameters:
geoPackage- GeoPackagefeatureDao- feature dao- Since:
- 3.2.0
-
FeatureTiles
public FeatureTiles(GeoPackage geoPackage, FeatureDao featureDao, boolean geodesic)
Constructor, auto creates the index manager for indexed tables and feature styles for styled tables- Parameters:
geoPackage- GeoPackagefeatureDao- feature daogeodesic- draw geometries using geodesic lines- Since:
- 6.6.5
-
FeatureTiles
public FeatureTiles(GeoPackage geoPackage, FeatureDao featureDao, float scale)
Constructor, auto creates the index manager for indexed tables and feature styles for styled tables- Parameters:
geoPackage- GeoPackagefeatureDao- feature daoscale- scale factor- Since:
- 3.2.0
-
FeatureTiles
public FeatureTiles(GeoPackage geoPackage, FeatureDao featureDao, float scale, boolean geodesic)
Constructor, auto creates the index manager for indexed tables and feature styles for styled tables- Parameters:
geoPackage- GeoPackagefeatureDao- feature daoscale- scale factorgeodesic- draw geometries using geodesic lines- Since:
- 6.6.5
-
FeatureTiles
public FeatureTiles(GeoPackage geoPackage, FeatureDao featureDao, int width, int height)
Constructor, auto creates the index manager for indexed tables and feature styles for styled tables- Parameters:
geoPackage- GeoPackagefeatureDao- feature daowidth- drawn tile widthheight- drawn tile height- Since:
- 3.2.0
-
FeatureTiles
public FeatureTiles(GeoPackage geoPackage, FeatureDao featureDao, int width, int height, boolean geodesic)
Constructor, auto creates the index manager for indexed tables and feature styles for styled tables- Parameters:
geoPackage- GeoPackagefeatureDao- feature daowidth- drawn tile widthheight- drawn tile heightgeodesic- draw geometries using geodesic lines- Since:
- 6.6.5
-
FeatureTiles
public FeatureTiles(GeoPackage geoPackage, FeatureDao featureDao, float scale, int width, int height)
Constructor, auto creates the index manager for indexed tables and feature styles for styled tables- Parameters:
geoPackage- GeoPackagefeatureDao- feature daoscale- scale factorwidth- drawn tile widthheight- drawn tile height- Since:
- 3.2.0
-
FeatureTiles
public FeatureTiles(GeoPackage geoPackage, FeatureDao featureDao, float scale, int width, int height, boolean geodesic)
Constructor, auto creates the index manager for indexed tables and feature styles for styled tables- Parameters:
geoPackage- GeoPackagefeatureDao- feature daoscale- scale factorwidth- drawn tile widthheight- drawn tile heightgeodesic- draw geometries using geodesic lines- Since:
- 6.6.5
-
-
Method Detail
-
close
public void close()
Close the feature tiles connection- Since:
- 6.1.2
-
calculateDrawOverlap
public void calculateDrawOverlap()
Call after making changes to the point icon, point radius, or paint stroke widths. Determines the pixel overlap between tiles
-
setScale
public void setScale(float scale)
Set the scale- Parameters:
scale- scale factor- Since:
- 3.2.0
-
getScale
public float getScale()
Get the scale- Returns:
- scale factor
- Since:
- 3.2.0
-
setDrawOverlap
public void setDrawOverlap(float pixels)
Manually set the width and height draw overlap- Parameters:
pixels- pixels
-
getWidthDrawOverlap
public float getWidthDrawOverlap()
Get the width draw overlap- Returns:
- width draw overlap
-
setWidthDrawOverlap
public void setWidthDrawOverlap(float pixels)
Manually set the width draw overlap- Parameters:
pixels- pixels
-
getHeightDrawOverlap
public float getHeightDrawOverlap()
Get the height draw overlap- Returns:
- height draw overlap
-
setHeightDrawOverlap
public void setHeightDrawOverlap(float pixels)
Manually set the height draw overlap- Parameters:
pixels- 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:
- 6.1.2
-
setIndexManager
public void setIndexManager(FeatureIndexManager indexManager)
Set the index- Parameters:
indexManager- index manager- Since:
- 6.1.2
-
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.3.0
-
setStylePaintCacheSize
public void setStylePaintCacheSize(int size)
Set / resize the style paint cache size- Parameters:
size- new size- Since:
- 3.3.0
-
clearIconCache
public void clearIconCache()
Clear the icon cache- Since:
- 3.3.0
-
setIconCacheSize
public void setIconCacheSize(int size)
Set / resize the icon cache size- Parameters:
size- new size- Since:
- 3.3.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 String getCompressFormat()
Get the compress format- Returns:
- compress format
-
setCompressFormat
public void setCompressFormat(String compressFormat)
Set the compress format- Parameters:
compressFormat- compress format
-
getPointRadius
public float getPointRadius()
Get the point radius- Returns:
- radius
-
setPointRadius
public void setPointRadius(float pointRadius)
Set the point radius- Parameters:
pointRadius- point radius
-
getPointColor
public Color getPointColor()
Get point color- Returns:
- color
-
setPointColor
public void setPointColor(Color pointColor)
Set point color- Parameters:
pointColor- point color
-
getPointIcon
public FeatureTilePointIcon getPointIcon()
Get the point icon- Returns:
- icon
-
setPointIcon
public void setPointIcon(FeatureTilePointIcon pointIcon)
Set the point icon- Parameters:
pointIcon- point icon
-
getLineStrokeWidth
public float getLineStrokeWidth()
Get line stroke width- Returns:
- width
-
setLineStrokeWidth
public void setLineStrokeWidth(float lineStrokeWidth)
Set line stroke width- Parameters:
lineStrokeWidth- line stroke width
-
getLineColor
public Color getLineColor()
Get line color- Returns:
- color
-
setLineColor
public void setLineColor(Color lineColor)
Set line color- Parameters:
lineColor- line color
-
getPolygonStrokeWidth
public float getPolygonStrokeWidth()
Get polygon stroke width- Returns:
- width
-
setPolygonStrokeWidth
public void setPolygonStrokeWidth(float polygonStrokeWidth)
Set polygon stroke width- Parameters:
polygonStrokeWidth- polygon stroke width
-
getPolygonColor
public Color getPolygonColor()
Get polygon color- Returns:
- color
-
setPolygonColor
public void setPolygonColor(Color polygonColor)
Set polygon color- Parameters:
polygonColor- polygon color
-
isFillPolygon
public boolean isFillPolygon()
Is fill polygon- Returns:
- true if fill polygon
-
setFillPolygon
public void setFillPolygon(boolean fillPolygon)
Set the fill polygon- Parameters:
fillPolygon- fill polygon
-
getPolygonFillColor
public Color getPolygonFillColor()
Get polygon fill color- Returns:
- color
-
setPolygonFillColor
public void setPolygonFillColor(Color polygonFillColor)
Set polygon fill color- Parameters:
polygonFillColor- polygon fill color
-
getMaxFeaturesPerTile
public Integer getMaxFeaturesPerTile()
Get the max features per tile- Returns:
- max features per tile or null
-
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
-
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
- 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- 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
-
isGeodesic
public boolean isGeodesic()
Are geometries drawn using geodesic lines? Default is false- Returns:
- geodesic flag
- Since:
- 6.6.5
-
setGeodesic
public void setGeodesic(boolean geodesic)
Set the geodestic flag, true to draw geodesic geometries- Parameters:
geodesic- draw geodesic geometries flag- Since:
- 6.6.5
-
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 BufferedImage drawTile(int x, int y, int zoom)
Draw a tile image from the x, y, and zoom level- Parameters:
x- x coordinatey- y coordinatezoom- zoom level- Returns:
- tile image, or null
-
drawTileQueryIndex
public BufferedImage drawTileQueryIndex(int x, int y, int zoom)
Draw a tile image from the x, y, and zoom level by querying features in the tile location- Parameters:
x- x coordinatey- y coordinatezoom- zoom level- Returns:
- drawn image, 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
-
queryIndexedFeaturesCount
public long queryIndexedFeaturesCount(BoundingBox webMercatorBoundingBox)
Query for feature result count in the bounding box- Parameters:
webMercatorBoundingBox- web mercator bounding box- Returns:
- count
-
queryIndexedFeatures
public FeatureIndexResults queryIndexedFeatures(int x, int y, int zoom)
Query for feature results in the x, y, and zoom- Parameters:
x- x coordinatey- y coordinatezoom- zoom level- Returns:
- feature count
- Since:
- 6.1.2
-
queryIndexedFeatures
public FeatureIndexResults queryIndexedFeatures(BoundingBox webMercatorBoundingBox)
Query for feature results in the bounding box- Parameters:
webMercatorBoundingBox- web mercator bounding box- Returns:
- geometry index results
- Since:
- 6.1.2
-
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 BufferedImage drawTileQueryAll(int x, int y, int zoom)
Draw a tile image 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 image, or null
-
createNewImage
protected BufferedImage createNewImage()
Create a new empty image- Returns:
- image
-
getGraphics
protected Graphics2D getGraphics(BufferedImage image)
Get a graphics for the image- Parameters:
image- buffered image- Returns:
- graphics
-
getWebMercatorTransform
protected GeometryTransform getWebMercatorTransform()
Create a geometry transformation from the feature dao projection to Web Mercator- 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
-
geodesicPath
protected List<Point> geodesicPath(double maxDistance, List<Point> points)
When geodesic is enabled, create a geodesic path of points- Parameters:
maxDistance- max distance allowed between path pointspoints- ordered points- Returns:
- geodesic path points
- Since:
- 6.6.5
-
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 BufferedImage getIcon(IconRow iconRow)
Get the icon image from the icon row- Parameters:
iconRow- icon row- Returns:
- icon image
-
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(BufferedImage image)
Determine if the image is transparent- Parameters:
image- image- Returns:
- true if transparent
-
checkIfDrawn
protected BufferedImage checkIfDrawn(BufferedImage image)
Check if the image was drawn upon (non null and not transparent). Return the same image if drawn, else return null- Parameters:
image- image- Returns:
- drawn image or null
-
calculateStylePixelBounds
public PixelBounds calculateStylePixelBounds()
Calculate style pixel bounds- Returns:
- pixel bounds
- Since:
- 6.3.0
-
calculateStylePixelBounds
public PixelBounds calculateStylePixelBounds(float scale)
Calculate style pixel bounds- Parameters:
scale- scale factor- Returns:
- pixel bounds
- Since:
- 6.3.0
-
drawTile
public abstract BufferedImage drawTile(int zoom, BoundingBox webMercatorBoundingBox, FeatureIndexResults results)
Draw a tile image from geometry index results- Parameters:
zoom- zoom levelwebMercatorBoundingBox- web mercator bounding boxresults- feature index results- Returns:
- image
- Since:
- 6.1.2
-
drawTile
public abstract BufferedImage drawTile(int zoom, BoundingBox webMercatorBoundingBox, FeatureResultSet resultSet)
Draw a tile image from feature geometries in the provided result set- Parameters:
zoom- zoom levelwebMercatorBoundingBox- web mercator bounding boxresultSet- feature result set- Returns:
- image
- Since:
- 2.0.0
-
drawTile
public abstract BufferedImage drawTile(int zoom, BoundingBox webMercatorBoundingBox, List<FeatureRow> featureRow)
Draw a tile image from the feature rows- Parameters:
zoom- zoom levelwebMercatorBoundingBox- web mercator bounding boxfeatureRow- feature row- Returns:
- image
- Since:
- 2.0.0
-
-