This file is indexed.

/usr/include/terralib/kernel/TeProjection.h is in libterralib-dev 4.3.0+dfsg.2-4build2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
/************************************************************************************
TerraLib - a library for developing GIS applications.
Copyright  2001-2007 INPE and Tecgraf/PUC-Rio.

This code is part of the TerraLib library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

You should have received a copy of the GNU Lesser General Public
License along with this library.

The authors reassure the license terms regarding the warranties.
They specifically disclaim any warranties, including, but not limited to,
the implied warranties of merchantability and fitness for a particular purpose.
The library provided hereunder is on an "as is" basis, and the authors have no
obligation to provide maintenance, support, updates, enhancements, or modifications.
In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
indirect, special, incidental, or consequential damages arising out of the use
of this library and its documentation.
*************************************************************************************/
/*! \file TeProjection.h
    \brief This file contains support do deal with geographical projections
*/

#ifndef  __TERRALIB_INTERNAL_PROJECTION_H
#define  __TERRALIB_INTERNAL_PROJECTION_H

#include "TeCoord2D.h"
#include "TeDefines.h"
#include "TeDatum.h"

#include <stdio.h>
#include <map>
#include <string>

using namespace std;

//! Earth hemispheres 
enum TeHemisphere
{ TeNORTH_HEM, TeSOUTH_HEM };

//! Number of supported projections in TerraLib
const int NUM_PROJ = 12; 

//! Set of informations required by projections
struct TL_DLL TeProjInfo 
{
	int hasUnits;
	int hasLon0;
	int hasLat0;
	int hasStlat1;
	int hasStlat2;
	int hasScale;
	int hasOffx;
	int hasOffy;
};

//! A map from name of projections to a set of informations that it requires
typedef map<string,TeProjInfo> TeProjInfoMap;

//! Returns the set of informations required by a given projection
TL_DLL TeProjInfo TeProjectionInfo ( const string& projName  );

TL_DLL const char** TeGetProjInfo();

// ============ PROJECTION PARAMETERS ===============

class TeProjection;

//FAMI Added Satellite parameters
//! Set of parameters that define a geographical projection
struct TL_DLL TeProjectionParams
{
	string	name;	     //!< projection name
	TeDatum datum;       //!< spheroid
        double	lon0;	     //!< Longitude of origin (rad)
	double  lat0;	     //!< Latitude of origin (rad)  
	double	offx;	     //!< X (projection coordinate) offset (m)
	double	offy;	     //!< Y (projection coordinate) offset (m)
	double	stlat1;	     //!< First standard parallel (rad)
	double  stlat2;      //!< Second standard paralel (rad)
	string  units;       //!< units
	double  scale;       //!< projection scale (used in UTM)
	TeHemisphere hemisphere; //!< Hemisphere
	double  pri;         //!< Sensor angle resolution along y axis (rad) (used in Satellite)
	double  prj;         //!< Sensor angle resolution along x axis (rad) (used in Satellite)
	double  pis;         //!< Y-coordinate of sub-satellite point (used in Satellite)
	double  pjs;         //!< X-coordinate of sub-satellite point (used in Satellite)
	double  prs;         //!< Radius of satellite orbit (m) (used in Satellite)
	double  pscn;        //!< Scanning mode: 0-WE/NS, 1-SN/EW (used in Satellite)
	double  pyaw;        //!< Grid orientation, i.e., angle in radians between the increasing y axis and the meridian of the sub-satellite point along the direction of increasing latitude (used in Satellite)

};

//========== PROJECTION FACTORY
//! A factory of projections
class TL_DLL TeProjectionFactory 
{
public:
  static TeProjection* make( const TeProjectionParams& );
  static TeProjection* make(int epsgCode);
};

//!  Provides methods that are required to handle all map projection definitions and georeferencing of satellite images.
/*!
  Specifies earth and projection parameters that represent a common
  ground in terms of defining conventional map projections, navigating
  on low-resolution images of geostationary satellites.
*/
class TL_DLL TeProjection 
{
protected:
	string	GPname;	             // projection name
	TeDatum GPdatum;             // spheroid
	double	GPlon0;	             // Longitude of origin (rad)
	double  GPlat0;	             // Latitude of origin (rad)  
	double	GPoffx;	             // X (projection coordinate) offset (m)
	double	GPoffy;	             // Y (projection coordinate) offset (m)
	double	GPstlat1;            // First standard parallel (rad)
	double  GPstlat2;            // Second standard parallel (rad)
	string  GPunits;             // units
	double  GPscale;             // scale (used for UTM)
	TeHemisphere  GPhemisphere;  // Hemisphere
	TeProjection* GPdestination; // destination projection
	int	      GPid;          // id
    int		GPepsgCode;

	//! Changes planimetic datum
	/*!	Computes changes in geodetic coordinates due to
		planimetric datum changes. First, the method finds
		geocentric cartesian coordinates on the initial datum,
		then applies datum shifts, and finally computes the
		new geodetic coordinates on the final datum. The new
		geodetic latitude is computed iteractively, the old
		geodetic latitude being used as initial guess.
		
		\param	x	Initial longitude (rad);
		\param	y	Initial latitude (rad).
		\return x	Final longitude (rad);
		\return y	Final latitude (rad).
		
		\note
			x must be a valid longitude ([0,pi] or [0,-pi]) and
			y must be a valid latitude ([0,pi/2] or [0,-pi/2]).
	*/
	void 	ChangeLL (double &x, double &y); 

public:

	//! Normal constructor
	/*!	
		Initializes projection parameters 
		\param name			projection name
		\param datum		spheroid
		\param lon0			longitude of origin (in radians)
		\param lat0			latitude of origin (in radians)  
		\param offx			X (projection coordinate) offset (m)
		\param offy 		Y (projection coordinate) offset (m)
		\param stlat1		first standard parallel (in radians)
		\param stlat2		second standard parallel (in radians)
		\param units		projection unit
		\param scale		scale (used for UTM)
		\param hem			hemisphere
	*/
	TeProjection ( const string& name, const TeDatum& datum,
		double lon0 = 0., double lat0=0., double offx = 0., double offy = 0.,
		double stlat1 = 0., double stlat2 = 0., 
		const string units = "Meters",
		double scale = 1., TeHemisphere hem = TeSOUTH_HEM, int epsgcode = 99999):
		GPname   ( name ),
		GPdatum  ( datum ),
	    GPlon0   ( lon0 ),
	    GPlat0   ( lat0  ),
	    GPoffx   ( offx  ),
	    GPoffy   ( offy ),
	    GPstlat1 ( stlat1 ),
	    GPstlat2 ( stlat2 ),
	    GPunits  ( units ),
	    GPscale  ( scale ),
	    GPhemisphere ( hem ),
		GPdestination (0),
		GPid(0),
        GPepsgCode(epsgcode)
		{}

		TeProjection ():
		GPname   ( "NoProjection" ),
	    GPlon0   ( 0. ),
	    GPlat0   ( 0. ),
	    GPoffx   ( 0. ),
	    GPoffy   ( 0. ),
	    GPstlat1 ( 0. ),
	    GPstlat2 ( 0. ),
	    GPunits  ( "Units" ),
	    GPscale  ( 1 ),
	    GPhemisphere ( TeSOUTH_HEM ),
		GPdestination (0),
		GPid(0),
		GPepsgCode(99999)
	{}

	//! Copy Constructor
	TeProjection(const TeProjection&);

	//! Operator =
	TeProjection& operator=(const TeProjection&);

	//!	Destructor.
	virtual ~TeProjection (){}

	//! Returns the projection name;
	string& name() 
	{ return GPname; }

	//! Returns the projection datum
	TeDatum datum()
	{ return GPdatum; }

	//! Sets the datum associated to the projection 
	void setDatum(const TeDatum& datum)
	{	GPdatum = datum; }

	//! Return the projection units 
	string& units()
	{ return GPunits; }

	//! Return the longitude of origin ( in rad)
	double	lon0() { return GPlon0;	}
	
	//! Return the Latitude of origin (rad)
	double  lat0() { return GPlat0;	}	  

	//! Return  X (projection coordinate) offset (m)
	double	offX() { return GPoffx; }	 
    
	//! Return  Y (projection coordinate) offset (m)
	double	offY() { return GPoffy;	 }
    
	//!  Return First standard parallel (rad)
	double	stLat1() { return GPstlat1; }
	
	//! Return the second standard parallel (rad)
	double  stLat2() { return GPstlat2; }
	
	//! Return the scale (used for UTM)
	double  scale()  { return GPscale;   }
	
	int epsgCode();

	//! Return the  Hemisphere
	TeHemisphere hemisphere() {	return GPhemisphere; }
		
	// Returns a the parameters of this projection
	virtual TeProjectionParams params () const; //FAMI

	bool operator== (const TeProjection& proj);

	//!	Pure virtual method that transforms geodetic into projection coordinates
	/*!		
		This method is implemented for each available
		projection class and represents the so-called
		direct formulas, which compute projection 
		coordinates from geodetic coordinates.
		 
		\param	p 	Geodetic coordinates (radian).
		\return p  	Projection coordinates (m).
		\note
			Geodetic coordinates must be a valid latitude
			([0,pi/2] or [0,-pi/2]) and a valid longitude
			([0,pi] or [0,-pi]).
	*/
	virtual	TeCoord2D LL2PC (const TeCoord2D& p) = 0;
	virtual	void	  LL2PC (ostream&) const {} //FAMI

	//! Pure virtual method that transforms projection into geodetic coordinates.
	/*!
		This method is implemented for each available
		projection class and represents the so-called
		inverse formulas, which compute geodetic
		coordinates from projection coordinates.
		\param p 	Projection coordinates (m).
		\return p	Geodetic coordinates (rad).
		\note X and Y projection coordinates must be both valid,
		 within the typical range of each projection class.
	*/
	virtual	TeCoord2D	PC2LL (const TeCoord2D& p) = 0;

	virtual	void LL2PC (double, double, double&, double&) const {printf("\nWRONG"); return;} //FAMI
	virtual	void PC2LL (double, double, double&, double&) {printf("\nWRONG"); return;} //FAMI

	//!	Sets the projection to which a Latitude/Longitude value will be generated by the current projection by calling changeLL in PC2LL method
	void setDestinationProjection (TeProjection* proj)
	{ GPdestination = proj; }
	
	//! Concrete method that prints information about a projection
	void print ( FILE* file_ );

	//! Concrete method that prints information about a projection in a string
	string describe ();

	//! Get projection unique id in the database
	int	id() { return GPid;}

	//! Set projection unique id in the database
	void id(int i) { GPid = i;}
};


//!  Provides methods that are required to handle the UTM map projection.
/*!
	  Specifies methods that are necessary to establish the relation between
	  geodetic and UTM coordinates. UTM is a conformal projection system that
	  uses the planimetric datum Sad69 or Corrego Alegre  (Hayford ellipsoid).

	 \sa TeCoord2D TeDatum TeProjection.
*/
class TL_DLL TeUtm : public TeProjection
{
public:

	//! Constructor
	/*!	
		Initializes projection parameters 
		\param datum		spheroid
		\param long0		longitude of origin (in radians)
		\param lat0		latitude of origin (in radians)  
		\param offx		X (projection coordinate) offset (m)
		\param offy 		Y (projection coordinate) offset (m)
		\param units		projection unit
		\param scale		scale (used for UTM)
		\param hemisphere	hemisphere
	*/
	TeUtm ( const TeDatum& datum, double long0, double lat0 = 0., 
		     double offx = 500000., double offy = 10000000., 
			 const string& units = "Meters",
			 double scale = 0.9996, TeHemisphere hemisphere = TeSOUTH_HEM );
	//! Destructor
	~TeUtm () {}

	//! This implementation of a pure virtual method defined in Projection transforms geodetic into UTM coordinates.
	/*!		 
		\param	p	Geodetic coordinates (rad).
		\return	p:	UTM coordinates (m).
		\note
			Geodetic coordinates must be a valid latitude
			([0,pi/2] or [0,-pi/2]) and a valid longitude
			([0,pi] or [0,-pi]). Conventional UTM offsets
			(500,000 m and 10,000,000 m) are always added
			to the resulting projection coordinates.
	*/
	virtual TeCoord2D LL2PC(const TeCoord2D& p);

	//!	This implementation of a pure virtual method defined in
	/*	Projection transforms UTM into geodetic coordinates.
		\param p:	UTM coordinates (m).
		\return p:	Geodetic coordinates (rad).
		\note
		X and Y UTM coordinates must be both valid, within
		their typical range. Conventional UTM offsets are
		handled in this method, and therefore must not be 
		previously subtracted.
	*/
	virtual TeCoord2D PC2LL(const TeCoord2D& p);
};

//!  Provides methods that are required to handle Lambert conformal conic map projection..
/*!
  Specifies methods that are necessary to establish the relation between
  geodetic and Lambert conformal conic coordinates. 
  \sa TeCoord2D TeDatum TeProjection.
*/
class TL_DLL TeLambertConformal : public TeProjection
{
public :
	//! Constructor
	/*!	
		Initializes projection parameters 
		\param datum		spheroid
		\param long0		longitude of origin (in radians)
		\param lat0		latitude of origin (in radians)  
		\param offx		X (projection coordinate) offset (m)
		\param offy 		Y (projection coordinate) offset (m)
		\param stlat1		first standard parallel (in radians)
		\param stlat2		second standard parallel (in radians)
		\param units		projection unit
	*/
	TeLambertConformal ( const TeDatum& datum, 
		                 double long0,
			             double lat0, 
						 double offx, 
						 double offy,
						 double stlat1, 
						 double stlat2, 
						 const string& units = "Meters" ):
	TeProjection ( "LambertConformal", datum, long0, lat0, offx, offy, stlat1, stlat2, units, 1., TeSOUTH_HEM, 9802)
	{}

	//! Destructor
	~TeLambertConformal () {}


	virtual TeCoord2D LL2PC(const TeCoord2D& p);

	virtual	TeCoord2D PC2LL(const TeCoord2D& p);
};

//!  Provides methods that are required to handle the Mercator map projection.
/*! 
  Specifies methods that are necessary to establish the relation between
  geodetic and Mercator coordinates.  
*/
class TL_DLL TeMercator : public TeProjection
{

public:
	//! Constructor
	/*!	
		Initializes projection parameters 
		\param datum		spheroid
		\param long0			longitude of origin (in radians)
		\param lat0			latitude of origin (in radians)  
		\param offx			X (projection coordinate) offset (m)
		\param offy 		Y (projection coordinate) offset (m)
		\param stlat1		first standard parallel (in radians)
		\param units		projection unit
	*/
	TeMercator ( const TeDatum& datum,  
		         double long0, 
				 double lat0 = 0.,
				 double offx = 0., 
				 double offy = 0.,
				 double stlat1 = 0.,
				 const string& units = "Meters"): 
	TeProjection ( "Mercator", datum, long0, lat0, offx, offy, stlat1, 0., units,1., TeSOUTH_HEM, 9805)
	{}

	//! Destructor
	~TeMercator () {}

	virtual TeCoord2D LL2PC(const TeCoord2D& p);

	virtual TeCoord2D PC2LL(const TeCoord2D& p);

};



//! Provides methods that are required to handle the Polyconic map projection.
/*!  
	Specifies methods that are necessary to establish the relation between
    geodetic and Polyconic coordinates. Polyconic is a projection system that
    is neither conformal nor equal-area. 
*/  
class TL_DLL TePolyconic : public TeProjection
{
public:
	//! Constructor
	/*!	
		Initializes projection parameters 
		\param datum		spheroid
		\param long0			longitude of origin (in radians)
		\param lat0			latitude of origin (in radians)  
		\param offx			X (projection coordinate) offset (m)
		\param offy 		Y (projection coordinate) offset (m)
		\param units		projection unit
	*/
	TePolyconic (const TeDatum& datum,  
		         double long0, 
				 double lat0 = 0.,
				 double offx = 0., 
				 double offy = 0.,
				 const string& units = "Meters");
	
	//! Destructor
	~TePolyconic () {}


	virtual TeCoord2D LL2PC(const TeCoord2D& p);

	virtual TeCoord2D PC2LL(const TeCoord2D& p);
};

//!  Provides methods that are required to handle the Equidistant Cylindrical  map projection.
class TL_DLL TeLatLong : public TeProjection
{

public :
	//! Constructor
	/*!	
		Initializes projection parameters 
		\param datum		spheroid
		\param units		projection unit
	*/
	TeLatLong( const TeDatum& datum, const string& units = "DecimalDegrees" );

	//! Destructor
	~TeLatLong () {}

	//! Returns the same coordinate
	virtual TeCoord2D LL2PC(const TeCoord2D& p);

	//! Returns the same coordinate
	virtual TeCoord2D PC2LL(const TeCoord2D& p);

	virtual void LL2PC(double xi, double yi, double& xo, double& yo) const; //FAMI
	virtual void PC2LL(double xi, double yi, double& xo, double& yo); //FAMI

};

//!  Provides methods that are required to handle the Albers Conic map  projection.
/*
  Specifies methods that are necessary to establish the relation between
  geodetic and Albers Conic coordinates. Albers Conic is an equal-area
  projection system. 
*/
class TL_DLL TeAlbers : public TeProjection
{
public:
	//! Constructor
	/*!	
		Initializes projection parameters 
		\param datum		spheroid
		\param lon0			longitude of origin (in radians)
		\param lat0			latitude of origin (in radians)  
		\param offx			X (projection coordinate) offset (m)
		\param offy 		Y (projection coordinate) offset (m)
		\param stlat1		first standard parallel (in radians)
		\param stlat2		second standard parallel (in radians)
		\param units		projection unit
	*/
	TeAlbers( const TeDatum& datum, 
		      double lon0,
			  double lat0, 
			  double offx, 
			  double offy,
			  double stlat1, 
			  double stlat2, 
			  const string& units = "Meters" ):
		TeProjection ( "Albers", datum, lon0, lat0, offx, offy, stlat1, stlat2, units, 1, TeSOUTH_HEM, 9822 )
	{} 

	//! Destructor
	~TeAlbers () { }

	virtual TeCoord2D LL2PC(const TeCoord2D& p);

	virtual TeCoord2D PC2LL(const TeCoord2D& p);
};

//!  Provides methods that are required to handle the Miller map projection.
/*!
  Specifies methods that are necessary to establish the relation between
  geodetic and Miller coordinates. Miller is a projection system that
  is neither conformal nor equal-area."
*/
class TL_DLL TeMiller : public TeProjection	
{
public:
	//! Constructor
	/*!	
		Initializes projection parameters 
		\param datum		spheroid
		\param long0		longitude of origin (in radians)
		\param offx			X (projection coordinate) offset (m)
		\param offy 		Y (projection coordinate) offset (m)
		\param units		projection unit
	*/
	TeMiller ( const TeDatum& datum,  
		         double long0, 
				 double offx = 0., 
				 double offy = 0.,
				 const string& units = "Meters"): 
	TeProjection ( "Miller", datum, long0, 0., offx, offy, 0., 0., units )
	{}

	//! Destructor
	~TeMiller () {}

	virtual TeCoord2D LL2PC(const TeCoord2D& p);

	virtual TeCoord2D PC2LL(const TeCoord2D& p);

};

//! Provides methods that are required to handle the Sinusoidal map projection.
/*!
  Specifies methods that are necessary to establish the relation between
  geodetic and Sinusoidal coordinates. Sinusoidal is a projection system that
  is equal-area. Being not an interrupted form, 
  this implementation assumes a single central meridian. Spheroid options 
  can be redefined by editing the file "TeDatum.cpp"
*/
class TL_DLL TeSinusoidal : public TeProjection	
{
public:

//!	Constructor.
	/*!	
		Initializes projection parameters 
		\param datum		spheroid
		\param long0		longitude of origin (in radians)
		\param offx			X (projection coordinate) offset (m)
		\param offy 		Y (projection coordinate) offset (m)
		\param units		projection unit
	*/
	TeSinusoidal (const TeDatum& datum,  
		         double long0, 
				 double offx = 0., 
				 double offy = 0.,
				 const string& units = "Meters"): 
	TeProjection ( "Sinusoidal", datum, long0, 0., offx, offy, 0., 0., units )
	{}

//! Empty destructor.
	~TeSinusoidal () {}

	virtual TeCoord2D LL2PC(const TeCoord2D& p);

	virtual TeCoord2D PC2LL(const TeCoord2D& p);
};

//! Provides methods that are required to handle the Cylindrical Equidistant map projection
class TL_DLL TeCylindricalEquidistant : public TeProjection
{
public:

//!	Constructor.
	/*!	
		Initializes projection parameters 
		\param datum		spheroid
		\param lon0			longitude of origin (in radians)
		\param offx			X (projection coordinate) offset (m)
		\param offy 		Y (projection coordinate) offset (m)
		\param stlat1		first standard parallel (in radians)
		\param units		projection unit
	*/
	TeCylindricalEquidistant (const TeDatum& datum,  
		         double lon0, 
				 double offx = 0., 
				 double offy = 0.,
				 double stlat1 = 0.,
				 const string& units = "Meters");
//! Empty destructor.
	~TeCylindricalEquidistant () {}

	virtual TeCoord2D LL2PC(const TeCoord2D& p);

	virtual TeCoord2D PC2LL(const TeCoord2D& p);
};

//! Provides methods that are required to handle the Polar Stereographic map projection
class TL_DLL TePolarStereographic : public TeProjection
{
public:
	//! Constructor
	/*!	
		Initializes projection parameters 
		\param datum		spheroid
		\param lon0			longitude of origin (in radians)
		\param offx			X (projection coordinate) offset (m)
		\param offy 		Y (projection coordinate) offset (m)
		\param units		projection unit
		\param hem	hemisphere
	*/
	TePolarStereographic ( const TeDatum& datum,  
		         double lon0,  
				 double offx = 0., 
				 double offy = 0.,
				 const string& units = "Meters",
				 const TeHemisphere hem = TeSOUTH_HEM );

	//! Destructor
	~TePolarStereographic () {}

	virtual TeCoord2D LL2PC(const TeCoord2D& p);
	virtual	void	LL2PC (ostream&) const; //FAMI
	virtual TeCoord2D PC2LL(const TeCoord2D& p);

	virtual void LL2PC(double xi, double yi, double& xo, double& yo) const; //FAMI
};

//FAMI
class TL_DLL TeSatelliteProjection : public TeProjection
{

private:
	
	double	SPri,	// Sensor angle resolution along y axis in radians
		SPrj,	// Sensor angle resolution along x axis in radians
		SPis,	// Y-coordinate of sub-satellite point 
		SPjs,	// X-coordinate of sub-satellite point
	        SPrs,   // Radius of satellite orbit in meters
		SPscn,	// Scanning mode: 0-WE/NS, 1-SN/EW
		SPyaw;  // Grid orientation, i.e., angle in radians between
			// the increasing y axis and the meridian of the
			// sub-satellite point along the direction of
			// increasing latitude.
public:

	//! Constructor
	/*
		\param datum: 	planimetric datum
		\param offx: 	x offset
		\param offy: 	y offset
		\param Pri:     Sensor angle resolution along y axis in radians
		\param Prj: 	Sensor angle resolution along x axis in radians
		\param Pis:     Y-coordinate of sub-satellite point 
		\param Pjs: 	X-coordinate of sub-satellite point
		\param Pla0: 	Latitude of sub-satellite point in radians
		\param Plo0: 	Longitude of sub-satellite point in radians
		\param Prs: 	Radius of satellite orbit in meters
		\param Pscn: 	Scanning mode: 0-WE/NS, 1-SN/EW
		\param Pyaw: 	Grid orientation, i.e., angle in radians between
				the increasing y axis and the meridian of the
				sub-satellite point along the direction of
				increasing latitude.
		*/
	TeSatelliteProjection(const TeDatum& datum, double offx, double offy,  
			      double Pri, double Prj, double Pis, double Pjs, double Pla0, double Plon0, 
			      double Prs,double Pscn, double Pyaw):
			TeProjection("Satellite", datum, Plon0, Pla0, offx, offy, 0., 0.,"Meters",1.,TeSOUTH_HEM),
			SPri(Pri),
			SPrj(Prj),
			SPis(Pis),
			SPjs(Pjs),		
			SPrs(Prs),
			SPscn(Pscn),
			SPyaw(Pyaw)	{}

	~TeSatelliteProjection() {}

	virtual TeCoord2D LL2PC(const TeCoord2D& p);

	virtual	TeCoord2D PC2LL(const TeCoord2D& p);

	// Returns a the parameters of this projection
	virtual TeProjectionParams params () const;
};

class TL_DLL TeNoProjection : public TeProjection
{
public:
	TeNoProjection(const TeDatum& datum = TeDatum(), const string& units = "Units"):
		TeProjection ( "NoProjection", datum, 0., 0., 0., 0., 0, 0, units, 1, TeSOUTH_HEM )

	{	GPname = "NoProjection", GPunits = units; }

		~TeNoProjection () {}

		virtual TeCoord2D LL2PC(const TeCoord2D& p) { return p; }

		virtual TeCoord2D PC2LL(const TeCoord2D& p) {return p;};
};

bool TL_DLL decodifyDescription(const string& projDescription, TeProjectionParams& pars);

//! Creates a TeProjection instance from a PROJ4 description
/*
	\note This function works only for sproj descriptionsgenerated by TerraLib
*/
TL_DLL TeProjection* TeGetTeProjectionFromSProj(const string& sproj4desc);

//! Generates a PROJ4 description from a TerraLib instance
TL_DLL string TeGetSProjFromTeProjection(TeProjection* teproj);

//! Generates OGC WKT Spatial Reference description from a TerraLib instance
TL_DLL string TeGetWKTFromTeProjection(TeProjection* proj);

//! Creates a TeProjection instance from a OGC WKT Spatial Reference description
/*
	\note This function works only for sproj descriptions generated by TerraLib
*/
TL_DLL TeProjection* TeGetTeProjectionFromWKT(const string& wkt);

/** \example convertCoordinates.cpp
 * This is an example of how to convert a coordinate from a projection to another
 */


#endif