50 QString msg =
"Could not create camera or projection for [" +
53 realError.
append(firstError);
54 realError.
append(secondError);
131 double universalLat = lat.
degrees();
132 double universalLon = lon.
degrees();
158 double universalLat = lat.
degrees();
159 double universalLon = lon.
degrees();
316 bool allowEstimation) {
335 poly.
Polys()->clone());
337 geos::geom::Geometry *envelope = footprint->getEnvelope();
338 geos::geom::CoordinateSequence *coords = envelope->getCoordinates();
340 for (
unsigned int i = 0; i < coords->getSize(); i++) {
341 const geos::geom::Coordinate &coord = coords->getAt(i);
346 if (!minLat.
isValid() || minLat > coordLat)
348 if (!maxLat.
isValid() || maxLat < coordLat)
351 if (!minLon.
isValid() || minLon > coordLon)
353 if (!maxLon.
isValid() || maxLon < coordLon)
375 mappingGrp +=
PvlKeyword(
"LatitudeType",
"Planetocentric");
376 mappingGrp +=
PvlKeyword(
"LongitudeDomain",
"360");
377 mappingGrp +=
PvlKeyword(
"LongitudeDirection",
"PositiveEast");
380 mappingPvl += mappingGrp;
386 minLatDouble, maxLatDouble,
387 minLonDouble, maxLonDouble, mappingPvl);
396 if (mappingGrp.
hasKeyword(
"MinimumLatitude") &&
401 minLat =
Latitude(mappingGrp[
"MinimumLatitude"],
403 maxLat =
Latitude(mappingGrp[
"MaximumLatitude"],
405 minLon =
Longitude(mappingGrp[
"MinimumLongitude"],
407 maxLon =
Longitude(mappingGrp[
"MaximumLongitude"],
411 else if (allowEstimation && cube) {
441 int stepsPerLength = 20;
442 double aspectRatio = (double)lineCount / (
double)sampleCount;
443 double xStepSize = sampleCount / stepsPerLength;
444 double yStepSize = xStepSize * aspectRatio;
446 if (lineCount > sampleCount) {
447 aspectRatio = (double)sampleCount / (
double)lineCount;
448 yStepSize = lineCount / stepsPerLength;
449 xStepSize = yStepSize * aspectRatio;
452 double yWalked = 0.5;
455 for (
int i = 0; i < 3; i++) {
456 double xValue = 0.5 + ( i * (sampleCount / 2) );
458 while (yWalked <= lineCount) {
459 imagePoints.append( QPointF(xValue, yWalked) );
460 yWalked += yStepSize;
466 double xWalked = 0.5;
469 for (
int i = 0; i < 3; i++) {
470 double yValue = 0.5 + ( i * (lineCount / 2) );
472 while (xWalked <= sampleCount) {
473 imagePoints.append( QPointF(xWalked, yValue) );
474 xWalked += xStepSize;
480 double xDiagonalWalked = 0.5;
481 double yDiagonalWalked = 0.5;
482 xStepSize = sampleCount / stepsPerLength;
483 yStepSize = lineCount / stepsPerLength;
486 while ( (xDiagonalWalked <= sampleCount) && (yDiagonalWalked <= lineCount) ) {
487 imagePoints.append( QPointF(xDiagonalWalked, yDiagonalWalked) );
488 xDiagonalWalked += xStepSize;
489 yDiagonalWalked += yStepSize;
492 xDiagonalWalked = 0.5;
495 while ( (xDiagonalWalked <= sampleCount) && (yDiagonalWalked >= 0) ) {
496 imagePoints.append( QPointF(xDiagonalWalked, yDiagonalWalked) );
497 xDiagonalWalked += xStepSize;
498 yDiagonalWalked -= yStepSize;
501 foreach (QPointF imagePoint, imagePoints) {
502 if (tproj->
SetWorld(imagePoint.x(), imagePoint.y())) {
508 minLat = qMin(minLat, latResult);
513 maxLat = qMax(maxLat, latResult);
518 minLon = qMin(minLon, lonResult);
523 maxLon = qMax(maxLon, lonResult);
534 minLat < maxLat && minLon < maxLon);
This class defines a body-fixed surface point.
Isis::Camera * p_camera
The camera (if the image has a camera)
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
double Line() const
Returns the current line value of the camera model or projection.
static Isis::Projection * CreateFromCube(Isis::Cube &cube)
This method is a helper method.
ProjectionType projectionType() const
Returns an enum value for the projection type.
double UniversalLatitude() const
Returns the planetocentric latitude, in degrees, at the surface intersection point in the body fixed ...
Base class for Map TProjections.
Isis::Projection * p_projection
The projection (if the image is projected)
~UniversalGroundMap()
Destroys the UniversalGroundMap object.
bool InCube()
This returns true if the current Sample() or Line() value is outside of the cube (meaning the point m...
void append(const IException &exceptionSource)
Appends the given exception (and its list of previous exceptions) to this exception's causational exc...
virtual bool SetUnboundUniversalGround(const double coord1, const double coord2)
This method is used to set the lat/lon or radius/azimuth (i.e.
This class is designed to encapsulate the concept of a Latitude.
double UniversalLongitude()
This returns a universal longitude (positive east in 0 to 360 domain).
double Resolution() const
This method returns the resolution for mapping world coordinates into projection coordinates.
Latitude GetLatitude() const
Return the body-fixed latitude for the surface point.
double degrees() const
Get the angle in units of Degrees.
bool SetGround(Latitude latitude, Longitude longitude)
Sets the lat/lon values to get the sample/line values.
Create cube polygons, read/write polygons to blobs.
bool SetUniversalGround(const double latitude, const double longitude)
Sets the lat/lon values to get the sample/line values.
double WorldX() const
This returns the world X coordinate provided SetGround, SetCoordinate, SetUniversalGround, or SetWorld returned with success.
bool SetImage(const double sample, const double line)
Sets the sample/line values of the image to get the lat/lon values.
This class is designed to encapsulate the concept of a Longitude.
These projections are used to map ring planes.
Degrees are generally considered more human readable, 0-360 is one circle, however most math does not...
Target * target() const
Returns a pointer to the target object.
bool SetUnboundGround(Latitude lat, Longitude lon)
Returns whether the lat/lon position was set successfully in the camera model or projection.
bool SetGround(Latitude lat, Longitude lon)
Returns whether the lat/lon position was set successfully in the camera model or projection.
Contains multiple PvlContainers.
bool GroundRange(double &minlat, double &maxlat, double &minlon, double &maxlon, Pvl &pvl)
Computes the Ground Range.
#define _FILEINFO_
Macro for the filename and line number.
double Sample()
Returns the current sample number.
A single keyword-value pair.
A type of error that cannot be classified as any of the other error types.
double UniversalLatitude() const
Returns the universal latitude of the camera model or projection.
void read(Blob &blob) const
This method will read data from the specified Blob object.
static Camera * Create(Cube &cube)
Creates a Camera object using Pvl Specifications.
ShapeModel * shape() const
Return the shape.
CameraPriority
This enum is used to define whether to use a camera or projection primarily, and which to fall back o...
Container for cube-like labels.
double UniversalLongitude() const
Returns the positive east, 0-360 domain longitude, in degrees, at the surface intersection point in t...
UniversalGroundMap(Cube &cube, CameraPriority priority=CameraFirst)
Constructs a UniversalGroundMap object from a cube.
double UniversalLatitude()
This returns a universal latitude (planetocentric).
double RingRadius() const
This returns a radius.
bool SetWorld(const double x, const double y)
This method is used to set a world coordinate.
bool SetImage(double sample, double line)
Returns whether the sample/line postion was set successfully in the camera model or projection...
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
QString name() const
Gets the shape name.
Longitude GetLongitude() const
Return the body-fixed longitude for the surface point.
Base class for Map Projections of plane shapes.
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
void SetBand(const int band)
Set the image band number.
bool HasCamera()
Returns whether the ground map has a camera or not.
virtual QString fileName() const
Returns the opened cube's filename.
double Line()
Returns the current line number.
virtual bool SetUniversalGround(const double coord1, const double coord2)
This method is used to set the lat/lon or radius/azimuth (i.e.
double PixelResolution()
Returns the pixel resolution at the current position in meters/pixel.
This is the default because cameras are projection-aware.
Namespace for ISIS/Bullet specific routines.
bool SetUniversalGround(double lat, double lon)
Returns whether the lat/lon position was set successfully in the camera model or projection.
bool isValid() const
This indicates whether we have a legitimate angle stored or are in an unset, or invalid, state.
double Sample() const
Returns the current line value of the camera model or projection.
double RingLongitude() const
This returns a ring longitude with correct ring longitude direction and domain as specified in the la...
geos::geom::MultiPolygon * Polys()
Return a geos Multipolygon.
double UniversalLongitude() const
Returns the universal longitude of the camera model or projection.
double Resolution() const
Returns the resolution of the camera model or projection.
ProjectionType
This enum defines the subclasses of Projection supported in Isis.
virtual void SetBand(const int band)
Virtual method that sets the band number.
bool HasProjection()
Returns whether the ground map has a projection or not.
double WorldY() const
This returns the world Y coordinate provided SetGround, SetCoordinate, SetUniversalGround, or SetWorld returned with success.
bool GroundRange(Cube *cube, Latitude &minLat, Latitude &maxLat, Longitude &minLon, Longitude &maxLon, bool allowEstimation=true)
Find the lat/lon range of the image.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
These projections are used to map triaxial and irregular-shaped bodies.
IO Handler for Isis Cubes.