|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.reades.mapthing.Generic
com.reades.mapthing.Polygons
public class Polygons
Creates polygons from a Polygon shape file in ArcGIS.
Issues to be tested/implemented:
Field Summary | |
---|---|
boolean |
DEBUG
|
Constructor Summary | |
---|---|
Polygons(BoundingBox b,
Usually used to instantiate a Polygon object from within the general feature collection of the shape file so that it can be manipulated separately from the other polygons. |
|
Polygons(BoundingBox b,
SimpleFeature f)
Usually used to instantiate a Polygon object from within the processing of the shape file so that it can be manipulated separately from the other polygons. |
|
Polygons(BoundingBox b,
String r)
Instantiate the GeoLine object with a BoundingBox and String. |
Method Summary | |
---|---|
ArrayList<Coordinate[]> |
getCoordinates()
Returns the raw SimpleFeature coordinates associated with the polygons as an ArrayList of coordinate arrays. |
ArrayList<Node[]> |
getCoordinates(PApplet a)
Return an ArrayList, each row of which contains an array of Nodes. |
HashMap<Integer,Polygons> |
getPolygonsWithId(String idField)
Return a HashMap which contains all of the polygons keyed on the named ID field. |
boolean |
isClosed()
Check whether polygons should be drawn closed or open. |
boolean |
isClosed(boolean c)
Specify whether polygons should be drawn closed or open. |
void |
project(PApplet a)
Draws all of the vertices contained in a Polygon object loaded from a file. |
void |
project(PApplet a,
PGraphics p)
Draws all of the vertices contained in a Polygon object loaded from a file. |
void |
projectValues(PApplet a,
float min,
float max)
Apply a color scale to the the polygons so that it is possible to represent the values in a useful way. |
void |
reverse()
Reverses the order of the points in a polygon. |
void |
transformCoordinates(PApplet a)
Called before you can display the polygons in a Processing sketch. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public boolean DEBUG
Constructor Detail |
---|
public Polygons(BoundingBox b, String r)
b
- the bounding box of the default viewr
- a String that allows us to determine the type of resource to openpublic Polygons(BoundingBox b,f)
b
- the bounding box of the parent Polygons objectf
- the feature collection used to instantiate the new objectpublic Polygons(BoundingBox b, SimpleFeature f)
b
- the bounding box of the parent Polygons objectf
- the Simple Feature used to instantiate the new objectMethod Detail |
---|
public void transformCoordinates(PApplet a)
a
- the Processing PApplet objectpublic HashMap<Integer,Polygons> getPolygonsWithId(String idField)
public ArrayList<Node[]> getCoordinates(PApplet a)
public ArrayList<Coordinate[]> getCoordinates()
public boolean isClosed(boolean c)
public boolean isClosed()
public void project(PApplet a)
object.project(this)
.
a
- a Processing PApplet objectpublic void projectValues(PApplet a, float min, float max)
a
- a Processing PApplet objectmin
- the minimum value of the value field (I will try to make this automatic in later releases)max
- the maximum value of the value field (I will try to make this automatic in later releases)public void project(PApplet a, PGraphics p)
Draws all of the vertices contained in a Polygon object loaded from a file. This one differs from the version without a PGraphics object in that it allows you to use the graphics object as a buffer and won't write directly to the Applet view.
The simplest way to work with this method is to set the color, fill, and stroke in your sketch and then just call this function by passing it the Applet and Graphics instances
Note that if you want the image to appear right on top of the coordinates then you will need to call "imageMode(CENTER)" in your sketch first.
a
- a Processing PApplet objectp
- a Processing PGraphics objectpublic void reverse()
Reverses the order of the points in a polygon. Note that this will only do something if you have already called transformCoordinates or project once (since it only works on the points that have been mapped into the Processing sketch.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |