72 const std::string & getProjVersion(){
73 return Projector::proj4version;
93 template <
typename ...T>
108 mout.
unimplemented<LOG_ERR>(
"Not setting ", projDef.getProjDef());
122 template <
typename ...T>
134 mout.
unimplemented<LOG_ERR>(
"Not setting ", projDef.getProjDef());
141 void setProjections(
const std::string & projDefSrc,
const std::string & projDefDst){
159 return src.getProjDef();
164 const std::string & getProjStrDst()
const {
165 return dst.getProjDef();
170 const Projector & getSrc()
const {
175 const Projector & getDst()
const {
184 project<PJ_FWD>(x,y);
189 void projectFwd(
double x,
double y,
double & x2,
double & y2)
const {
192 project<PJ_FWD>(x2,y2);
198 project<PJ_FWD>(point);
204 project<PJ_FWD>(point2 = point);
210 void projectInv(
double & x,
double & y)
const {
211 project<PJ_INV>(x,y);
216 void projectInv(
double x,
double y,
double & x2,
double & y2)
const {
219 project<PJ_INV>(x2,y2);
225 project<PJ_INV>(point);
231 project<PJ_INV>(point2 = point);
237 void debug(std::ostream & ostr = std::cout,
int wkt = -1){
253 return dst.isLongLat();
262 std::string getErrorString()
const {
264 return proj_errno_string(err);
298 <PJ_DIRECTION D,
class POINT_XY>
303 proj_trans_generic(proj, D, &point.x,
sizeof(POINT_XY), 1, &point.y,
sizeof(POINT_XY), 1, 0, 0, 0, 0, 0, 0);
309 void project(
double & x,
double & y)
const {
311 proj_trans_generic(proj, D, &x,
sizeof(
double), 1, &y,
sizeof(
double), 1, 0, 0, 0, 0, 0, 0);
319DRAIN_TYPENAME(PJ_INFO);
320DRAIN_TYPENAME(Proj6);
322std::ostream & operator<<(std::ostream & ostr,
const Proj6 &p);
LogSourc e is the means for a function or any program segment to "connect" to a Log.
Definition Log.h:313
Logger & unimplemented(const TT &... args)
Feature to be done. Special type of Logger::note().
Definition Log.h:512
void setDirectMapping(bool lenient)
Set crs_to_crs projection, if both src and dst projections are set.
Definition Proj6.cpp:81
void setProjectionDst(const Projector &projDef)
Sets destination projection, primarily using EPSG code.
Definition Proj6.h:132
PJ_CONTEXT * pjContext
Detect EPSG code from "+init=epsg:EPSG" argument.
Definition Proj6.h:287
bool isLongLat() const
Check if destination projection is longitude-latitude degrees.
Definition Proj6.h:252
void setProjectionSrc(const T &...args)
Sets source projection.
Definition Proj6.h:95
void setProjectionSrc(const Projector &projDef)
Sets source projection, primarily using EPSG code.
Definition Proj6.h:106
void setProjections(const std::string &projDefSrc, const std::string &projDefDst)
Sets source and destination projection. TOOD: EPSG code handling.
Definition Proj6.h:141
void projectInv(const drain::Point2D< double > &point, drain::Point2D< double > &point2) const
Forward projection. Example implementation of project<>() .
Definition Proj6.h:230
const std::string & getProjStrSrc() const
Returns the projection std::string applied by the last setProjection call.
Definition Proj6.h:158
void projectFwd(double x, double y, double &x2, double &y2) const
Forward projection.
Definition Proj6.h:189
void project(POINT_XY &point) const
Definition Proj6.h:300
void projectFwd(double &x, double &y) const
Forward projection (in-place)
Definition Proj6.h:183
void projectFwd(drain::Point2D< double > &point) const
Forward projection. Example implementation of project<>() .
Definition Proj6.h:197
void setProjectionDst(const T &...args)
Sets destination projection.
Definition Proj6.h:124
void projectFwd(const drain::Point2D< double > &point, drain::Point2D< double > &point2) const
Forward projection. Example implementation of project<>() .
Definition Proj6.h:203
Definition Projector.h:52
bool isSet() const
Returns true, if PJ object has been set.
Definition Projector.h:155
void info(std::ostream &ostr=std::cout, int wkt=-1) const
Prunes "+init=epsg:<...>" and optionally "+type=crs" codes.
Definition Projector.h:179
void setProjection(const std::string &str, CRS_mode crs=FORCE_CRS)
Sets projection defined as Proj string.
Definition Projector.cpp:98
Definition DataSelector.cpp:1277