|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjwo.landserf.structure.SpatialObject
jwo.landserf.structure.VectorMap
public class VectorMap
A collection of GIS vectors that model object boundaries.
Field Summary | |
---|---|
static int |
QUALITY
Deprecated. Should use VectorStyles.QUALITY instead. |
static int |
SPEED
Deprecated. Should use VectorStyles.SPEED instead. |
protected DelaunayTriang |
triangulation
Triangulation topology. |
Fields inherited from interface jwo.landserf.structure.SpatialModel |
---|
ADJACENT, AREA, CONTOUR, ENCLOSES, INTERSECTION, LINE, MATCHES, MSN, NO_VALUE, OUT_OF_BOUNDS, OVERLAPS, POINT, RASTER_2D, RASTER_3D, SEPARATE, TIN, UNDEFINED, UNION, UNKNOWN, UNKNOWN_MODEL, VECTOR_2D, VECTOR_3D, VOLUME, WITHIN |
Constructor Summary | |
---|---|
VectorMap()
Creates an empty vector map with default characteristics. |
|
VectorMap(Footprint fp,
Header header)
Creates an empty vector map with a given footprint and header. |
|
VectorMap(GISVector gisVector,
Header header)
Creates a vector map using the given GIS vector object. |
|
VectorMap(SpatialObject spObj)
Creates a vector map based on the dimensions and header of the spatial object. |
Method Summary | |
---|---|
void |
add(GISVector gisVector)
Adds the given GIS vector object to the map and updates the vector bounds. |
void |
add(GISVector gisVector,
boolean updateBounds)
Adds the given GIS vector object to the map with optional boundary update. |
void |
add(VectorMap newVectorMap)
Adds the given vector map to this one and updates the bounds. |
Object |
clone()
Clones this vector map. |
void |
draw(AffineTransform trans,
AffineTransform iTrans,
float lineWidth,
boolean isSurroundLine,
float pointSize,
boolean isSurroundPoint,
Color boundaryColour,
float polygonOpacity,
int renderStyle,
Graphics g)
Deprecated. Set styles in a VectorStyles object instead and call the draw() method
that accepts VectorStyles object instead. |
void |
draw(AffineTransform trans,
AffineTransform iTrans,
float lineWidth,
float pointSize,
Color boundaryColour,
float polygonOpacity,
int renderStyle,
Graphics g)
Deprecated. Set styles in a VectorStyles object instead and call the draw() method
that accepts VectorStyles object instead. |
void |
draw(AffineTransform trans,
AffineTransform iTrans,
VectorStyles styles,
boolean isDraft,
Graphics g)
Draws the vector map using the given graphics context and rendering options. |
void |
draw(AffineTransform trans,
AffineTransform iTrans,
VectorStyles styles,
Graphics g)
Draws the vector map using the given graphics context and rendering options. |
void |
drawLabels(AffineTransform trans,
AffineTransform iTrans,
VectorStyles styles,
Graphics g)
Draws the attributes associated with point vectors. |
float |
getAttribute(Footprint fp)
Reports the attribute at the given point location. |
Object |
getAttribute(Footprint fp,
AttributeTable attributeTable)
Reports the attribute at the given point location. |
GISVector |
getGISVector(Footprint fp)
Reports the GISVector at the given point location. |
Vector |
getGISVectors()
Returns a collection of GIS vectors stored in this map. |
void |
getImage(int[] pixels,
int imgWidth)
Converts the vector map into a centred low quality colour image for display. |
float |
getMaxAttribute()
Reports the maximum attribute value of the object. |
float |
getMinAttribute()
Reports the minimum attribute value of the object. |
int |
getNumObjects()
Returns the number of GIS vector objects associated with the vector map. |
VectorStyles |
getStyles()
Retrieves the drawing styles that may be used by the vector when drawing. |
DelaunayTriang |
getTriangulation()
Returns the triangulation topology associated with vector map. |
int |
getType()
Reports the type of spatial model. |
String |
getTypeName()
Name describing this vector map type. |
static String |
getTypeName(int vectType)
Name describing the given vector map type. |
boolean |
hasZCoords()
Processes all GIS vectors to see if they all have z coordinates. |
boolean |
readFile(String fileName)
Reads the contents of the given native format file into this vector map. |
boolean |
remove(GISVector gisVector)
Removes the given GIS vector object from the map. |
void |
setDefaultColours()
Sets up a default colour scheme based on the range of values in this vector map. |
void |
setImageContainer(Container imageContainer)
Sets the image container that can hold a rasterised version of this vector map. |
void |
setStyles(VectorStyles styles)
Sets the drawing styles that may be used by the vector when drawing. |
void |
setTriangulation(DelaunayTriang tri)
Sets the triangulation topology associated with vector map. |
void |
setType(int type)
Sets the type of vector model (e.g. |
SpatialModel |
subset(Footprint clipRect)
Creates a subset of this vector map based on the given rectangle. |
void |
tinToVector()
Creates a vector map from current triangulation topology. |
String |
toString()
Reports the details of this vector map. |
void |
updateBounds()
Updates the minimum enclosing rectangle as that enclosing all GIS Vectors within this map and finds the minimum and maximum attribute values. |
void |
vectorToTin()
Creates and stores TIN topology from this vector map. |
boolean |
writeFile(String fileName,
int fileType,
GISFrame gisFrame)
Writes the contents of the vector map to one or more files. |
boolean |
writeFile(String fileName,
int fileType,
GISFrame gisFrame,
LSThread lsThread)
Writes the contents of the vector map to one or more files. |
Methods inherited from class jwo.landserf.structure.SpatialObject |
---|
compare, getAttributeTable, getBounds, getColourTable, getComparisonText, getHeader, getIntersectionMER, getProjection, getUnionMER, move, setAttributeTable, setBounds, setColourTable, setHeader, setProjection |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected transient DelaunayTriang triangulation
public static final int SPEED
VectorStyles.SPEED
instead.public static final int QUALITY
VectorStyles.QUALITY
instead.Constructor Detail |
---|
public VectorMap()
public VectorMap(Footprint fp, Header header)
fp
- Footprint defining map's bounds.header
- Header associated with the vector map.public VectorMap(GISVector gisVector, Header header)
gisVector
- GIS vector object from which to create map.header
- Header associated with the vector map.public VectorMap(SpatialObject spObj)
clone()
.
spObj
- Spatial object from which to extract metadata.Method Detail |
---|
public Object clone()
clone
in class Object
public void add(GISVector gisVector)
gisVector
- GIS vector object to add.public void add(GISVector gisVector, boolean updateBounds)
gisVector
- GIS vector object to add.updateBounds
- Will update the map's bounds if true.public void add(VectorMap newVectorMap)
newVectorMap
- Vector map to add.public boolean remove(GISVector gisVector)
gisVector
- GIS Vector object to remove.
public Vector getGISVectors()
public void tinToVector()
public void vectorToTin()
public String toString()
toString
in class SpatialObject
public void setStyles(VectorStyles styles)
styles
- Styles to store.public VectorStyles getStyles()
setStyles()
.
public boolean writeFile(String fileName, int fileType, GISFrame gisFrame)
fileName
- Name of main file to save.fileType
- Type of file format to save.gisFrame
- GUI in which to report results.
FileHandler
public boolean writeFile(String fileName, int fileType, GISFrame gisFrame, LSThread lsThread)
fileName
- Name to save file under.fileType
- Type of file format to save.gisFrame
- GUI in which to report results.lsThread
- Thread that called this method (allowing it to be interrupted).
Can be null, in which case, method cannot be interrupted.
FileHandler
public boolean readFile(String fileName)
fileName
- Name to file to read.
public void draw(AffineTransform trans, AffineTransform iTrans, float lineWidth, float pointSize, Color boundaryColour, float polygonOpacity, int renderStyle, Graphics g)
VectorStyles
object instead and call the draw()
method
that accepts VectorStyles
object instead.
trans
- georeferenced to pixel transformation.iTrans
- pixel to georeferenced transformation.lineWidth
- Line width of vector representation (in pixels, can be fractions of a pixel).pointSize
- Size of point features in pixels.boundaryColour
- Colour of polygon borders or null if no border.polygonOpacity
- Polygon interior opacity.renderStyle
- Either optimise for VectorStyles.QUALITY
or VectorStyes.SPEED
.g
- Graphics context in which to draw.public void draw(AffineTransform trans, AffineTransform iTrans, float lineWidth, boolean isSurroundLine, float pointSize, boolean isSurroundPoint, Color boundaryColour, float polygonOpacity, int renderStyle, Graphics g)
VectorStyles
object instead and call the draw()
method
that accepts VectorStyles
object instead.
trans
- georeferenced to pixel transformation.iTrans
- pixel to georeferenced transformation.lineWidth
- Line width of vector representation (in pixels, can be fractions of a pixel).isSurroundLine
- Draws transparent line with borders if true, otherwise default solid line.pointSize
- Size of point features in pixels.isSurroundPoint
- Draws transparent point with border if true, otherwise default solid point.boundaryColour
- Colour of polygon borders or null if no border.polygonOpacity
- Polygon interior transparency.renderStyle
- Either optimise for VectorStyles.QUALITY
or VectorStyes.SPEED
.g
- Graphics context in which to draw.public void draw(AffineTransform trans, AffineTransform iTrans, VectorStyles styles, Graphics g)
trans
- georeferenced to pixel transformation.iTrans
- pixel to georeferenced transformation.styles
- Vector drawing styles.g
- Graphics context in which to draw.public void draw(AffineTransform trans, AffineTransform iTrans, VectorStyles styles, boolean isDraft, Graphics g)
trans
- georeferenced to pixel transformation.iTrans
- pixel to georeferenced transformation.styles
- Vector drawing styles.isDraft
- If true, a quicker draft version of the vector map is drawn.g
- Graphics context in which to draw.public void drawLabels(AffineTransform trans, AffineTransform iTrans, VectorStyles styles, Graphics g)
trans
- georeferenced to pixel transformation.iTrans
- pixel to georeferenced transformation.styles
- Vector drawing styles.g
- Graphics context in which to draw.public float getMinAttribute()
getMinAttribute
in class SpatialObject
public float getMaxAttribute()
getMaxAttribute
in class SpatialObject
public void setImageContainer(Container imageContainer)
imageContainer
- Container in which to draw rasterised image.public int getNumObjects()
public DelaunayTriang getTriangulation()
public void setTriangulation(DelaunayTriang tri)
tri
- Triangulation topology.public void setType(int type)
type
- Type of vector model.public void updateBounds()
updateBounds
in class SpatialObject
public boolean hasZCoords()
public SpatialModel subset(Footprint clipRect)
subset
in interface SpatialModel
subset
in class SpatialObject
clipRect
- Clipping rectangle.
public int getType()
getType
in interface SpatialModel
getType
in class SpatialObject
public String getTypeName()
getTypeName
in class SpatialObject
public static String getTypeName(int vectType)
vectType
- Numeric identifier representing type of vector to describe.
public float getAttribute(Footprint fp)
getAttribute
in interface SpatialModel
getAttribute
in class SpatialObject
fp
- Location to query. The larger of the width/height
of the footprint is used to define the snapping distance
for the query.
public GISVector getGISVector(Footprint fp)
fp
- Location to query. The larger of the width/height
is used to define the snapping distance for the query.
public Object getAttribute(Footprint fp, AttributeTable attributeTable)
fp
- Location to query.attributeTable
- Attribute table to look up.
public void getImage(int[] pixels, int imgWidth)
getImage
in interface SpatialModel
getImage
in class SpatialObject
pixels
- Image array to store colours.imgWidth
- Image width.public void setDefaultColours()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |