OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ossimNewZealandMapGridProjection Class Reference

#include <ossimNewZealandMapGridProjection.h>

Inheritance diagram for ossimNewZealandMapGridProjection:
ossimMapProjection ossimProjection ossimObject ossimErrorStatusInterface ossimReferenced

Public Member Functions

 ossimNewZealandMapGridProjection ()
 
 ~ossimNewZealandMapGridProjection ()
 
virtual ossimObjectdup () const
 
virtual void update ()
 
virtual ossimGpt inverse (const ossimDpt &eastingNorthing) const
 Will take a point in meters and convert it to ground. More...
 
virtual ossimDpt forward (const ossimGpt &latLon) const
 All map projections will convert the world coordinate to an easting northing (Meters). More...
 
void setFalseEasting (double falseEasting)
 
void setFalseNorthing (double falseNorthing)
 
void setFalseEastingNorthing (double falseEasting, double falseNorthing)
 
void setDefaults ()
 
double getFalseEasting () const
 
double getFalseNorthing () const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
- Public Member Functions inherited from ossimMapProjection
 ossimMapProjection (const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
 
 ossimMapProjection (const ossimMapProjection &src)
 
virtual ossimGpt origin () const
 
virtual ossimDpt worldToLineSample (const ossimGpt &worldPoint) const
 
virtual void worldToLineSample (const ossimGpt &worldPoint, ossimDpt &lineSample) const
 
virtual ossimGpt lineSampleToWorld (const ossimDpt &projectedPoint) const
 
virtual void lineSampleToWorld (const ossimDpt &projectedPoint, ossimGpt &gpt) const
 
virtual void lineSampleHeightToWorld (const ossimDpt &lineSampPt, const double &heightAboveEllipsoid, ossimGpt &worldPt) const
 This is the pure virtual that projects the image point to the given elevation above ellipsoid, thereby bypassing reference to a DEM. More...
 
virtual void lineSampleToEastingNorthing (const ossimDpt &liineSample, ossimDpt &eastingNorthing) const
 
virtual void eastingNorthingToLineSample (const ossimDpt &eastingNorthing, ossimDpt &lineSample) const
 
virtual void eastingNorthingToWorld (const ossimDpt &eastingNorthing, ossimGpt &worldPt) const
 
virtual double getStandardParallel1 () const
 Derived classes should implement as needed. More...
 
virtual double getStandardParallel2 () const
 Derived classes should implement as needed. More...
 
virtual void setPcsCode (ossim_uint32 pcsCode)
 
virtual ossim_uint32 getPcsCode () const
 Returns the EPSG PCS code or 32767 if the projection is a custom (non-EPSG) projection. More...
 
virtual ossimString getProjectionName () const
 Returns the projection name. More...
 
virtual double getA () const
 ACCESS METHODS: More...
 
virtual double getB () const
 
virtual double getF () const
 
virtual ossimDpt getMetersPerPixel () const
 
virtual const ossimDptgetDecimalDegreesPerPixel () const
 Returns decimal degrees per pixel as an ossimDpt with "x" representing longitude and "y" representing latitude. More...
 
virtual const ossimDptgetUlEastingNorthing () const
 
virtual const ossimGptgetUlGpt () const
 
virtual const ossimDatumgetDatum () const
 
const ossimEllipsoidgetEllipsoid () const
 
const ossimGptgetOrigin () const
 
virtual bool isGeographic () const
 
virtual void applyScale (const ossimDpt &scale, bool recenterTiePoint)
 Applies scale to theDeltaLonPerPixel, theDeltaLatPerPixel and theMetersPerPixel data members (eg: theDeltaLonPerPixel *= scale.x). More...
 
virtual void setEllipsoid (const ossimEllipsoid &ellipsoid)
 SET METHODS: More...
 
virtual void setAB (double a, double b)
 
virtual void setDatum (const ossimDatum *datum)
 Sets theDatum to datum. More...
 
virtual void setOrigin (const ossimGpt &origin)
 Sets theOrigin to origin. More...
 
virtual void setMetersPerPixel (const ossimDpt &gsd)
 
virtual void setDecimalDegreesPerPixel (const ossimDpt &gsd)
 
virtual void setUlTiePoints (const ossimGpt &gpt)
 
virtual void setUlTiePoints (const ossimDpt &eastingNorthing)
 
virtual void setUlEastingNorthing (const ossimDpt &ulEastingNorthing)
 
virtual void setUlGpt (const ossimGpt &ulGpt)
 
virtual void assign (const ossimProjection &aProjection)
 
virtual std::ostream & print (std::ostream &out) const
 Prints data members to stream. More...
 
virtual bool operator== (const ossimProjection &projection) const
 Compares this to arg projection and returns TRUE if the same. More...
 
virtual void computeDegreesPerPixel ()
 Computes the approximate resolution in degrees/pixel. More...
 
virtual void computeMetersPerPixel ()
 This will go from the ground point and give you an approximate meters per pixel. More...
 
void setMatrix (double rotation, const ossimDpt &scale, const ossimDpt &translation)
 
void setMatrixScale (const ossimDpt &scale)
 
void setMatrixRotation (double rotation)
 
void setMatrixTranslation (const ossimDpt &translation)
 
void snapTiePointTo (ossim_float64 multiple, ossimUnitType unitType)
 Utility method to snap the tie point to some multiple. More...
 
void snapTiePointToOrigin ()
 
void setElevationLookupFlag (bool flag)
 
bool getElevationLookupFlag () const
 
ossimUnitType getModelTransformUnitType () const
 
void setModelTransformUnitType (ossimUnitType unit)
 
bool hasModelTransform () const
 
virtual bool isAffectedByElevation () const
 Implementation of pure virtual ossimProjection::isAffectedByElevation method. More...
 
void setProjectionUnits (ossimUnitType units)
 
ossimUnitType getProjectionUnits () const
 OSSIM considers all map projection coordinates (including false eastings and northings) to be in meters. More...
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
- Public Member Functions inherited from ossimProjection
 ossimProjection ()
 
virtual ~ossimProjection ()
 
virtual void getRoundTripError (const ossimDpt &imagePoint, ossimDpt &errorResult) const
 
virtual void getRoundTripError (const ossimGpt &groundPoint, ossimDpt &errorResult) const
 
virtual void getGroundClipPoints (ossimGeoPolygon &gpts) const
 
virtual bool operator!= (const ossimProjection &projection) const
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getDescription () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual void accept (ossimVisitor &visitor)
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 
- Public Member Functions inherited from ossimErrorStatusInterface
 ossimErrorStatusInterface ()
 
virtual ~ossimErrorStatusInterface ()
 
virtual ossimErrorCode getErrorStatus () const
 
virtual ossimString getErrorStatusString () const
 
virtual void setErrorStatus (ossimErrorCode error_status) const
 
virtual void setErrorStatus () const
 
virtual void clearErrorStatus () const
 
bool hasError () const
 

Protected Member Functions

long Convert_Geodetic_To_NZMG (double Latitude, double Longitude, double *Easting, double *Northing) const
 
long Convert_NZMG_To_Geodetic (double Easting, double Northing, double *Latitude, double *Longitude) const
 
- Protected Member Functions inherited from ossimMapProjection
virtual ~ossimMapProjection ()
 
void updateFromTransform ()
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Protected Attributes

double NZMG_Origin_Lat
 
double NZMG_Origin_Long
 
double NZMG_False_Northing
 
double NZMG_False_Easting
 
double NZMG_a
 
double NZMG_Max_Easting
 
double NZMG_Max_Northing
 
double NZMG_Min_Easting
 
double NZMG_Min_Northing
 
- Protected Attributes inherited from ossimMapProjection
ossimEllipsoid theEllipsoid
 This method verifies that the projection parameters match the current pcs code. More...
 
ossimGpt theOrigin
 
const ossimDatumtheDatum
 This is only set if we want to have built in datum shifting. More...
 
ossimDpt theMetersPerPixel
 Holds the number of meters per pixel. More...
 
ossimDpt theDegreesPerPixel
 Hold the decimal degrees per pixel. More...
 
ossimGpt theUlGpt
 Hold tie point in decimal degrees. More...
 
ossimDpt theUlEastingNorthing
 Hold tie point as easting northing. More...
 
ossimDpt theFalseEastingNorthing
 Hold the false easting northing. More...
 
ossim_uint32 thePcsCode
 Projection Coordinate System(PCS) code. More...
 
bool theElevationLookupFlag
 
ossimMatrix4x4 theModelTransform
 
ossimMatrix4x4 theInverseModelTransform
 
ossimUnitType theModelTransformUnitType
 
ossimUnitType theProjectionUnits
 Linear units of the projection as indicated in the projection's specification: More...
 
- Protected Attributes inherited from ossimErrorStatusInterface
ossimErrorCode theErrorStatus
 

Detailed Description

Definition at line 17 of file ossimNewZealandMapGridProjection.h.

Constructor & Destructor Documentation

◆ ossimNewZealandMapGridProjection()

ossimNewZealandMapGridProjection::ossimNewZealandMapGridProjection ( )

Definition at line 110 of file ossimNewZealandMapGridProjection.cpp.

References setDefaults(), and update().

112  ossimGpt(-41, 173.0))
113 {
114  setDefaults();
115  update();
116 }
static ossimEllipsoidFactory * instance()
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ ~ossimNewZealandMapGridProjection()

ossimNewZealandMapGridProjection::~ossimNewZealandMapGridProjection ( )

Definition at line 118 of file ossimNewZealandMapGridProjection.cpp.

119 {
120 }

Member Function Documentation

◆ Convert_Geodetic_To_NZMG()

long ossimNewZealandMapGridProjection::Convert_Geodetic_To_NZMG ( double  Latitude,
double  Longitude,
double *  Easting,
double *  Northing 
) const
protected

The function Convert_Geodetic_To_NZMG converts geodetic (latitude and longitude) coordinates to New Zealand Map Grid projection (easting and northing) coordinates, according to the current ellipsoid and New Zealand Map Grid projection parameters. If any errors occur, the error code(s) are returned by the function, otherwise NZMG_NO_ERROR is returned.

Latitude : Latitude (phi), in radians (input) Longitude : Longitude (lambda), in radians (input) Easting : Easting (X), in meters (output) Northing : Northing (Y), in meters (output)

Definition at line 260 of file ossimNewZealandMapGridProjection.cpp.

References A, ComplexNumber::imag, M_PI, n, NZMG_NO_ERROR, NZMG_Origin_Lat, NZMG_Origin_Long, and ComplexNumber::real.

Referenced by forward().

265 { /* BEGIN Convert_Geodetic_To_NZMG */
266 /*
267  * The function Convert_Geodetic_To_NZMG converts geodetic (latitude and
268  * longitude) coordinates to New Zealand Map Grid projection (easting and northing)
269  * coordinates, according to the current ellipsoid and New Zealand Map Grid
270  * projection parameters. If any errors occur, the error code(s) are returned
271  * by the function, otherwise NZMG_NO_ERROR is returned.
272  *
273  * Latitude : Latitude (phi), in radians (input)
274  * Longitude : Longitude (lambda), in radians (input)
275  * Easting : Easting (X), in meters (output)
276  * Northing : Northing (Y), in meters (output)
277  */
278 
279  Complex Zeta, z;
280  int n;
281  double dphi;
282  double du, dlam;
283  long Error_Code = NZMG_NO_ERROR;
284 
285 // if ((Latitude < MIN_LAT) || (Latitude > MAX_LAT))
286 // { /* Latitude out of range */
287 // Error_Code|= NZMG_LAT_ERROR;
288 // }
289 // if ((Longitude < MIN_LON) || (Longitude > MAX_LON))
290 // { /* Longitude out of range */
291 // Error_Code|= NZMG_LON_ERROR;
292 // }
293 
294  if (!Error_Code)
295  { /* no errors */
296  dphi = (Latitude * (180.0 / M_PI) - NZMG_Origin_Lat) * 3600.0 * 1.0e-5;
297  du = A[9];
298  for (n = 8; n >= 0; n--)
299  du = du * dphi + A[n];
300  du *= dphi;
301 
302  dlam = Longitude - NZMG_Origin_Long;
303 
304  Zeta.real = du;
305  Zeta.imag = dlam;
306 
307  z.real = B[5].real;
308  z.imag = B[5].imag;
309  for (n = 4; n >= 0; n--)
310  {
311  z = Multiply(z, Zeta);
312  z = Add(B[n], z);
313  }
314  z = Multiply(z, Zeta);
315 
316  *Easting = (z.imag * NZMG_a) + NZMG_False_Easting;
317  *Northing = (z.real * NZMG_a) + NZMG_False_Northing;
318 
319 // if ((*Easting < NZMG_Min_Easting) || (*Easting > NZMG_Max_Easting))
320 // Error_Code |= NZMG_EASTING_ERROR;
321 // if ((*Northing < NZMG_Min_Northing) || (*Northing > NZMG_Max_Northing))
322 // Error_Code |= NZMG_NORTHING_ERROR;
323  }
324  return (Error_Code);
325 } /* END OF Convert_Geodetic_To_NZMG */
#define A(r, c)
#define M_PI
os2<< "> n<< " > nendobj n

◆ Convert_NZMG_To_Geodetic()

long ossimNewZealandMapGridProjection::Convert_NZMG_To_Geodetic ( double  Easting,
double  Northing,
double *  Latitude,
double *  Longitude 
) const
protected

The function Convert_NZMG_To_Geodetic converts New Zealand Map Grid projection (easting and northing) coordinates to geodetic (latitude and longitude) coordinates, according to the current ellipsoid and New Zealand Map Grid projection coordinates. If any errors occur, the error code(s) are returned by the function, otherwise NZMG_NO_ERROR is returned.

Easting : Easting (X), in meters (input) Northing : Northing (Y), in meters (input) Latitude : Latitude (phi), in radians (output) Longitude : Longitude (lambda), in radians (output)

Definition at line 328 of file ossimNewZealandMapGridProjection.cpp.

References ComplexNumber::imag, n, NZMG_a, NZMG_False_Easting, NZMG_False_Northing, NZMG_NO_ERROR, and ComplexNumber::real.

Referenced by inverse().

333 { /* Begin Convert_NZMG_To_Geodetic */
334 /*
335  * The function Convert_NZMG_To_Geodetic converts New Zealand Map Grid projection
336  * (easting and northing) coordinates to geodetic (latitude and longitude)
337  * coordinates, according to the current ellipsoid and New Zealand Map Grid projection
338  * coordinates. If any errors occur, the error code(s) are returned by the
339  * function, otherwise NZMG_NO_ERROR is returned.
340  *
341  * Easting : Easting (X), in meters (input)
342  * Northing : Northing (Y), in meters (input)
343  * Latitude : Latitude (phi), in radians (output)
344  * Longitude : Longitude (lambda), in radians (output)
345  */
346 
347  int i, n;
348  Complex coeff;
349  Complex z, Zeta, Zeta_Numer, Zeta_Denom, Zeta_sqr;
350  double dphi;
351  long Error_Code = NZMG_NO_ERROR;
352 
353 // if ((Easting < NZMG_Min_Easting) || (Easting > NZMG_Max_Easting))
354 // { /* Easting out of range */
355 // Error_Code |= NZMG_EASTING_ERROR;
356 // }
357 // if ((Northing < NZMG_Min_Northing) || (Northing > NZMG_Max_Northing))
358 // { /* Northing out of range */
359 // Error_Code |= NZMG_NORTHING_ERROR;
360 // }
361 
362  if (!Error_Code)
363  { /* no errors */
364  z.real = (Northing - NZMG_False_Northing) / NZMG_a;
365  z.imag = (Easting - NZMG_False_Easting) / NZMG_a;
366 
367  Zeta.real = C[5].real;
368  Zeta.imag = C[5].imag;
369  for (n = 4; n >= 0; n--)
370  {
371  Zeta = Multiply(Zeta, z);
372  Zeta = Add(C[n], Zeta);
373  }
374  Zeta = Multiply(Zeta, z);
375 
376  for (i = 0; i < 2; i++)
377  {
378  Zeta_Numer.real = 5.0 * B[5].real;
379  Zeta_Numer.imag = 5.0 * B[5].imag;
380  Zeta_Denom.real = 6.0 * B[5].real;
381  Zeta_Denom.imag = 6.0 * B[5].imag;
382  for (n = 4; n >= 1; n--)
383  {
384  Zeta_Numer = Multiply(Zeta_Numer, Zeta);
385  coeff.real = n * B[n].real;
386  coeff.imag = n * B[n].imag;
387  Zeta_Numer = Add(coeff, Zeta_Numer);
388 
389  Zeta_Denom = Multiply(Zeta_Denom, Zeta);
390  coeff.real = (n+1) * B[n].real;
391  coeff.imag = (n+1) * B[n].imag;
392  Zeta_Denom = Add(coeff, Zeta_Denom);
393  }
394  Zeta_sqr = Multiply(Zeta, Zeta);
395 
396  Zeta_Numer = Multiply(Zeta_Numer, Zeta_sqr);
397  Zeta_Numer = Add(z, Zeta_Numer);
398 
399  Zeta_Denom = Multiply(Zeta_Denom, Zeta);
400  Zeta_Denom = Add(B[0], Zeta_Denom);
401 
402  Zeta = Divide(Zeta_Numer, Zeta_Denom);
403  }
404  dphi = D[8];
405  for (n = 7; n >= 0; n--)
406  dphi = dphi * Zeta.real + D[n];
407  dphi *= Zeta.real;
408 
409  *Latitude = NZMG_Origin_Lat + (dphi * 1.0e5 / 3600.0);
410  *Latitude *= M_PI / 180.0;
411  *Longitude = NZMG_Origin_Long + Zeta.imag;
412 
413 // if ((*Longitude > M_PI) && (*Longitude - M_PI < 1.0e-6))
414 // *Longitude = M_PI;
415 
416 // if ((*Latitude < MIN_LAT) || (*Latitude > MAX_LAT))
417 // Error_Code|= NZMG_LAT_ERROR;
418 // if ((*Longitude < MIN_LON) || (*Longitude > MAX_LON))
419 // Error_Code|= NZMG_LON_ERROR;
420  }
421  return (Error_Code);
422 } /* END OF Convert_NZMG_To_Geodetic */
#define M_PI
os2<< "> n<< " > nendobj n

◆ dup()

virtual ossimObject* ossimNewZealandMapGridProjection::dup ( ) const
inlinevirtual

Implements ossimProjection.

Definition at line 22 of file ossimNewZealandMapGridProjection.h.

◆ forward()

ossimDpt ossimNewZealandMapGridProjection::forward ( const ossimGpt worldPoint) const
virtual

All map projections will convert the world coordinate to an easting northing (Meters).

Implements ossimMapProjection.

Definition at line 200 of file ossimNewZealandMapGridProjection.cpp.

References ossimGpt::changeDatum(), ossimDatum::code(), Convert_Geodetic_To_NZMG(), ossimGpt::datum(), ossimGpt::latr(), ossimGpt::lonr(), and ossimMapProjection::theDatum.

201 {
202  double easting = 0.0;
203  double northing = 0.0;
204  ossimGpt gpt = latLon;
205 
206  if (theDatum)
207  {
208  if (theDatum->code() != latLon.datum()->code())
209  {
210  gpt.changeDatum(theDatum); // Shift to our datum.
211  }
212  }
213 
215  gpt.lonr(),
216  &easting,
217  &northing);
218 
219  return ossimDpt(easting, northing);
220 }
virtual const ossimString & code() const
Definition: ossimDatum.h:57
void changeDatum(const ossimDatum *datum)
This will actually perform a shift.
Definition: ossimGpt.cpp:316
long Convert_Geodetic_To_NZMG(double Latitude, double Longitude, double *Easting, double *Northing) const
double lonr() const
Returns the longitude in radian measure.
Definition: ossimGpt.h:76
double latr() const
latr().
Definition: ossimGpt.h:66
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.

◆ getFalseEasting()

double ossimNewZealandMapGridProjection::getFalseEasting ( ) const
inlinevirtual
Returns
The false easting.

Reimplemented from ossimMapProjection.

Definition at line 51 of file ossimNewZealandMapGridProjection.h.

◆ getFalseNorthing()

double ossimNewZealandMapGridProjection::getFalseNorthing ( ) const
inlinevirtual
Returns
The false northing.

Reimplemented from ossimMapProjection.

Definition at line 52 of file ossimNewZealandMapGridProjection.h.

◆ inverse()

ossimGpt ossimNewZealandMapGridProjection::inverse ( const ossimDpt projectedPoint) const
virtual

Will take a point in meters and convert it to ground.

Implements ossimMapProjection.

Definition at line 187 of file ossimNewZealandMapGridProjection.cpp.

References Convert_NZMG_To_Geodetic(), DEG_PER_RAD, ossimMapProjection::theDatum, ossimDpt::x, and ossimDpt::y.

188 {
189  double lat = 0.0;
190  double lon = 0.0;
191 
192  Convert_NZMG_To_Geodetic(eastingNorthing.x,
193  eastingNorthing.y,
194  &lat,
195  &lon);
196 
197  return ossimGpt(lat*DEG_PER_RAD, lon*DEG_PER_RAD, 0.0, theDatum);
198 }
#define DEG_PER_RAD
long Convert_NZMG_To_Geodetic(double Easting, double Northing, double *Latitude, double *Longitude) const
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.

◆ loadState()

bool ossimNewZealandMapGridProjection::loadState ( const ossimKeywordlist kwl,
const char *  prefix = 0 
)
virtual

Method to the load (recreate) the state of an object from a keyword list. Return true if ok or false on error.

Reimplemented from ossimMapProjection.

Definition at line 230 of file ossimNewZealandMapGridProjection.cpp.

References ossimKeywordlist::add(), ossimKeywordNames::CENTRAL_MERIDIAN_KW, ossimKeywordNames::DATUM_KW, ossimMapProjection::loadState(), ossimKeywordNames::ORIGIN_LATITUDE_KW, setDefaults(), and update().

232 {
233  ossimKeywordlist newKwl = kwl;
234 
235  // force a New Zealand Datum and the origin of lat and lon
236  // to the New Zealand.
237  newKwl.add(prefix,
239  "GEO",
240  true);
241 
242  newKwl.add(prefix,
244  -41,
245  true);
246 
247  newKwl.add(prefix,
249  173.0,
250  true);
251 
252  setDefaults();
253 
254  ossimMapProjection::loadState(newKwl, prefix);
255  update();
256 
257  return true;
258 }
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
static const char * DATUM_KW
static const char * CENTRAL_MERIDIAN_KW
Represents serializable keyword/value map.
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
static const char * ORIGIN_LATITUDE_KW

◆ saveState()

bool ossimNewZealandMapGridProjection::saveState ( ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Method to save the state of an object to a keyword list. Return true if ok or false on error.

Reimplemented from ossimMapProjection.

Definition at line 222 of file ossimNewZealandMapGridProjection.cpp.

References ossimMapProjection::saveState().

224 {
225  ossimMapProjection::saveState(kwl, prefix);
226 
227  return true;
228 }
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.

◆ setDefaults()

void ossimNewZealandMapGridProjection::setDefaults ( )

Definition at line 142 of file ossimNewZealandMapGridProjection.cpp.

References ossimGpt::latd(), ossimGpt::lond(), ossimGpt::lonr(), NZMG_False_Easting, NZMG_False_Northing, NZMG_Max_Easting, NZMG_Max_Northing, NZMG_Min_Easting, NZMG_Min_Northing, NZMG_Origin_Lat, NZMG_Origin_Long, and ossimMapProjection::theOrigin.

Referenced by loadState(), and ossimNewZealandMapGridProjection().

143 {
144  theOrigin.latd(-41.0);
145  theOrigin.lond(173.0);
146 
147  // origin of lat needs to be in degrees
149 
150  // origin of lon is in radians
152  NZMG_Max_Easting = 3170000.0;
153  NZMG_Max_Northing = 6900000.0;
154  NZMG_Min_Easting = 1810000.0;
155  NZMG_Min_Northing = 5160000.0;
156 
157  NZMG_False_Easting = 2510000.0;
158  NZMG_False_Northing = 6023150.0;
159 }
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
double lonr() const
Returns the longitude in radian measure.
Definition: ossimGpt.h:76

◆ setFalseEasting()

void ossimNewZealandMapGridProjection::setFalseEasting ( double  falseEasting)

SetFalseEasting. The value is in meters. Update is then called so we can pre-compute paramters

Definition at line 122 of file ossimNewZealandMapGridProjection.cpp.

References NZMG_False_Easting, and update().

◆ setFalseEastingNorthing()

void ossimNewZealandMapGridProjection::setFalseEastingNorthing ( double  falseEasting,
double  falseNorthing 
)

Sets both false easting and northing values. The values are expected to be in meters. Update is then called so we can pre-compute paramters

Definition at line 134 of file ossimNewZealandMapGridProjection.cpp.

References NZMG_False_Easting, NZMG_False_Northing, and update().

Referenced by ossimEpsgProjectionDatabase::createProjFromFormatARecord().

◆ setFalseNorthing()

void ossimNewZealandMapGridProjection::setFalseNorthing ( double  falseNorthing)

SetFalseNorthing. The value is in meters. Update is then called so we can pre-compute paramters

Definition at line 128 of file ossimNewZealandMapGridProjection.cpp.

References NZMG_False_Northing, and update().

◆ update()

void ossimNewZealandMapGridProjection::update ( )
virtual

Reimplemented from ossimMapProjection.

Definition at line 161 of file ossimNewZealandMapGridProjection.cpp.

References ossimDatumFactory::create(), ossimDatum::ellipsoid(), ossimEllipsoid::getA(), ossimDatumFactory::instance(), ossimGpt::latd(), ossimGpt::lonr(), NZMG_a, NZMG_False_Easting, NZMG_False_Northing, NZMG_Origin_Lat, NZMG_Origin_Long, ossimNotify(), ossimNotifyLevel_WARN, ossimMapProjection::theDatum, ossimMapProjection::theEllipsoid, ossimMapProjection::theFalseEastingNorthing, ossimMapProjection::theOrigin, ossimMapProjection::update(), ossimDpt::x, and ossimDpt::y.

Referenced by loadState(), ossimNewZealandMapGridProjection(), setFalseEasting(), setFalseEastingNorthing(), and setFalseNorthing().

162 {
163  theOrigin = ossimGpt(-41, 173);
164 
165  // create the new zealand datum.
167 
168  if(theDatum)
169  {
171  }
172  else
173  {
174  ossimNotify(ossimNotifyLevel_WARN) << "WARNING ossimNewZealandMapGridProjection::update(): Was unable to locate the newzealand datum!" << std::endl;
175  }
176 
180 
183 
185 }
virtual const ossimDatum * create(const ossimString &code) const
create method
double y
Definition: ossimDpt.h:165
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
const double & getA() const
double lonr() const
Returns the longitude in radian measure.
Definition: ossimGpt.h:76
virtual const ossimEllipsoid * ellipsoid() const
Definition: ossimDatum.h:60
static ossimDatumFactory * instance()
double x
Definition: ossimDpt.h:164
ossimEllipsoid theEllipsoid
This method verifies that the projection parameters match the current pcs code.
ossimDpt theFalseEastingNorthing
Hold the false easting northing.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.

Member Data Documentation

◆ NZMG_a

double ossimNewZealandMapGridProjection::NZMG_a
mutableprotected

Definition at line 76 of file ossimNewZealandMapGridProjection.h.

Referenced by Convert_NZMG_To_Geodetic(), and update().

◆ NZMG_False_Easting

double ossimNewZealandMapGridProjection::NZMG_False_Easting
mutableprotected

◆ NZMG_False_Northing

double ossimNewZealandMapGridProjection::NZMG_False_Northing
mutableprotected

◆ NZMG_Max_Easting

double ossimNewZealandMapGridProjection::NZMG_Max_Easting
mutableprotected

Definition at line 78 of file ossimNewZealandMapGridProjection.h.

Referenced by setDefaults().

◆ NZMG_Max_Northing

double ossimNewZealandMapGridProjection::NZMG_Max_Northing
mutableprotected

Definition at line 79 of file ossimNewZealandMapGridProjection.h.

Referenced by setDefaults().

◆ NZMG_Min_Easting

double ossimNewZealandMapGridProjection::NZMG_Min_Easting
mutableprotected

Definition at line 80 of file ossimNewZealandMapGridProjection.h.

Referenced by setDefaults().

◆ NZMG_Min_Northing

double ossimNewZealandMapGridProjection::NZMG_Min_Northing
mutableprotected

Definition at line 81 of file ossimNewZealandMapGridProjection.h.

Referenced by setDefaults().

◆ NZMG_Origin_Lat

double ossimNewZealandMapGridProjection::NZMG_Origin_Lat
mutableprotected

◆ NZMG_Origin_Long

double ossimNewZealandMapGridProjection::NZMG_Origin_Long
mutableprotected

The documentation for this class was generated from the following files: