|
Isis 3 Programmer Reference
|
14 #include "IException.h"
19 #include "Projection.h"
20 #include "UniversalGroundMap.h"
22 #include "geos/geom/Coordinate.h"
23 #include "geos/geom/MultiPolygon.h"
24 #include "geos/geom/CoordinateSequence.h"
160 void Create(
Cube &cube,
int sinc = 1,
int linc = 1,
161 int ss = 1,
int sl = 1,
int ns = 0,
int nl = 0,
int band = 1,
162 bool increasePrecision =
false);
164 void Create(std::vector<std::vector<double>> polyCoordinates);
167 int ns = 0,
int nl = 0,
int band = 1);
232 int numVertices()
const {
233 return p_pts->size();
241 bool SetImage(
const double sample,
const double line);
245 geos::geom::Coordinate
FindNextPoint(geos::geom::Coordinate *currentPoint,
246 geos::geom::Coordinate lastPoint,
247 int recursionDepth = 0);
249 double DistanceSquared(
const geos::geom::Coordinate *p1,
const geos::geom::Coordinate *p2);
254 void FixPolePoly(std::vector<geos::geom::Coordinate> *crossingPoints);
257 geos::geom::Coordinate
FindBestPoint(geos::geom::Coordinate *currentPoint,
258 geos::geom::Coordinate newPoint,
259 geos::geom::Coordinate lastPoint);
260 geos::geom::Coordinate
FixCornerSkip(geos::geom::Coordinate *currentPoint,
261 geos::geom::Coordinate newPoint);
263 void FindSubpixel(std::vector<geos::geom::Coordinate> & points);
272 geos::geom::CoordinateSequence *
p_pts;
ImagePolygon()
Constructs a Polygon object, setting the polygon name.
void Incidence(double incidence)
Set the maximum incidence angle ( light contacting the planet )
~ImagePolygon()
Destroys the Polygon object.
geos::geom::Coordinate FixCornerSkip(geos::geom::Coordinate *currentPoint, geos::geom::Coordinate newPoint)
Looks at the next possible point relative to the lasts and attempts to adjust the point outward to gr...
geos::geom::Coordinate * m_topCoord
The cube's top-most valid coord.
int p_sampinc
The increment for walking along the polygon in the sample direction.
bool InsideImage(double sample, double line)
This returns true if sample/line are inside the cube.
int p_subpixelAccuracy
The subpixel accuracy to use.
double validSampleDim()
Retuns the maximum valid sample width of the cube set with either initCube() or Create()
geos::geom::Coordinate FindFirstPoint()
Finds the first point that projects in an image.
int p_cubeLines
The number of lines in the cube.
double validLineDim()
Retuns the maximum valid line width of the cube set with either initCube() or Create()
geos::geom::Coordinate * m_rightCoord
The cube's right-most valid coord.
bool p_ellipsoid
Uses an ellipsoid if a limb is detected.
Blob toBlob() const
Serialize the ImagePolygon to a Blob.
Camera * initCube(Cube &cube, int ss=1, int sl=1, int ns=0, int nl=0, int band=1)
Create a Polygon from given cube.
std::string polyStr() const
Return a geos Multipolygon.
void Create(Cube &cube, int sinc=1, int linc=1, int ss=1, int sl=1, int ns=0, int nl=0, int band=1, bool increasePrecision=false)
Create a Polygon from given cube.
Cube * p_cube
The cube provided.
Create cube polygons, read/write polygons to blobs.
bool p_isProjected
True when the provided cube is projected.
int getSinc() const
Return the sample increment used the create this polygon.
Buffer for containing a three dimensional section of an image.
geos::geom::Coordinate * m_leftCoord
The cube's left-most valid coord.
double p_emission
The maximum emission angle to consider valid.
geos::geom::Coordinate * m_botCoord
The cube's bot-most valid coord.
void WalkPoly()
Walks the image finding its lon lat polygon and stores it to p_pts.
std::string p_polyStr
The string representation of the polygon.
UniversalGroundMap * p_gMap
The cube's ground map.
void SubpixelAccuracy(int div)
The subpixel accuracy to use.
Brick * p_brick
Used to check for valid DNs.
geos::geom::Coordinate FindNextPoint(geos::geom::Coordinate *currentPoint, geos::geom::Coordinate lastPoint, int recursionDepth=0)
Finds the next point on the image using a left hand rule walking algorithm.
double DistanceSquared(const geos::geom::Coordinate *p1, const geos::geom::Coordinate *p2)
Calculates the distance squared between two coordinates.
int p_lineinc
The increment for walking along the polygon in the line direcction.
int p_cubeStartLine
The the line of the first valid point in the cube.
geos::geom::MultiPolygon * p_polygons
The multipolygon of the image.
void Emission(double emission)
Set the maximum emission angle ( light refleted to camera )
int p_cubeStartSamp
The the sample of the first valid point in the cube.
bool SetImage(const double sample, const double line)
Sets the sample/line values of the cube to get lat/lon values.
int getLinc() const
Return the line increment used the create this polygon.
int p_cubeSamps
The number of samples in the cube.
IO Handler for Isis Cubes.
double p_incidence
The maximum incidence angle to consider valid.
void FixPolePoly(std::vector< geos::geom::Coordinate > *crossingPoints)
If the cube crosses the 0/360 boundary and contains a pole, Some points are added to allow the polygo...
bool IsLimb()
Returns True when the input image is a limb image.
void calcImageBorderCoordinates()
Calculates the four border points, particularly for validSampleDim() and validLineDim()
void MoveBackInsideImage(double &sample, double &line, double sinc, double linc)
This method ensures sample/line after sinc/linc have been applied is inside the image.
void FindSubpixel(std::vector< geos::geom::Coordinate > &points)
Takes p_polygons in sample/line space and finds its subpixel accuracy.
void Fix360Poly()
If the cube crosses the 0/360 boundary and does not include a pole, the polygon is separated into mul...
void EllipsoidLimb(bool ellip)
If a limb is detected, use un ellipsoid shape model if true.
geos::geom::Coordinate FindBestPoint(geos::geom::Coordinate *currentPoint, geos::geom::Coordinate newPoint, geos::geom::Coordinate lastPoint)
While walking the image in sample/line space, this function finds the best valid point between the fi...
geos::geom::CoordinateSequence * p_pts
The sequence of coordinates that compose the boundry of the image.
geos::geom::MultiPolygon * Polys()
Return a geos Multipolygon.
This is free and unencumbered software released into the public domain.