|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ala.layers.intersect.SimpleRegion
public class SimpleRegion
SimpleRegion enables point to shape intersections, where the shape is stored within SimpleRegion as a circle, bounding box or polygon. Other utilities include shape presence on a defined grid; fully present, partially present, absent.
| Field Summary | |
|---|---|
static int |
BOUNDING_BOX
shape type bounding box; upper, lower, left, right |
static int |
CIRCLE
shape type circle; point and radius |
static int |
GI_ABSENCE
ABSENCE state for grid intersection output |
static int |
GI_FULLY_PRESENT
FULLY PRESENT state for grid intersection output |
static int |
GI_PARTIALLY_PRESENT
PARTiALLy PRESENT state for grid intersection output |
static int |
GI_UNDEFINED
UNDEFINED state for grid intersection output can be considered ABSENCE |
static int |
POLYGON
shape type polygon; list of points as longitude, latitude pairs last point == first point |
static int |
UNDEFINED
shape type not declared |
| Constructor Summary | |
|---|---|
SimpleRegion()
Constructor for a SimpleRegion with no shape |
|
| Method Summary | |
|---|---|
int |
convertLatToPixel(double lat)
|
int |
convertLngToPixel(double lng)
|
double |
convertMetersToLat(double meters)
|
double |
convertMetersToLng(double meters)
|
double |
convertMetersToPixels(double meters,
double latitude,
int zoom)
|
double |
convertPixelsToMeters(int pixels,
double latitude,
int zoom)
|
double |
convertPixelToLat(int px)
|
double |
convertPixelToLng(int px)
|
int[][] |
fillAccMask_EPSG900913(double longitude1,
double latitude1,
double longitude2,
double latitude2,
int width,
int height,
byte[][] three_state_map,
boolean noCellsReturned)
|
int[][] |
fillAccMask(double longitude1,
double latitude1,
double longitude2,
double latitude2,
int width,
int height,
byte[][] three_state_map,
boolean noCellsReturned)
|
double[][] |
getBoundingBox()
gets the bounding box for types POLYGON and BOUNDING_BOX |
double |
getHeight()
|
int |
getNumberOfPoints()
gets number of points for type POLYGON note: first point = last point |
void |
getOverlapGridCells_Acc_EPSG900913(double longitude1,
double latitude1,
double longitude2,
double latitude2,
int width,
int height,
byte[][] three_state_map)
stacks PARTIALLY_PRESENT shape outline onto three_state_map |
void |
getOverlapGridCells_Acc(double longitude1,
double latitude1,
double longitude2,
double latitude2,
int width,
int height,
byte[][] three_state_map)
stacks PARTIALLY_PRESENT shape outline onto three_state_map |
int[][] |
getOverlapGridCells_Box(double longitude1,
double latitude1,
double longitude2,
double latitude2,
int width,
int height,
double[][] bb,
byte[][] three_state_map,
boolean noCellsReturned)
determines overlap with a grid for a BOUNDING_BOX |
int[][] |
getOverlapGridCells_EPSG900913(double longitude1,
double latitude1,
double longitude2,
double latitude2,
int width,
int height,
byte[][] three_state_map)
|
int[][] |
getOverlapGridCells_EPSG900913(double longitude1,
double latitude1,
double longitude2,
double latitude2,
int width,
int height,
byte[][] three_state_map,
boolean noCellsReturned)
|
void |
getOverlapGridCells_Polygon_Acc_EPSG900913(double olongitude1,
double olatitude1,
double olongitude2,
double olatitude2,
int owidth,
int oheight,
byte[][] three_state_map)
|
void |
getOverlapGridCells_Polygon_Acc(double longitude1,
double latitude1,
double longitude2,
double latitude2,
int width,
int height,
byte[][] three_state_map)
|
int[][] |
getOverlapGridCells_Polygon_EPSG900913(double olongitude1,
double olatitude1,
double olongitude2,
double olatitude2,
int owidth,
int oheight,
byte[][] three_state_map,
boolean noCellsReturned)
|
int[][] |
getOverlapGridCells_Polygon(double longitude1,
double latitude1,
double longitude2,
double latitude2,
int width,
int height,
byte[][] three_state_map,
boolean noCellsReturned)
determines overlap with a grid for POLYGON when three_state_map is not null populate it with one of:
GI_UNDEFINED
GI_PARTIALLY_PRESENT
GI_FULLY_PRESENT
GI_ABSENCE
1. |
int[][] |
getOverlapGridCells(double longitude1,
double latitude1,
double longitude2,
double latitude2,
int width,
int height,
byte[][] three_state_map)
|
int[][] |
getOverlapGridCells(double longitude1,
double latitude1,
double longitude2,
double latitude2,
int width,
int height,
byte[][] three_state_map,
boolean noCellsReturned)
determines overlap with a grid for type POLYGON when three_state_map is not null populate it with one of:
GI_UNDEFINED
GI_PARTIALLY_PRESENT
GI_FULLY_PRESENT
GI_ABSENCE |
int |
getType()
|
double |
getWidth()
|
boolean |
isWithin_EPSG900913(double longitude,
double latitude)
|
boolean |
isWithin(double longitude,
double latitude)
returns true when the point provided is within the SimpleRegion note: type UNDEFINED implies no boundary, always returns true. |
static SimpleRegion |
parseSimpleRegion(java.lang.String pointsString)
defines a region by a points string, POLYGON only TODO: define better format for parsing, including BOUNDING_BOX and CIRCLE |
void |
saveGridAsImage(byte[][] three_state_map)
|
void |
setBox(double longitude1,
double latitude1,
double longitude2,
double latitude2)
defines the SimpleRegion as type BOUNDING_BOX |
void |
setCircle(double longitude,
double latitude,
double radius_)
defines the SimpleRegion as type CIRCLE |
void |
setNone()
defines the SimpleRegion as type UNDEFINED |
void |
setPolygon(double[] points_)
defines the SimpleRegion as type POLYGON |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int UNDEFINED
public static final int BOUNDING_BOX
public static final int CIRCLE
public static final int POLYGON
public static final int GI_UNDEFINED
public static final int GI_PARTIALLY_PRESENT
public static final int GI_FULLY_PRESENT
public static final int GI_ABSENCE
| Constructor Detail |
|---|
public SimpleRegion()
| Method Detail |
|---|
public int getNumberOfPoints()
public double[][] getBoundingBox()
public void setBox(double longitude1,
double latitude1,
double longitude2,
double latitude2)
longitude1 - latitude1 - longitude2 - latitude2 - public void setNone()
public void setCircle(double longitude,
double latitude,
double radius_)
longitude - latitude - radius_ - radius of the circle in mpublic void setPolygon(double[] points_)
points_ - array of points as longitude and latiude
in double [n][2] where n is the number of points
public boolean isWithin(double longitude,
double latitude)
longitude - latitude -
public boolean isWithin_EPSG900913(double longitude,
double latitude)
public int[][] getOverlapGridCells(double longitude1,
double latitude1,
double longitude2,
double latitude2,
int width,
int height,
byte[][] three_state_map,
boolean noCellsReturned)
three_state_map is not null populate it with one of:
GI_UNDEFINED
GI_PARTIALLY_PRESENT
GI_FULLY_PRESENT
GI_ABSENCE
longitude1 - latitude1 - longitude2 - latitude2 - xres - number of longitude segements as intyres - number of latitude segments as int
public void getOverlapGridCells_Acc(double longitude1,
double latitude1,
double longitude2,
double latitude2,
int width,
int height,
byte[][] three_state_map)
longitude1 - latitude1 - longitude2 - latitude2 - width - height - three_state_map - noCellsReturned -
public int[][] getOverlapGridCells(double longitude1,
double latitude1,
double longitude2,
double latitude2,
int width,
int height,
byte[][] three_state_map)
public int[][] getOverlapGridCells_Box(double longitude1,
double latitude1,
double longitude2,
double latitude2,
int width,
int height,
double[][] bb,
byte[][] three_state_map,
boolean noCellsReturned)
longitude1 - latitude1 - longitude2 - latitude2 - xres - number of longitude segements as intyres - number of latitude segments as intbb - bounding box as double[2][2] with [][0] as longitude, [][1] as latitude,
[0][] as minimum values, [1][] as maximum values
public static SimpleRegion parseSimpleRegion(java.lang.String pointsString)
pointsString - points separated by ',' with longitude and latitude separated by ':'
public double getWidth()
public double getHeight()
public int getType()
public void saveGridAsImage(byte[][] three_state_map)
public int[][] getOverlapGridCells_Polygon(double longitude1,
double latitude1,
double longitude2,
double latitude2,
int width,
int height,
byte[][] three_state_map,
boolean noCellsReturned)
three_state_map is not null populate it with one of:
GI_UNDEFINED
GI_PARTIALLY_PRESENT
GI_FULLY_PRESENT
GI_ABSENCE
1. Get 3state mask and fill edge passes as 'partial'.
then
3. Test 0,0 then progress across vert raster until finding cells[][] entry
4. Repeat from (3).
longitude1 - latitude1 - longitude2 - latitude2 - xres - number of longitude segements as intyres - number of latitude segments as int
public void getOverlapGridCells_Polygon_Acc(double longitude1,
double latitude1,
double longitude2,
double latitude2,
int width,
int height,
byte[][] three_state_map)
public int[][] fillAccMask(double longitude1,
double latitude1,
double longitude2,
double latitude2,
int width,
int height,
byte[][] three_state_map,
boolean noCellsReturned)
public int[][] getOverlapGridCells_EPSG900913(double longitude1,
double latitude1,
double longitude2,
double latitude2,
int width,
int height,
byte[][] three_state_map,
boolean noCellsReturned)
public void getOverlapGridCells_Acc_EPSG900913(double longitude1,
double latitude1,
double longitude2,
double latitude2,
int width,
int height,
byte[][] three_state_map)
longitude1 - latitude1 - longitude2 - latitude2 - width - height - three_state_map - noCellsReturned -
public int[][] getOverlapGridCells_EPSG900913(double longitude1,
double latitude1,
double longitude2,
double latitude2,
int width,
int height,
byte[][] three_state_map)
public int[][] getOverlapGridCells_Polygon_EPSG900913(double olongitude1,
double olatitude1,
double olongitude2,
double olatitude2,
int owidth,
int oheight,
byte[][] three_state_map,
boolean noCellsReturned)
public void getOverlapGridCells_Polygon_Acc_EPSG900913(double olongitude1,
double olatitude1,
double olongitude2,
double olatitude2,
int owidth,
int oheight,
byte[][] three_state_map)
public int[][] fillAccMask_EPSG900913(double longitude1,
double latitude1,
double longitude2,
double latitude2,
int width,
int height,
byte[][] three_state_map,
boolean noCellsReturned)
public int convertLngToPixel(double lng)
public double convertPixelToLng(int px)
public int convertLatToPixel(double lat)
public double convertPixelToLat(int px)
public double convertMetersToPixels(double meters,
double latitude,
int zoom)
public double convertPixelsToMeters(int pixels,
double latitude,
int zoom)
public double convertMetersToLng(double meters)
public double convertMetersToLat(double meters)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||