Package org.apache.sedona.viz.core
Class VisualizationOperator
java.lang.Object
org.apache.sedona.viz.core.VisualizationOperator
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ChoroplethMap,HeatMap,ScatterPlot
The Class VisualizationOperator.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThe blue.protected intThe color alpha.protected ColorizeOptionThe colorize option.protected ColorThe control color channel.protected org.locationtech.jts.geom.EnvelopeThe dataset boundary.The distributed raster color matrix.The distributed raster count matrix.org.apache.spark.api.java.JavaPairRDD<Integer,ImageSerializableWrapper> The distributed raster image.The distributed vector colors.The distributed vector image.The distributed vector objects.protected intThe green.protected booleanThe has been spatial partitioned.protected DoubleThe max pixel count.protected booleanThe only draw outline.protected booleanThe parallel photo filter.protected booleanThe parallel render image.protected intThe partition interval X.protected intThe partition interval Y.protected intThe partition X.protected intThe partition Y.protected Double[][]The Photo filter convolution matrix.protected intThe photo filter radius.The raster image.protected intThe red.protected intThe resolution X.protected intThe resolution Y.protected booleanThe reverse spatial coordinate.protected booleanThe use inverse ratio for control color channel.The vector image. -
Constructor Summary
ConstructorsConstructorDescriptionVisualizationOperator(int resolutionX, int resolutionY, org.locationtech.jts.geom.Envelope datasetBoundary, ColorizeOption colorizeOption, boolean reverseSpatialCoordinate, int partitionX, int partitionY, boolean parallelPhotoFilter, boolean parallelRenderImage, boolean generateVectorImage) Instantiates a new visualization operator. -
Method Summary
Modifier and TypeMethodDescriptionApplyPhotoFilter(org.apache.spark.api.java.JavaSparkContext sparkContext) Apply photo filter.protected booleanColorize()Colorize.booleanCustomizeColor(int red, int green, int blue, int colorAlpha, Color controlColorChannel, boolean useInverseRatioForControlColorChannel) Customize color.protected ColorEncodeToColor(int normalizedCount) Encode to color.protected IntegerEncodeToRGB(int normalizedCount) Encode to RGB.protected booleanInitPhotoFilterWeightMatrix(PhotoFilter photoFilter) Inits the photo filter weight matrix.Rasterize(org.apache.spark.api.java.JavaSparkContext sparkContext, SpatialRDD spatialRDD, boolean useSparkDefaultPartition) Rasterize.Rasterize(org.apache.spark.api.java.JavaSparkContext sparkContext, org.apache.spark.api.java.JavaPairRDD<org.locationtech.jts.geom.Polygon, Long> spatialPairRDD, boolean useSparkDefaultPartition) Rasterize.protected booleanRenderImage(org.apache.spark.api.java.JavaSparkContext sparkContext) Render image.booleansetMaxPixelCount(Double maxPixelCount) Sets the max pixel count.
-
Field Details
-
rasterImage
The raster image. -
distributedRasterImage
public org.apache.spark.api.java.JavaPairRDD<Integer,ImageSerializableWrapper> distributedRasterImageThe distributed raster image. -
vectorImage
The vector image. -
distributedVectorImage
The distributed vector image. -
colorizeOption
The colorize option. -
maxPixelCount
The max pixel count. -
reverseSpatialCoordinate
protected boolean reverseSpatialCoordinateThe reverse spatial coordinate. -
resolutionX
protected int resolutionXThe resolution X. -
resolutionY
protected int resolutionYThe resolution Y. -
datasetBoundary
protected org.locationtech.jts.geom.Envelope datasetBoundaryThe dataset boundary. -
red
protected int redThe red. -
green
protected int greenThe green. -
blue
protected int blueThe blue. -
colorAlpha
protected int colorAlphaThe color alpha. -
controlColorChannel
The control color channel. -
useInverseRatioForControlColorChannel
protected boolean useInverseRatioForControlColorChannelThe use inverse ratio for control color channel. -
distributedRasterCountMatrix
The distributed raster count matrix. -
distributedRasterColorMatrix
The distributed raster color matrix. -
distributedVectorObjects
The distributed vector objects. -
distributedVectorColors
The distributed vector colors. -
onlyDrawOutline
protected boolean onlyDrawOutlineThe only draw outline. -
PhotoFilterConvolutionMatrix
The Photo filter convolution matrix. -
photoFilterRadius
protected int photoFilterRadiusThe photo filter radius. -
partitionX
protected int partitionXThe partition X. -
partitionY
protected int partitionYThe partition Y. -
partitionIntervalX
protected int partitionIntervalXThe partition interval X. -
partitionIntervalY
protected int partitionIntervalYThe partition interval Y. -
hasBeenSpatialPartitioned
protected boolean hasBeenSpatialPartitionedThe has been spatial partitioned. -
parallelPhotoFilter
protected boolean parallelPhotoFilterThe parallel photo filter. -
parallelRenderImage
protected boolean parallelRenderImageThe parallel render image.
-
-
Constructor Details
-
VisualizationOperator
public VisualizationOperator(int resolutionX, int resolutionY, org.locationtech.jts.geom.Envelope datasetBoundary, ColorizeOption colorizeOption, boolean reverseSpatialCoordinate, int partitionX, int partitionY, boolean parallelPhotoFilter, boolean parallelRenderImage, boolean generateVectorImage) Instantiates a new visualization operator.- Parameters:
resolutionX- the resolution XresolutionY- the resolution YdatasetBoundary- the dataset boundarycolorizeOption- the colorize optionreverseSpatialCoordinate- the reverse spatial coordinatepartitionX- the partition XpartitionY- the partition YparallelPhotoFilter- the parallel photo filterparallelRenderImage- the parallel render imagegenerateVectorImage- the generate vector image
-
-
Method Details
-
InitPhotoFilterWeightMatrix
Inits the photo filter weight matrix.- Parameters:
photoFilter- the photo filter- Returns:
- true, if successful
-
ApplyPhotoFilter
protected org.apache.spark.api.java.JavaPairRDD<Pixel,Double> ApplyPhotoFilter(org.apache.spark.api.java.JavaSparkContext sparkContext) throws Exception Apply photo filter.- Parameters:
sparkContext- the spark context- Returns:
- the java pair RDD
- Throws:
Exception- the exception
-
Colorize
protected boolean Colorize()Colorize.- Returns:
- true, if successful
-
RenderImage
protected boolean RenderImage(org.apache.spark.api.java.JavaSparkContext sparkContext) throws Exception Render image.- Parameters:
sparkContext- the spark context- Returns:
- true, if successful
- Throws:
Exception- the exception
-
setMaxPixelCount
Sets the max pixel count.- Parameters:
maxPixelCount- the max pixel count- Returns:
- true, if successful
-
CustomizeColor
public boolean CustomizeColor(int red, int green, int blue, int colorAlpha, Color controlColorChannel, boolean useInverseRatioForControlColorChannel) Customize color.- Parameters:
red- the redgreen- the greenblue- the bluecolorAlpha- the color alphacontrolColorChannel- the control color channeluseInverseRatioForControlColorChannel- the use inverse ratio for control color channel- Returns:
- true, if successful
-
EncodeToColor
Encode to color.- Parameters:
normalizedCount- the normalized count- Returns:
- the color
- Throws:
Exception- the exception
-
EncodeToRGB
Encode to RGB.- Parameters:
normalizedCount- the normalized count- Returns:
- the integer
- Throws:
Exception- the exception
-
Rasterize
protected org.apache.spark.api.java.JavaPairRDD<Pixel,Double> Rasterize(org.apache.spark.api.java.JavaSparkContext sparkContext, SpatialRDD spatialRDD, boolean useSparkDefaultPartition) Rasterize.- Parameters:
sparkContext- the spark contextspatialRDD- the spatial RDDuseSparkDefaultPartition- the use spark default partition- Returns:
- the java pair RDD
-
Rasterize
protected org.apache.spark.api.java.JavaPairRDD<Pixel,Double> Rasterize(org.apache.spark.api.java.JavaSparkContext sparkContext, org.apache.spark.api.java.JavaPairRDD<org.locationtech.jts.geom.Polygon, Long> spatialPairRDD, boolean useSparkDefaultPartition) Rasterize.- Parameters:
sparkContext- the spark contextspatialPairRDD- the spatial pair RDDuseSparkDefaultPartition- the use spark default partition- Returns:
- the java pair RDD
-