#include <pj_transformer.h>
◆ PJTransformer()
apollo::hdmap::PJTransformer::PJTransformer |
( |
int |
zone_id = 50 | ) |
|
|
explicit |
在文件 pj_transformer.cc 第 26 行定义.
26 {
27
28 std::stringstream stream;
29 stream << "+proj=utm +zone=" << zone_id << " +ellps=WGS84" << std::endl;
30 pj_utm_ = pj_init_plus(stream.str().c_str());
31 if (pj_utm_ == nullptr) {
32 AERROR <<
"proj4 init failed!" << stream.str() << std::endl;
33 return;
34 }
35 pj_latlong_ = pj_init_plus("+proj=latlong +ellps=WGS84");
36 if (pj_latlong_ == nullptr) {
37 AERROR <<
"proj4 pj_latlong init failed!";
38 return;
39 }
40 AINFO <<
"proj4 init success" << std::endl;
41}
◆ ~PJTransformer()
apollo::hdmap::PJTransformer::~PJTransformer |
( |
| ) |
|
在文件 pj_transformer.cc 第 43 行定义.
43 {
44 if (pj_latlong_) {
45 pj_free(pj_latlong_);
46 pj_latlong_ = nullptr;
47 }
48 if (pj_utm_) {
49 pj_free(pj_utm_);
50 pj_utm_ = nullptr;
51 }
52}
◆ LatlongToUtm()
int apollo::hdmap::PJTransformer::LatlongToUtm |
( |
int64_t |
point_count, |
|
|
int |
point_offset, |
|
|
double * |
x, |
|
|
double * |
y, |
|
|
double * |
z |
|
) |
| |
在文件 pj_transformer.cc 第 53 行定义.
54 {
55 if (!pj_latlong_ || !pj_utm_) {
56 AERROR <<
"pj_latlong_:" << pj_latlong_ <<
"pj_utm_:" << pj_utm_
57 << std::endl;
58 return -1;
59 }
60 return pj_transform(pj_latlong_, pj_utm_, point_count, point_offset, x, y, z);
61}
该类的文档由以下文件生成: