|
|||||||||
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.Points
public class Points
Creates points from a Point shape file in ArcGIS.
Field Summary | |
---|---|
boolean |
DEBUG
|
Constructor Summary | |
---|---|
Points(BoundingBox b,
Instantiate the Points object with a BoundingBox and Feature Collection object. |
|
Points(BoundingBox b,
String r)
Instantiate the GeoLine object with a BoundingBox and String. |
Method Summary | |
---|---|
void |
dedupe(boolean useFirst)
Use to remove duplicates -- by geographical coordinates -- from the data you are about to show. |
ArrayList<Coordinate> |
getCoordinates()
Returns the raw coordinates without any transformation to fit into the sketch. |
ArrayList<Node> |
getCoordinates(PApplet a)
Return an ArrayList, each row of which contains a single Node object. |
void |
label(PApplet a)
|
void |
labelOffset(int x,
int y)
|
void |
project(PApplet a,
float w,
float h)
Draws all of the points contained in a Points object loaded from a file. |
void |
project(PApplet a,
PGraphics p,
float w,
float h)
Draws all of the points contained in a Points object loaded from a file. |
void |
project(PApplet a,
PGraphics p,
PImage i,
float w,
float h)
Draws all of the points contained in a Points object loaded from a file. |
void |
project(PApplet a,
PImage i,
float w,
float h)
Draws all of the points contained in a Points object loaded from a shape file. |
void |
projectAreas(PApplet a,
float r,
float max)
Scales the size of the point according to the value of the data associated with the point. |
void |
projectAreasAndValues(PApplet a,
float r,
float min,
float max)
Scales the size of the point and the colour according to the data value associated with that location. |
void |
projectValues(PApplet a,
float w,
float h,
float min,
float max)
Colours all of the points according to the specified colour scale. |
void |
transformCoordinates(PApplet a)
Must be called before you can display the points 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 Points(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 Points(BoundingBox b,f)
b
- the bounding box of the default viewportf
- a reference to FeatureCollection of SimpleFeature objectsMethod Detail |
---|
public void dedupe(boolean useFirst)
useFirst
- use the first point encountered in the index when de-duping points.public void transformCoordinates(PApplet a)
points.project(this)
. However,
this does allow you to manually perform operations if you
are trying to be very clever, and basically all we're doing
is using the height and width of the sketch so that we can
remap the coordinates of the shape file into the
plain of the sketch itself.
a
- a Processing PApplet objectpublic ArrayList<Node> getCoordinates(PApplet a)
public ArrayList<Coordinate> getCoordinates()
public void project(PApplet a, float w, float h)
object.project(this, width, height)
.
a
- a Processing PApplet objectw
- a float indicating the width of the ellipse to drawh
- a float indicating the height of the ellipse to drawpublic void projectValues(PApplet a, float w, float h, float min, float max)
Colours all of the points according to the specified colour scale. The default values are set as white to black, so you'll probably want to override these. If a value falls below the minimum then it will be assigned the colour of the minimum value. If a value exceeds the maximum then it will be assigned the colour of the maximum value.
In the longer run I'll try to implement a version that doesn't require you to specify these values.
a
- the PApplet (usually just referred to in a sketch as 'this')w
- the width of the ellipse you want to draw on top of the pointh
- the height of the ellipse you want to draw on top of the pointmin
- the minimum value to use (against which to scale the point values)max
- the maximum value to use (against which to scale the point values)public void projectAreas(PApplet a, float r, float max)
Scales the size of the point according to the value of the data associated with the point. You pass in a radius value that indicates the desired area to associate with the maximum value specified by the max parameter. In this case, values that exceed the maximum will continue to scale up to give points whose radius exceeds the specified r value.
In the long run I'll try to implement a version that doesn't require you to specify a maximum.
a
- the PApplet (usually just referred to in a sketch as 'this')r
- the desired maximum radiusmax
- the expected maximum valuepublic void projectAreasAndValues(PApplet a, float r, float min, float max)
Scales the size of the point and the colour according to the data value associated with that location.
In the long run I'll try to implement a version that doesn't require you to specify a minimum or maximum.
a
- the PApplet (usually just referred to in a sketch as 'this')r
- the desired maximum radiusmin
- the minimum value to use (against which to scale the point values)max
- the maximum value to use (against which to scale the point values)projectAreas
,
projectValues
public void project(PApplet a, PImage i, float w, float h)
object.project(this, image, width, height)
.
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 objecti
- a PImage object containing the image we want to draw at each pointw
- a float indicating the width of the image to drawh
- a float indicating the height of the image to drawpublic void project(PApplet a, PGraphics p, float w, float h)
Draws all of the points contained in a Points 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.
a
- a Processing PApplet objectp
- a Processing PGraphics objectw
- a float indicating the width of the ellipse to drawh
- a float indicating the height of the ellipse to drawpublic void project(PApplet a, PGraphics p, PImage i, float w, float h)
Draws all of the points contained in a Points 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 objecti
- a PImage object containing the image we want to draw at each pointw
- a float indicating the width of the image to drawh
- a float indicating the height of the image to drawpublic void labelOffset(int x, int y)
public void label(PApplet a)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |