Isis 3 Programmer Reference
|
Seed points using a grid. More...
#include <GridPolygonSeeder.h>
Public Member Functions | |
GridPolygonSeeder (Pvl &pvl) | |
Construct a GridPolygonSeeder algorithm. | |
virtual | ~GridPolygonSeeder () |
Destructor. | |
std::vector< geos::geom::Point * > | Seed (const geos::geom::MultiPolygon *mp) |
Seed a polygon with points. | |
bool | SubGrid () |
virtual PvlGroup | PluginParameters (QString grpName) |
Plugin parameters. | |
double | MinimumThickness () |
Return the minimum allowed thickness of the polygon. | |
double | MinimumArea () |
Return the minimum allowed area of the polygon. | |
QString | Algorithm () const |
The name of the algorithm, read from the Name Keyword in the PolygonSeeder Pvl passed into the constructor. | |
Pvl | InvalidInput () |
This method returns a copy of the Pvl passed in by the constructor (from a def file probably) minus what was used. | |
Protected Member Functions | |
virtual void | Parse (Pvl &pvl) |
Parse the GridPolygonSeeder spicific parameters from the PVL. | |
QString | StandardTests (const geos::geom::MultiPolygon *multiPoly, const geos::geom::Envelope *polyBoundBox) |
Check the polygon to see if it meets standard criteria. | |
Protected Attributes | |
Pvl * | invalidInput |
The Pvl passed in by the constructor minus what was used. | |
Private Member Functions | |
std::vector< geos::geom::Point * > | SeedGrid (const geos::geom::MultiPolygon *mp) |
std::vector< geos::geom::Point * > | SeedSubGrid (const geos::geom::MultiPolygon *mp) |
This method works a lot like SeedGrid, except around the edges of known polygons. | |
geos::geom::Point * | CheckSubGrid (const geos::geom::MultiPolygon &, const double &, const double &, const int &) |
This method is used to search for a valid point, on the polygon, within the square whose center is defined by the centerX, centerY arguments and size is given by p_Xspacing and p_Yspacing. | |
Private Attributes | |
double | p_Xspacing |
double | p_Yspacing |
bool | p_subGrid |
QString | p_algorithmName |
The value for the 'Name' Keyword in the PolygonSeederAlgorithm group of the Pvl that is passed into the constructor. | |
double | p_minimumThickness |
The value for the 'MinimumThickness' Keyword in the PolygonSeederAlgorithm group of the Pvl that is passed into the constructor. | |
double | p_minimumArea |
The value for the 'MinimumArea' Keyword in the PolygonSeederAlgorithm group of the Pvl that is passed into the constructor. | |
Seed points using a grid.
This class is used to construct a grid of points inside a polygon.
2007-05-09 Tracie Sucharski, Changed a single spacing value to a separate value for x and y.
2008-02-29 Steven Lambright - Created SubGrid capabilities, cleaned up Seed methods
2008-06-18 Christopher Austin - Fixed documentation errors
2008-08-18 Christopher Austin - Upgraded to geos3.0.0
2008-11-25 Steven Lambright - Added error checking
2008-12-05 Christopher Austin - capped the subgrid to 127x127 to prevent segfaults on too high a precision
2000-01-30 Steven Lambright - Fixed an issue with not seeding entire polygons when a large portion of the polygon was on the right side of the envelope.
2009-08-05 Travis Addair - Encapsulated group creation for seed definition group
2010-04-15 Eric Hyer - Now updates parent's invalidInput variable
2010-04-20 Christopher Austin - adapted for generic/unitless seeding
Definition at line 48 of file GridPolygonSeeder.h.
Isis::GridPolygonSeeder::GridPolygonSeeder | ( | Pvl & | pvl | ) |
Construct a GridPolygonSeeder algorithm.
pvl | A Pvl object that contains a valid polygon point seeding definition |
Definition at line 29 of file GridPolygonSeeder.cpp.
References Parse().
|
inlinevirtual |
Destructor.
Definition at line 53 of file GridPolygonSeeder.h.
|
inherited |
The name of the algorithm, read from the Name Keyword in the PolygonSeeder Pvl passed into the constructor.
Definition at line 172 of file PolygonSeeder.cpp.
References Isis::PolygonSeeder::p_algorithmName.
Referenced by PluginParameters(), Isis::LimitPolygonSeeder::PluginParameters(), and Isis::StripPolygonSeeder::PluginParameters().
|
private |
This method is used to search for a valid point, on the polygon, within the square whose center is defined by the centerX, centerY arguments and size is given by p_Xspacing and p_Yspacing.
The precision parameter determines how many points are checked. If precision is zero, then only the center is checked. In other cases, the pattern looks like this: 0: ___________________________ | 2 1 2 | | 2 2 2 | | 2 1 2 0 2 1 2 | | 2 2 2 | | 2 1 2 | |___________________________| Where the numbers represent the precision at which the point will be found.
xymp | The multipolygon we're testing for points |
centerX | The X position of the center of the polygon |
centerY | The Y position of the center of the polygon |
precision | See description |
Definition at line 292 of file GridPolygonSeeder.cpp.
Referenced by SeedSubGrid().
|
inherited |
This method returns a copy of the Pvl passed in by the constructor (from a def file probably) minus what was used.
Definition at line 231 of file PolygonSeeder.cpp.
References Isis::PolygonSeeder::invalidInput.
|
inherited |
Return the minimum allowed area of the polygon.
This value is set from the "MinimumArea" keyword in the PVL. The seeding algorithm will not seed polygons that have an area less than this.
Definition at line 195 of file PolygonSeeder.cpp.
References Isis::PolygonSeeder::p_minimumArea.
Referenced by PluginParameters(), Isis::LimitPolygonSeeder::PluginParameters(), Isis::StripPolygonSeeder::PluginParameters(), and Isis::PolygonSeeder::StandardTests().
|
inherited |
Return the minimum allowed thickness of the polygon.
This value is set from the "MinimumThickness" keyword in the PVL. The seeding algorithm will not seed polygons that have a thickness ratio less than this
Definition at line 183 of file PolygonSeeder.cpp.
References Isis::PolygonSeeder::p_minimumThickness.
Referenced by PluginParameters(), Isis::LimitPolygonSeeder::PluginParameters(), Isis::StripPolygonSeeder::PluginParameters(), SeedSubGrid(), and Isis::PolygonSeeder::StandardTests().
|
protectedvirtual |
Parse the GridPolygonSeeder spicific parameters from the PVL.
pvl | The PVL object containing the control parameters for this polygon seeder. |
Reimplemented from Isis::PolygonSeeder.
Definition at line 381 of file GridPolygonSeeder.cpp.
References Isis::PvlObject::findGroup(), Isis::PolygonSeeder::invalidInput, Isis::PolygonSeeder::Parse(), Isis::PvlObject::Traverse, Isis::IString::UpCase(), and Isis::IException::User.
Referenced by GridPolygonSeeder().
|
virtual |
Plugin parameters.
This method will add the PvlKeyword values for algorithm name, minimum thickness, and minimum area of this object to a PvlGroup with the name that is passed in.
grpName | A string containing the PvlGroup name. |
Reimplemented from Isis::PolygonSeeder.
Definition at line 442 of file GridPolygonSeeder.cpp.
References Isis::PolygonSeeder::Algorithm(), Isis::PolygonSeeder::MinimumArea(), Isis::PolygonSeeder::MinimumThickness(), and Isis::toString().
|
virtual |
Seed a polygon with points.
Seed the supplied polygon with points in a grid pattern. The spacing is determined by the PVL group "PolygonSeederAlgorithm"
lonLatPoly | geos::MultiPolygon The polygon to be seeded with points. |
proj | The Projection to seed the polygon into |
Implements Isis::PolygonSeeder.
Definition at line 52 of file GridPolygonSeeder.cpp.
References SeedSubGrid().
|
private |
Definition at line 68 of file GridPolygonSeeder.cpp.
|
private |
This method works a lot like SeedGrid, except around the edges of known polygons.
This method varies in that every grid square around the edge of a found polygon will be searched in more depth than all other grid squares.
lonLatPoly | |
proj |
Every square in the grid needs to be monitored, we'll need to know if: (a) center needs checked - pointShouldCheck (b) entire square needs checked using precision, next to found pt - pointShouldSubGridCheck (c) A point was found in the square - pointFound (d) The center of the square is not found, but the square hasnt been checked in depth - pointNotFound (e) The square has been checked in depth and no valid points found - pointCantFind
This is a pretty good equation for how much precision is to be used in the in-depth checks around the edges of polygons.
Thickness * Depth^2 <= 0.5 (0.5 is a constant, the larger the more precision to be used) Depth^2 <= 0.5/Thickness Depth <= (0.5/Thickness)^0.5
Definition at line 124 of file GridPolygonSeeder.cpp.
References CheckSubGrid(), Isis::PolygonSeeder::MinimumThickness(), and Isis::PolygonSeeder::StandardTests().
Referenced by Seed().
|
protectedinherited |
Check the polygon to see if it meets standard criteria.
xymp | The multipoly containing the coordinates in x/y units instead of lon/lat |
xyBoundBox | The bounding box of the multipoly |
Definition at line 146 of file PolygonSeeder.cpp.
References Isis::PolygonSeeder::MinimumArea(), Isis::PolygonSeeder::MinimumThickness(), and Isis::toString().
Referenced by Isis::LimitPolygonSeeder::Seed(), Isis::StripPolygonSeeder::Seed(), and SeedSubGrid().
|
inline |
Definition at line 57 of file GridPolygonSeeder.h.
|
protectedinherited |
The Pvl passed in by the constructor minus what was used.
Definition at line 78 of file PolygonSeeder.h.
Referenced by Isis::PolygonSeeder::InvalidInput(), Parse(), Isis::LimitPolygonSeeder::Parse(), Isis::PolygonSeeder::Parse(), Isis::StripPolygonSeeder::Parse(), Isis::PolygonSeeder::PolygonSeeder(), and Isis::PolygonSeeder::~PolygonSeeder().
|
privateinherited |
The value for the 'Name' Keyword in the PolygonSeederAlgorithm group of the Pvl that is passed into the constructor.
Definition at line 82 of file PolygonSeeder.h.
Referenced by Isis::PolygonSeeder::Algorithm(), Isis::PolygonSeeder::operator=(), Isis::PolygonSeeder::Parse(), Isis::PolygonSeeder::PluginParameters(), Isis::PolygonSeeder::PolygonSeeder(), and Isis::PolygonSeeder::PolygonSeeder().
|
privateinherited |
The value for the 'MinimumArea' Keyword in the PolygonSeederAlgorithm group of the Pvl that is passed into the constructor.
Definition at line 89 of file PolygonSeeder.h.
Referenced by Isis::PolygonSeeder::MinimumArea(), Isis::PolygonSeeder::operator=(), Isis::PolygonSeeder::Parse(), Isis::PolygonSeeder::PluginParameters(), and Isis::PolygonSeeder::PolygonSeeder().
|
privateinherited |
The value for the 'MinimumThickness' Keyword in the PolygonSeederAlgorithm group of the Pvl that is passed into the constructor.
Definition at line 85 of file PolygonSeeder.h.
Referenced by Isis::PolygonSeeder::MinimumThickness(), Isis::PolygonSeeder::operator=(), Isis::PolygonSeeder::Parse(), Isis::PolygonSeeder::PluginParameters(), and Isis::PolygonSeeder::PolygonSeeder().
|
private |
Definition at line 76 of file GridPolygonSeeder.h.
|
private |
Definition at line 74 of file GridPolygonSeeder.h.
|
private |
Definition at line 75 of file GridPolygonSeeder.h.