Package org.geotools.data.util
Class ScreenMap
Object
ScreenMap
The screenmap is a packed bitmap of the screen, one bit per pixels. It can be used to avoid rendering a lot of very
small features in the same pixel.
The screenmap can be used two ways:
- By working directly against the pixels using
checkAndSet(int, int)
- By working with real world envelopes using
checkAndSet(Envelope)
, in that case the full math transform from data to screen, and the generalization spans must be set
- Author:
- jeichar, Andrea Aime - OpenGeo
-
Constructor Summary
ConstructorsConstructorDescriptionScreenMap
(int x, int y, int width, int height) ScreenMap
(int x, int y, int width, int height, MathTransform mt) -
Method Summary
Modifier and TypeMethodDescriptionboolean
canSimplify
(Envelope envelope) boolean
checkAndSet
(int x, int y) Checks if the geometry should be skipped.boolean
checkAndSet
(Envelope envelope) boolean
get
(int x, int y) Returns true if the pixel at location x,y is set or out of bounds.boolean
getSimplifiedShape
(double minx, double miny, double maxx, double maxy, GeometryFactory geometryFactory, Class geometryType) Returns geometry suitable for rendering the pixel that has just been occupied.getSimplifiedShape
(Geometry geometry) Returns geometry suitable for rendering the pixel that has just been occupied.void
set
(int x, int y, boolean value) Sets location at position x,y to the value.void
setSpans
(double spanX, double spanY) void
-
Constructor Details
-
ScreenMap
-
ScreenMap
-
ScreenMap
public ScreenMap(int x, int y, int width, int height)
-
-
Method Details
-
setTransform
-
checkAndSet
- Throws:
TransformException
-
canSimplify
-
setSpans
public void setSpans(double spanX, double spanY) -
checkAndSet
public boolean checkAndSet(int x, int y) Checks if the geometry should be skipped. If the test returns true it means the geometry sits in a pixel that has already been used -
get
- Throws:
TransformException
-
get
public boolean get(int x, int y) Returns true if the pixel at location x,y is set or out of bounds. -
getSimplifiedShape
Returns geometry suitable for rendering the pixel that has just been occupied. The geometry is designed to actually fill the pixel -
getSimplifiedShape
public Geometry getSimplifiedShape(double minx, double miny, double maxx, double maxy, GeometryFactory geometryFactory, Class geometryType) Returns geometry suitable for rendering the pixel that has just been occupied. The geometry is designed to actually fill the pixel -
set
public void set(int x, int y, boolean value) Sets location at position x,y to the value.
-