72 const std::string & getProjVersion(){
73 return Projector::proj4version;
100 template <
typename ...T>
115 mout.
unimplemented<LOG_ERR>(
"Not setting ", projDef.getProjDef());
129 template <
typename ...T>
141 mout.
unimplemented<LOG_ERR>(
"Not setting ", projDef.getProjDef());
148 void setProjections(
const std::string & projDefSrc,
const std::string & projDefDst){
166 return src.getProjDef();
171 const std::string & getProjStrDst()
const {
172 return dst.getProjDef();
177 const Projector & getSrc()
const {
182 const Projector & getDst()
const {
191 project<PJ_FWD>(x,y);
196 void projectFwd(
double x,
double y,
double & x2,
double & y2)
const {
199 project<PJ_FWD>(x2,y2);
205 project<PJ_FWD>(point);
211 project<PJ_FWD>(point2 = point);
217 void projectInv(
double & x,
double & y)
const {
218 project<PJ_INV>(x,y);
223 void projectInv(
double x,
double y,
double & x2,
double & y2)
const {
226 project<PJ_INV>(x2,y2);
232 project<PJ_INV>(point);
238 project<PJ_INV>(point2 = point);
244 void debug(std::ostream & ostr = std::cout,
int wkt = -1){
260 return dst.isLongLat();
269 std::string getErrorString()
const {
271 return proj_errno_string(err);
305 <PJ_DIRECTION D,
class POINT_XY>
310 proj_trans_generic(proj, D, &point.x,
sizeof(POINT_XY), 1, &point.y,
sizeof(POINT_XY), 1, 0, 0, 0, 0, 0, 0);
316 void project(
double & x,
double & y)
const {
318 proj_trans_generic(proj, D, &x,
sizeof(
double), 1, &y,
sizeof(
double), 1, 0, 0, 0, 0, 0, 0);
326DRAIN_TYPENAME(PJ_INFO);
327DRAIN_TYPENAME(Proj6);
329std::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:326
Logger & unimplemented(const TT &... args)
Feature to be done. Special type of Logger::note().
Definition Log.h:521
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:139
PJ_CONTEXT * pjContext
Detect EPSG code from "+init=epsg:EPSG" argument.
Definition Proj6.h:294
bool isLongLat() const
Check if destination projection is longitude-latitude degrees.
Definition Proj6.h:259
void setProjectionSrc(const T &...args)
Sets source projection.
Definition Proj6.h:102
void setProjectionSrc(const Projector &projDef)
Sets source projection, primarily using EPSG code.
Definition Proj6.h:113
void setProjections(const std::string &projDefSrc, const std::string &projDefDst)
Sets source and destination projection. TOOD: EPSG code handling.
Definition Proj6.h:148
void projectInv(const drain::Point2D< double > &point, drain::Point2D< double > &point2) const
Forward projection. Example implementation of project<>() .
Definition Proj6.h:237
const std::string & getProjStrSrc() const
Returns the projection std::string applied by the last setProjection call.
Definition Proj6.h:165
void projectFwd(double x, double y, double &x2, double &y2) const
Forward projection.
Definition Proj6.h:196
void project(POINT_XY &point) const
Definition Proj6.h:307
void projectFwd(double &x, double &y) const
Forward projection (in-place)
Definition Proj6.h:190
void projectFwd(drain::Point2D< double > &point) const
Forward projection. Example implementation of project<>() .
Definition Proj6.h:204
void setProjectionDst(const T &...args)
Sets destination projection.
Definition Proj6.h:131
void projectFwd(const drain::Point2D< double > &point, drain::Point2D< double > &point2) const
Forward projection. Example implementation of project<>() .
Definition Proj6.h:210
Definition Projector.h:52
bool isSet() const
Returns true, if PJ object has been set.
Definition Projector.h:157
void info(std::ostream &ostr=std::cout, int wkt=-1) const
Prunes "+init=epsg:<...>" and optionally "+type=crs" codes.
Definition Projector.h:181
void setProjection(const std::string &str, CRS_mode crs=FORCE_CRS)
Sets projection defined as Proj string.
Definition Projector.cpp:98
std::ostream & operator<<(std::ostream &ostr, const PlainData< DT > &d)
Definition Data.h:631