77 const std::string & getProjVersion(){
78 return Projector::proj4version;
98 template <
typename ...T>
113 mout.
unimplemented<LOG_ERR>(
"Not setting ", projDef.getProjDef());
127 template <
typename ...T>
139 mout.
unimplemented<LOG_ERR>(
"Not setting ", projDef.getProjDef());
146 void setProjections(
const std::string & projDefSrc,
const std::string & projDefDst){
164 return src.getProjDef();
169 const std::string & getProjectionDst()
const {
170 return dst.getProjDef();
175 const Projector & getSrc()
const {
180 const Projector & getDst()
const {
192 project<PJ_FWD>(x,y);
197 void projectFwd(
double x,
double y,
double & x2,
double & y2)
const {
200 project<PJ_FWD>(x2,y2);
206 project<PJ_FWD>(point);
212 project<PJ_FWD>(point2 = point);
218 void projectInv(
double & x,
double & y)
const {
219 project<PJ_INV>(x,y);
224 void projectInv(
double x,
double y,
double & x2,
double & y2)
const {
227 project<PJ_INV>(x2,y2);
233 project<PJ_INV>(point);
239 project<PJ_INV>(point2 = point);
245 void debug(std::ostream & ostr = std::cout,
int wkt = -1){
261 return dst.isLongLat();
270 std::string getErrorString()
const {
272 return proj_errno_string(err);
307 <PJ_DIRECTION D,
class POINT_XY>
312 proj_trans_generic(proj, D, &point.x,
sizeof(POINT_XY), 1, &point.y,
sizeof(POINT_XY), 1, 0, 0, 0, 0, 0, 0);
318 void project(
double & x,
double & y)
const {
320 proj_trans_generic(proj, D, &x,
sizeof(
double), 1, &y,
sizeof(
double), 1, 0, 0, 0, 0, 0, 0);
330std::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:83
void setProjectionDst(const Projector &projDef)
Sets destination projection, primarily using EPSG code.
Definition Proj6.h:137
PJ_CONTEXT * pjContext
Detect EPSG code from "+init=epsg:EPSG" argument.
Definition Proj6.h:295
bool isLongLat() const
Check if destination projection is longitude-latitude degrees.
Definition Proj6.h:260
void setProjectionSrc(const T &...args)
Sets source projection.
Definition Proj6.h:100
void setProjectionSrc(const Projector &projDef)
Sets source projection, primarily using EPSG code.
Definition Proj6.h:111
const std::string & getProjectionSrc() const
Returns the projection std::string applied by the last setProjection call.
Definition Proj6.h:163
void setProjections(const std::string &projDefSrc, const std::string &projDefDst)
Sets source and destination projection. TOOD: EPSG code handling.
Definition Proj6.h:146
void projectInv(const drain::Point2D< double > &point, drain::Point2D< double > &point2) const
Forward projection. Example implementation of project<>() .
Definition Proj6.h:238
void projectFwd(double x, double y, double &x2, double &y2) const
Forward projection.
Definition Proj6.h:197
void project(POINT_XY &point) const
Definition Proj6.h:309
void projectFwd(double &x, double &y) const
Forward projection (in-place)
Definition Proj6.h:191
void projectFwd(drain::Point2D< double > &point) const
Forward projection. Example implementation of project<>() .
Definition Proj6.h:205
void setProjectionDst(const T &...args)
Sets destination projection.
Definition Proj6.h:129
void projectFwd(const drain::Point2D< double > &point, drain::Point2D< double > &point2) const
Forward projection. Example implementation of project<>() .
Definition Proj6.h:211
Definition Projector.h:54
void info(std::ostream &ostr=std::cout, int wkt=-1)
Prunes "+init=epsg:<...>" and optionally "+type=crs" codes.
Definition Projector.h:181
bool isSet() const
Returns true, if PJ object has been set.
Definition Projector.h:157
void setProjection(const std::string &str, CRS_mode crs=FORCE_CRS)
Sets projection defined as Proj string.
Definition Projector.cpp:97
Definition DataSelector.cpp:1277
DRAIN_TYPENAME(void)
Add a specialization for each type of those you want to support.