Class DensityMaps.DensityMapBuilder
- Enclosing class:
DensityMaps
ImageServer
representing a density map or for DensityMaps.DensityMapParameters
.-
Method Summary
Modifier and TypeMethodDescriptionaddDensities
(String name, PathObjectPredicates.PathObjectPredicate filter) Add a filter for computing densities.buildClassifier
(ImageData<BufferedImage> imageData) Build aPixelClassifier
for a density map using the current parameters and the specifiedImageData
.Build aDensityMaps.DensityMapParameters
object containing the main density map parameters.buildServer
(ImageData<BufferedImage> imageData) Build anImageServer
representing this density map.colorModel
(ColorModels.ColorModelBuilder colorModelBuilder) Set aColorModels.ColorModelBuilder
that can be used in conjunction withbuildServer(ImageData)
.pixelSize
(PixelCalibration requestedPixelSize) Requested pixel size to determine the resolution of the density map, in calibrated units.radius
(double radius) The radius of the filter used to calculate densities.The type of the density map, which determines any associated normalization.
-
Method Details
-
pixelSize
Requested pixel size to determine the resolution of the density map, in calibrated units.If this is not specified, an
ImageData
should be provided tobuildClassifier(ImageData)
and used to determine a suitable pixel size based upon the radius value and the image dimensions.This is recommended, since specifying a pixel size could potentially result in creating maps that are too large or too small, causing performance or memory problems.
- Parameters:
requestedPixelSize
-- Returns:
- this builder
- See Also:
-
type
The type of the density map, which determines any associated normalization.- Parameters:
type
-- Returns:
- this builder
-
addDensities
public DensityMaps.DensityMapBuilder addDensities(String name, PathObjectPredicates.PathObjectPredicate filter) Add a filter for computing densities. This is added on top of the filter specified inDensityMaps.builder(PathObjectPredicate)
to extract a subset of objects for which densities are determined.- Parameters:
name
- name of the filter; usually this is the name of a classification that the objects should havefilter
- the filter itself (predicate that must be JSON-serializable)- Returns:
- this builder
-
colorModel
Set aColorModels.ColorModelBuilder
that can be used in conjunction withbuildServer(ImageData)
. If this is not set, the defaultColorModel
used withbuildServer(ImageData)
may not convert well to RGB.- Parameters:
colorModelBuilder
-- Returns:
-
radius
The radius of the filter used to calculate densities.- Parameters:
radius
-- Returns:
- this builder
-
buildParameters
Build aDensityMaps.DensityMapParameters
object containing the main density map parameters.- Returns:
-
buildClassifier
Build aPixelClassifier
for a density map using the current parameters and the specifiedImageData
.- Parameters:
imageData
-- Returns:
- the density map
- See Also:
-
buildServer
Build anImageServer
representing this density map.Note that this involved generating a unique ID and caching all tiles. The reason is that density maps can change over time as the object hierarchy changes, and therefore one should be generated that represents a snapshot in time. However, this imposes a limit on the size of density map that can be generated to avoid memory errors.
If greater control is needed over when and how the density map is created, using
buildClassifier(ImageData)
instead.- Parameters:
imageData
-- Returns:
- See Also:
-