32#define RADAR_PROJ_ "RadarProj 2023 Markus Peura fmi.fi"
40#include <drain/util/Proj6.h>
41#include <drain/util/Rectangle.h>
42#include <drain/util/Units.h>
74 std::stringstream sstr;
75 sstr <<
"+proj=aeqd" <<
" +lon_0=" << lon <<
" +lat_0=" << lat <<
" +ellps=WGS84 +type=crs";
81 void getBoundingBox(
double range,
double & lonLL,
double & latLL,
double & lonUR,
double & latUR)
const {
82 projectFwd(5.0/4.0*M_PI, ::sqrt(2.0)*range, lonLL, latLL);
83 projectFwd(1.0/4.0*M_PI, ::sqrt(2.0)*range, lonUR, latUR);
88 void getBoundingBoxDeg(
double range,
double & lonLL,
double & latLL,
double & lonUR,
double & latUR)
const {
90 lonLL *= drain::RAD2DEG;
91 latLL *= drain::RAD2DEG;
92 lonUR *= drain::RAD2DEG;
93 latUR *= drain::RAD2DEG;
133 s <<
"+proj=aeqd" <<
" +lon_0=" << lon <<
" +lat_0=" << lat <<
" +ellps=WGS84 +type=crs";
149 void getBoundingBox(
double range,
double & lonLL,
double & latLL,
double & lonUR,
double & latUR)
const {
150 projectFwd(5.0/4.0*M_PI, ::sqrt(2.0)*range, lonLL, latLL);
151 projectFwd(1.0/4.0*M_PI, ::sqrt(2.0)*range, lonUR, latUR);
156 void getBoundingBoxDeg(
double range,
double & lonLL,
double & latLL,
double & lonUR,
double & latUR)
const {
158 lonLL *= drain::RAD2DEG;
159 latLL *= drain::RAD2DEG;
160 lonUR *= drain::RAD2DEG;
161 latUR *= drain::RAD2DEG;
166 void setLatLonProjection(){
171 void determineBoundingBoxM(
double range,
double & xLL,
double & yLL,
double & xUR,
double & yUR)
const;
176 determineBoundingBoxM(range, bbox.lowerLeft.x, bbox.lowerLeft.y, bbox.upperRight.x, bbox.upperRight.y);
void setProjectionSrc(const T &...args)
Sets source projection.
Definition Proj6.h:98
void projectFwd(double &x, double &y) const
Forward projection (in-place)
Definition Proj6.h:186
void setProjectionDst(const T &...args)
Sets destination projection.
Definition Proj6.h:127
Definition RadarProj.h:54
void setLocation(double lon, double lat)
Sets location of the radar and the azimuthal equidistant (AEQD) projection accordingly.
Definition RadarProj.h:73
void getBoundingBoxDeg(double range, double &lonLL, double &latLL, double &lonUR, double &latUR) const
Bounding box in degrees.
Definition RadarProj.h:88
void getBoundingBox(double range, double &lonLL, double &latLL, double &lonUR, double &latUR) const
Bounding box in radians.
Definition RadarProj.h:81
RadarProj4(double lon=0.0, double lat=0.0)
Sets location of the radar and the azimuthal equidistant (AEQD) projection accordingly.
Definition RadarProj.h:63
Definition RadarProj.h:100
RadarProj(double lonDeg=0.0, double latDeg=0.0)
Sets location of the radar and the azimuthal equidistant (AEQD) projection accordingly.
Definition RadarProj.h:109
void getBoundingBoxDeg(double range, double &lonLL, double &latLL, double &lonUR, double &latUR) const
Bounding box in degrees.
Definition RadarProj.h:156
void determineBoundingBoxM(double range, drain::Rectangle< double > &bbox) const
Given radar's range, returns the metric bounding box using the current projection.
Definition RadarProj.h:175
void setSiteLocationDeg(double lon, double lat)
Sets location of the radar and the azimuthal equidistant (AEQD) projection accordingly.
Definition RadarProj.h:131
void setSiteLocationRad(double lon, double lat)
Sets location of the radar and the azimuthal equidistant (AEQD) projection accordingly.
Definition RadarProj.h:143
void determineBoundingBoxM(double range, double &xLL, double &yLL, double &xUR, double &yUR) const
Given radar's range, returns the metric bounding box using the current projection.
Definition RadarProj.cpp:41
void getBoundingBox(double range, double &lonLL, double &latLL, double &lonUR, double &latUR) const
Bounding box in radians.
Definition RadarProj.h:149
Definition DataSelector.cpp:44
Rectange defined through lower left and upper right coordinates.
Definition Rectangle.h:65