isce3  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
GeoGridParameters.h
1 #pragma once
2 #include <isce3/except/Error.h>
3 
4 namespace isce3 { namespace product {
5 
7 public:
8  GeoGridParameters() = default;
9 
10  inline GeoGridParameters(double geoGridStartX, double geoGridStartY,
11  double geoGridSpacingX, double geoGridSpacingY,
12  int width, int height, int epsgcode);
13 
14  void startX(double x0) { _startX = x0; }
15 
16  void startY(double y0) { _startY = y0; }
17 
18  void spacingX(double dx) { _spacingX = dx; }
19 
20  void spacingY(double dy) { _spacingY = dy; }
21 
22  void length(int l) { _length = l; };
23 
24  void width(int w) { _width = w; };
25 
26  void epsg(int e) { _epsg = e; };
27 
29  double startX() const { return _startX; };
30 
32  double startY() const { return _startY; };
33 
35  double spacingX() const { return _spacingX; };
36 
38  double spacingY() const { return _spacingY; };
39 
40  int width() const { return _width; };
41 
42  int length() const { return _length; };
43 
44  int epsg() const { return _epsg; };
45 
46 protected:
47  // start X position for the geocoded grid
48  double _startX = 0.0;
49 
50  // start Y position for the geocoded grid
51  double _startY = 0.0;
52 
53  // X spacing for the geocoded grid
54  double _spacingX = 0.0;
55 
56  // Y spacing for the geocoded grid
57  double _spacingY = 0.0;
58 
59  // number of pixels in east-west direction (X direction)
60  int _width = 0;
61 
62  // number of lines in north-south direction (Y direction)
63  int _length = 0;
64 
65  // epsg code for the output geocoded grid
66  int _epsg = 4326;
67 };
68 }} // namespace isce3::product
69 
70 isce3::product::GeoGridParameters::GeoGridParameters(
71  double geoGridStartX, double geoGridStartY, double geoGridSpacingX,
72  double geoGridSpacingY, int width, int length, int epsgcode)
73  : // Assumption: origin is the top-left corner of the top-left pixel of the
74  // grid the starting coordinate of the output geocoded grid in X
75  // direction. Since the input is alwayas referring to the top-left corner
76  // of the top-left pixel, we adjust to the center for internal use only
77  _startX(geoGridStartX + geoGridSpacingX / 2),
78 
79  // the starting coordinate of the output geocoded grid in Y direction.
80  // adjusted to the center of the pixel for internal use only
81  _startY(geoGridStartY + geoGridSpacingY / 2),
82 
83  // spacing of the output geocoded grid in X
84  _spacingX(geoGridSpacingX),
85 
86  // spacing of the output geocoded grid in Y
87  _spacingY(geoGridSpacingY),
88 
89  // number of lines (rows) in the geocoded grid (Y direction)
90  _width(width),
91 
92  // number of columns in the geocoded grid (Y direction)
93  _length(length),
94 
95  // Save the EPSG code
96  _epsg(epsgcode)
97 {
98  if (geoGridSpacingY > 0.0) {
99  std::string errmsg = "Y spacing can not be positive.";
100  throw isce3::except::OutOfRange(ISCE_SRCINFO(), errmsg);
101  }
102 }
double spacingX() const
Get.
Definition: GeoGridParameters.h:35
double startX() const
Get.
Definition: GeoGridParameters.h:29
double spacingY() const
Get.
Definition: GeoGridParameters.h:38
Definition: GeoGridParameters.h:6
double startY() const
Get.
Definition: GeoGridParameters.h:32
Definition: Error.h:21

Generated for ISCE3.0 by doxygen 1.8.5.