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 String
compressFormat
Compress formatprotected FeatureDao
featureDao
Tile data access objectprotected FeatureTableStyles
featureTableStyles
Feature Style extensionprotected boolean
fillPolygon
Fill polygon flagprotected boolean
geodesic
Draw geometries using geodesic linesprotected float
heightOverlap
Height overlapping pixels between tile imagesprotected FeatureIndexManager
indexManager
When not null, features are retrieved using a feature indexprotected Paint
linePaint
Line paintprotected float
lineStrokeWidth
Line stroke widthprotected 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 maxprotected FeatureTilePointIcon
pointIcon
Optional point icon in place of a drawn circleprotected Paint
pointPaint
Point paintprotected float
pointRadius
Point radiusprotected Paint
polygonFillPaint
Polygon fill paintprotected Paint
polygonPaint
Polygon paintprotected float
polygonStrokeWidth
Polygon stroke widthprotected Projection
projection
Feature DAO Projectionprotected float
scale
Scale factorprotected boolean
simplifyGeometries
When true, geometries are simplified before being drawn.protected int
tileHeight
Tile heightprotected int
tileWidth
Tile heightprotected static Projection
WEB_MERCATOR_PROJECTION
Web Mercator Projectionprotected float
widthOverlap
Width 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 void
calculateDrawOverlap()
Call after making changes to the point icon, point radius, or paint stroke widths.PixelBounds
calculateStylePixelBounds()
Calculate style pixel boundsPixelBounds
calculateStylePixelBounds(float scale)
Calculate style pixel boundsprotected BufferedImage
checkIfDrawn(BufferedImage image)
Check if the image was drawn upon (non null and not transparent).void
clearCache()
Clear all cachesvoid
clearIconCache()
Clear the icon cachevoid
clearStylePaintCache()
Clear the style paint cachevoid
close()
Close the feature tiles connectionprotected BufferedImage
createNewImage()
Create a new empty imageBufferedImage
drawTile(int x, int y, int zoom)
Draw a tile image from the x, y, and zoom levelabstract BufferedImage
drawTile(int zoom, BoundingBox webMercatorBoundingBox, List<FeatureRow> featureRow)
Draw a tile image from the feature rowsabstract BufferedImage
drawTile(int zoom, BoundingBox webMercatorBoundingBox, FeatureIndexResults results)
Draw a tile image from geometry index resultsabstract BufferedImage
drawTile(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 levelBufferedImage
drawTileQueryAll(int x, int y, int zoom)
Draw a tile image from the x, y, and zoom level by querying all features.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 locationBoundingBox
expandBoundingBox(BoundingBox webMercatorBoundingBox)
Create an expanded bounding box to handle features outside the tile that overlapBoundingBox
expandBoundingBox(BoundingBox webMercatorBoundingBox, BoundingBox tileWebMercatorBoundingBox)
Create an expanded bounding box to handle features outside the tile that overlapBoundingBox
expandBoundingBox(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 pointsString
getCompressFormat()
Get the compress formatFeatureDao
getFeatureDao()
Get the feature DAOprotected FeatureStyle
getFeatureStyle(FeatureRow featureRow)
Get the feature style for the feature row and geometry typeprotected FeatureStyle
getFeatureStyle(FeatureRow featureRow, GeometryType geometryType)
Get the feature style for the feature row and geometry typeFeatureTableStyles
getFeatureTableStyles()
Get the feature table stylesprotected Graphics2D
getGraphics(BufferedImage image)
Get a graphics for the imagefloat
getHeightDrawOverlap()
Get the height draw overlapprotected BufferedImage
getIcon(IconRow iconRow)
Get the icon image from the icon rowFeatureIndexManager
getIndexManager()
Get the index managerColor
getLineColor()
Get line colorprotected Paint
getLinePaint(FeatureStyle featureStyle)
Get the line paint for the feature style, or return the default paintfloat
getLineStrokeWidth()
Get line stroke widthInteger
getMaxFeaturesPerTile()
Get the max features per tileCustomFeaturesTile
getMaxFeaturesTileDraw()
Get the max features tile draw, the custom tile drawing implementation for tiles with more features than the max at #getMaxFeaturesPerTileColor
getPointColor()
Get point colorFeatureTilePointIcon
getPointIcon()
Get the point iconprotected Paint
getPointPaint(FeatureStyle featureStyle)
Get the point paint for the feature style, or return the default paintfloat
getPointRadius()
Get the point radiusColor
getPolygonColor()
Get polygon colorColor
getPolygonFillColor()
Get polygon fill colorprotected Paint
getPolygonFillPaint(FeatureStyle featureStyle)
Get the polygon fill paint for the feature style, or return the default paintprotected Paint
getPolygonPaint(FeatureStyle featureStyle)
Get the polygon paint for the feature style, or return the default paintfloat
getPolygonStrokeWidth()
Get polygon stroke widthfloat
getScale()
Get the scaleint
getTileHeight()
Get the tile heightint
getTileWidth()
Get the tile widthprotected GeometryTransform
getWebMercatorTransform()
Create a geometry transformation from the feature dao projection to Web Mercatorfloat
getWidthDrawOverlap()
Get the width draw overlapvoid
ignoreFeatureTableStyles()
Ignore the feature table styles within the GeoPackageboolean
isFillPolygon()
Is fill polygonboolean
isGeodesic()
Are geometries drawn using geodesic lines? Default is falseboolean
isIndexQuery()
Is index queryboolean
isSimplifyGeometries()
Is the simplify geometries flag set? Default is trueprotected boolean
isTransparent(BufferedImage image)
Determine if the image is transparentFeatureIndexResults
queryIndexedFeatures(int x, int y, int zoom)
Query for feature results in the x, y, and zoomFeatureIndexResults
queryIndexedFeatures(BoundingBox webMercatorBoundingBox)
Query for feature results in the bounding boxlong
queryIndexedFeaturesCount(int x, int y, int zoom)
Query for feature result count in the x, y, and zoomlong
queryIndexedFeaturesCount(BoundingBox webMercatorBoundingBox)
Query for feature result count in the bounding boxvoid
setCompressFormat(String compressFormat)
Set the compress formatvoid
setDrawOverlap(float pixels)
Manually set the width and height draw overlapvoid
setFeatureTableStyles(FeatureTableStyles featureTableStyles)
Set the feature table stylesvoid
setFillPolygon(boolean fillPolygon)
Set the fill polygonvoid
setGeodesic(boolean geodesic)
Set the geodestic flag, true to draw geodesic geometriesvoid
setHeightDrawOverlap(float pixels)
Manually set the height draw overlapvoid
setIconCacheSize(int size)
Set / resize the icon cache sizevoid
setIndexManager(FeatureIndexManager indexManager)
Set the indexvoid
setLineColor(Color lineColor)
Set line colorvoid
setLineStrokeWidth(float lineStrokeWidth)
Set line stroke widthvoid
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 existvoid
setPointColor(Color pointColor)
Set point colorvoid
setPointIcon(FeatureTilePointIcon pointIcon)
Set the point iconvoid
setPointRadius(float pointRadius)
Set the point radiusvoid
setPolygonColor(Color polygonColor)
Set polygon colorvoid
setPolygonFillColor(Color polygonFillColor)
Set polygon fill colorvoid
setPolygonStrokeWidth(float polygonStrokeWidth)
Set polygon stroke widthvoid
setScale(float scale)
Set the scalevoid
setSimplifyGeometries(boolean simplifyGeometries)
Set the simplify geometries flagvoid
setStylePaintCacheSize(int size)
Set / resize the style paint cache sizevoid
setTileHeight(int tileHeight)
Set the tile heightvoid
setTileWidth(int tileWidth)
Set the tile widthvoid
setWidthDrawOverlap(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
-
-