Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Isis 3 Programmer Reference
TProjection.h
1#ifndef TProjection_h
2#define TProjection_h
7
8/* SPDX-License-Identifier: CC0-1.0 */
9#include <vector>
10
11#include "Projection.h"
12#include "PvlGroup.h" // protected data member object (m_mappingGrp)
13
14namespace Isis {
15 class Displacement;
16 class Pvl;
17 class WorldMapper;
165 class TProjection : public Projection {
166 public:
167 // constructor
168 TProjection(Pvl &label);
169 virtual ~TProjection();
170 virtual bool operator== (const Projection &proj);
171
172 double EquatorialRadius() const;
173 double PolarRadius() const;
174 double Eccentricity() const;
175 double LocalRadius(double lat) const;
176 double LocalRadius() const; // requires SetGround or SetCoordinate
177
178 // These return or change properties of the projection, independent of calculations
185 virtual QString Name() const = 0;
186
187
194 virtual QString Version() const = 0;
195 virtual double TrueScaleLatitude() const;
196 virtual bool IsEquatorialCylindrical();
197
198
209
210
211 // Check latitude type or get latitude type as a string
212 bool IsPlanetocentric() const;
213 bool IsPlanetographic() const;
214 QString LatitudeTypeString() const;
215 // change latitude type
216 double ToPlanetocentric(const double lat) const;
217 double ToPlanetographic(const double lat) const;
218
227
228 // Check longitude direction or get longitude direction as a string
229 bool IsPositiveEast() const;
230 bool IsPositiveWest() const;
231 QString LongitudeDirectionString() const;
232
233 // Check longitude domain or get longitude domain as a string
234 bool Has180Domain() const;
235 bool Has360Domain() const;
236 QString LongitudeDomainString() const;
237
238 // Get min/max lat/lon
239 virtual double MinimumLatitude() const;
240 virtual double MaximumLatitude() const;
241 virtual double MinimumLongitude() const;
242 virtual double MaximumLongitude() const;
243
244 // Calculations
245 // Set ground position or x/y coordinate
246 virtual bool SetGround(const double lat, const double lon);
247 virtual bool SetCoordinate(const double x, const double y);
248
249 // Methods that depend on successful completion
250 // of SetGround/SetCoordinate Get lat,lon, x,y
251 virtual double Latitude() const;
252 virtual double Longitude() const;
253
254 // Set the universal ground coordinate (calls SetGround)
255 virtual bool SetUniversalGround(const double lat, const double lon);
256 bool SetUnboundUniversalGround(const double coord1, const double coord2);
257
258 // Return the universal ground coordinate after successful SetCoordinate
259 virtual double UniversalLatitude();
260 virtual double UniversalLongitude();
261
262 // get scale for mapping world coordinates
263 double Scale() const;
264
265 // Return the x/y range which covers the lat/lon range in the labels
266 virtual bool XYRange(double &minX, double &maxX,
267 double &minY, double &maxY);
268
269 // get mapping information
270 virtual PvlGroup Mapping();
271 virtual PvlGroup MappingLatitudes();
272 virtual PvlGroup MappingLongitudes();
273
274 // change latitude type
275 static double ToPlanetocentric(double lat,
276 double eRadius, double pRadius);
277 static double ToPlanetographic(double lat,
278 double eRadius, double pRadius);
279 // change longitude direction
280 static double ToPositiveEast(const double lon, const int domain);
281 static double ToPositiveWest(const double lon, const int domain);
282
283 // change longitude domain
284 static double To180Domain(const double lon);
285 static double To360Domain(const double lon);
286
287 protected:
288 void XYRangeCheck(const double latitude, const double longitude);
289 bool inLongitudeRange(double longitude);
290 bool inLongitudeRange(double minLon, double maxLon, double longitude);
291 bool inLatitudeRange(double latitude);
292 bool xyRangeOblique(double &minX, double &maxX,
293 double &minY, double &maxY);
294
295 // Convience methods for typical projection computations from Snyder
296 double qCompute(const double sinPhi) const; // page 16
297 double phi2Compute(const double t) const; // page 44
298 double mCompute(const double sinphi, const double cosphi) const; // page 101
299 double tCompute(const double phi, const double sinphi) const; //page 108
300 double e4Compute() const; // page 161
301
302 private:
303 void doSearch(double minBorder, double maxBorder,
304 double &extremeVal, const double constBorder,
305 bool searchX, bool searchLongitude, bool findMin);
306 void findExtreme(double &minBorder, double &maxBorder,
307 double &minBorderX, double &minBorderY,
308 double &maxBorderX, double &maxBorderY,
309 const double constBorder, bool searchX,
310 bool searchLongitude, bool findMin);
311 void setSearchGround(const double variableBorder,
312 const double constBorder, bool variableIsLat);
313
314 protected:
315 double m_latitude;
317 double m_longitude;
319
322
328
329 // TODO** Can this be generalized for both longitude and azimuth???
333
350
352
361 private:
362 // These are necessary for calculating oblique X/Y range with
363 // discontinuity
364 std::vector<double> m_specialLatCases;
366 std::vector<double> m_specialLonCases;
368 };
369};
370#endif
371
Displacement is a signed length, usually in meters.
Projection(Pvl &label)
Constructs an empty Projection object.
double m_longitude
This contains the currently set longitude value.
virtual bool SetGround(const double lat, const double lon)
This method is used to set the latitude/longitude (assumed to be of the correct LatitudeType,...
bool xyRangeOblique(double &minX, double &maxX, double &minY, double &maxY)
This method is used to find the XY range for oblique aspect projections (non-polar projections) by "w...
bool SetUnboundUniversalGround(const double coord1, const double coord2)
This method is used to set the latitude/longitude.
bool IsPlanetocentric() const
This indicates if the latitude type is planetocentric (as opposed to planetographic).
double m_minimumLatitude
Contains the minimum latitude for the entire ground range.
virtual bool XYRange(double &minX, double &maxX, double &minY, double &maxY)
This method is used to determine the x/y range which completely covers the area of interest specified...
double m_polarRadius
Polar radius of the target.
std::vector< double > m_specialLatCases
Constant Latitudes that intersect a discontinuity.
double m_maximumLongitude
Contains the maximum longitude for the entire ground range.
static double To180Domain(const double lon)
This method converts a longitude into the -180 to 180 domain.
double m_equatorialRadius
Polar radius of the target.
LongitudeDirection m_longitudeDirection
An enumerated type indicating the LongitudeDirection read from the labels.
virtual PvlGroup MappingLongitudes()
This function returns the longitude keywords that this projection uses.
virtual double MaximumLatitude() const
This returns the maximum latitude of the area of interest.
virtual ~TProjection()
Destroys the TProjection object.
void findExtreme(double &minBorder, double &maxBorder, double &minBorderX, double &minBorderY, double &maxBorderX, double &maxBorderY, const double constBorder, bool searchX, bool searchLongitude, bool findMin)
Searches for extreme (min/max/discontinuity) coordinate values across latitudes/longitudes.
double LocalRadius() const
This method returns the local radius in meters at the current latitude position.
virtual bool SetCoordinate(const double x, const double y)
This method is used to set the projection x/y.
int m_longitudeDomain
This integer is either 180 or 360 and is read from the labels.
double mCompute(const double sinphi, const double cosphi) const
A convience method to compute Snyder's m equation (14-15) for a given latitude, .
double ToPlanetocentric(const double lat) const
This method converts a planetographic latitude to a planetocentric latitude.
bool Has180Domain() const
This indicates if the longitude domain is -180 to 180 (as opposed to 0 to 360).
virtual bool SetUniversalGround(const double lat, const double lon)
This method is used to set the latitude/longitude which must be Planetocentric (latitude) and Positiv...
std::vector< double > m_specialLonCases
Constant Longitudes that intersect a discontinuity.
virtual QString Name() const =0
This method returns the name of the map projection.
void setSearchGround(const double variableBorder, const double constBorder, bool variableIsLat)
This function sets the ground for the given border values.
virtual double MinimumLongitude() const
This returns the minimum longitude of the area of interest.
virtual double UniversalLongitude()
This returns a universal longitude (positive east in 0 to 360 domain).
double PolarRadius() const
This returns the polar radius of the target.
bool inLongitudeRange(double longitude)
Determine whether the given longitude is within the range of the MinimumLongitude and MaximumLongitud...
void XYRangeCheck(const double latitude, const double longitude)
This convience function is established to assist in the development of the XYRange virtual method.
double Eccentricity() const
This returns the eccentricity of the target,.
bool IsPositiveWest() const
This indicates if the longitude direction type is positive east (as opposed to postive west).
QString LongitudeDirectionString() const
This method returns the longitude direction as a string.
bool inLatitudeRange(double latitude)
Determine whether the given latitude is within the range of the MinimumLatitude and MaximumLatitude r...
virtual PvlGroup MappingLatitudes()
This function returns the latitude keywords that this projection uses.
double m_eccentricity
The eccentricity of the target body.
double qCompute(const double sinPhi) const
A convience method to compute Snyder's q equation (3-12) for a given latitude, .
virtual bool operator==(const Projection &proj)
This method determines whether two map projection objects are equal by comparing the equatorial radiu...
double phi2Compute(const double t) const
A convience method to compute latitude angle phi2 given small t, from Syder's recursive equation (7-9...
double m_minimumLongitude
Contains the minimum longitude for the entire ground range.
void doSearch(double minBorder, double maxBorder, double &extremeVal, const double constBorder, bool searchX, bool searchLongitude, bool findMin)
This method searches for extreme (min/max/discontinuity) coordinate values along the constBorder line...
virtual QString Version() const =0
This method returns the Version of the map projection.
double e4Compute() const
A convience method to compute.
double tCompute(const double phi, const double sinphi) const
A convience method to compute Snyder's t equation (15-9) for a given latitude, .
LongitudeDirection
This enum defines the types of Longitude directions supported in this class.
@ PositiveWest
Longitude values increase in the westerly direction.
@ PositiveEast
Longitude values increase in the easterly direction.
double m_maximumLatitude
Contains the maximum latitude for the entire ground range.
virtual double Latitude() const
This returns a latitude with correct latitude type as specified in the label object.
static double ToPositiveWest(const double lon, const int domain)
This method converts a longitude into the positive west direction.
static double To360Domain(const double lon)
This method converts a longitude into the 0 to 360 domain.
TProjection(Pvl &label)
Constructs an empty TProjection object.
QString LongitudeDomainString() const
This method returns the longitude domain as a string.
bool IsPlanetographic() const
This indicates if the latitude type is planetographic (as opposed to planetocentric).
virtual bool IsEquatorialCylindrical()
This method returns true if the projection is equatorial cylindrical.
QString LatitudeTypeString() const
This method returns the latitude type as a string.
bool Has360Domain() const
This indicates if the longitude domain is 0 to 360 (as opposed to -180 to 180).
LatitudeType
This enum defines the types of Latitude supported in this class.
@ Planetocentric
Latitudes are measured as the angle from the equatorial plane to the plane through the center of the ...
@ Planetographic
Latitudes are measured as the angle from the equatorial plane to the normal to the surface of the pla...
virtual double MinimumLatitude() const
This returns the minimum latitude of the area of interest.
LatitudeType m_latitudeType
An enumerated type indicating the LatitudeType read from the labels.
virtual double MaximumLongitude() const
This returns the maximum longitude of the area of interest.
virtual PvlGroup Mapping()
This function returns the keywords that this projection uses.
static double ToPositiveEast(const double lon, const int domain)
This method converts a longitude into the positive east direction.
virtual double UniversalLatitude()
This returns a universal latitude (planetocentric).
double EquatorialRadius() const
This returns the equatorial radius of the target.
bool IsPositiveEast() const
This indicates if the longitude direction type is positive west (as opposed to postive east).
double Scale() const
This method returns the scale for mapping world coordinates into projection coordinates.
virtual double Longitude() const
This returns a longitude with correct longitude direction and domain as specified in the label object...
double ToPlanetographic(const double lat) const
This method converts a planetocentric latitude to a planetographic latitude.
double m_latitude
This contains the currently set latitude value.
virtual double TrueScaleLatitude() const
This method returns the latitude of true scale.
Create a mapping between a projection and other coordinate system.
Definition WorldMapper.h:38
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16