Package org.geotools.data.util
Class ScreenMap
- Object
-
- ScreenMap
-
public class ScreenMap extends Object
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
- By working directly against the pixels using
-
-
Constructor Summary
Constructors Constructor Description ScreenMap(int x, int y, int width, int height)
ScreenMap(int x, int y, int width, int height, MathTransform mt)
ScreenMap(ScreenMap original, int expandBy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
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
get(Envelope envelope)
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.Geometry
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
setTransform(MathTransform mt)
-
-
-
Constructor Detail
-
ScreenMap
public ScreenMap(int x, int y, int width, int height, MathTransform mt)
-
ScreenMap
public ScreenMap(ScreenMap original, int expandBy)
-
ScreenMap
public ScreenMap(int x, int y, int width, int height)
-
-
Method Detail
-
setTransform
public void setTransform(MathTransform mt)
-
checkAndSet
public boolean checkAndSet(Envelope envelope) throws TransformException
- Throws:
TransformException
-
canSimplify
public boolean canSimplify(Envelope envelope)
-
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
public boolean get(Envelope envelope) throws TransformException
- 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
public Geometry getSimplifiedShape(Geometry geometry)
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.
-
-