diff --git a/src/cavern.h b/src/cavern.h
index 59ad9456..b68bd465 100644
a
|
b
|
|
33 | 33 | #include <math.h> |
34 | 34 | #include <float.h> |
35 | 35 | |
| 36 | #include <proj.h> |
| 37 | #define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1 |
36 | 38 | #include <proj_api.h> |
37 | 39 | |
38 | 40 | #include "img_hosted.h" |
diff --git a/src/commands.c b/src/commands.c
index fb82ff9a..05ea3ea0 100644
a
|
b
|
|
26 | 26 | #include <stddef.h> /* for offsetof */ |
27 | 27 | #include <string.h> |
28 | 28 | |
| 29 | #include <proj.h> |
| 30 | #define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1 |
29 | 31 | #include <proj_api.h> |
30 | 32 | |
31 | 33 | #include "cavern.h" |
… |
… |
cmd_declination(void) |
1706 | 1708 | /* Invalidate cached declination. */ |
1707 | 1709 | pcs->declination = HUGE_REAL; |
1708 | 1710 | { |
1709 | | projLP lp = { x, y }; |
1710 | | struct FACTORS factors; |
1711 | | memset(&factors, 0, sizeof(factors)); |
1712 | | pj_factors(lp, proj_out, 0.0, &factors); |
1713 | | pcs->convergence = factors.conv; |
| 1711 | PJ_COORD lp; |
| 1712 | lp.lp.lam = x; |
| 1713 | lp.lp.phi = y; |
| 1714 | PJ_FACTORS factors = proj_factors(proj_out, lp); |
| 1715 | pcs->convergence = factors.meridian_convergence; |
1714 | 1716 | } |
1715 | 1717 | } else { |
1716 | 1718 | /* *declination D UNITS */ |
diff --git a/src/gfxcore.cc b/src/gfxcore.cc
index 0dfd1522..a9ec171f 100644
a
|
b
|
|
47 | 47 | #include <wx/image.h> |
48 | 48 | #include <wx/zipstrm.h> |
49 | 49 | |
| 50 | #define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1 |
50 | 51 | #include <proj_api.h> |
51 | 52 | |
52 | 53 | const unsigned long DEFAULT_HGT_DIM = 3601; |
diff --git a/src/gpx.cc b/src/gpx.cc
index e082cfca..ad3cfdce 100644
a
|
b
|
|
33 | 33 | #include <math.h> |
34 | 34 | |
35 | 35 | #include "useful.h" |
| 36 | #define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1 |
36 | 37 | #include <proj_api.h> |
37 | 38 | |
38 | 39 | #include "aven.h" |
diff --git a/src/gpx.h b/src/gpx.h
index ca28f52a..3de66532 100644
a
|
b
|
|
21 | 21 | |
22 | 22 | #include "exportfilter.h" |
23 | 23 | |
| 24 | #define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1 |
24 | 25 | #include <proj_api.h> |
25 | 26 | |
26 | 27 | class GPX : public ExportFilter { |
diff --git a/src/kml.cc b/src/kml.cc
index 8cba3e3f..019f3673 100644
a
|
b
|
|
32 | 32 | #include <math.h> |
33 | 33 | |
34 | 34 | #include "useful.h" |
| 35 | #define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1 |
35 | 36 | #include <proj_api.h> |
36 | 37 | |
37 | 38 | #include "aven.h" |
diff --git a/src/kml.h b/src/kml.h
index 5c50661b..f1d83d5d 100644
a
|
b
|
|
20 | 20 | |
21 | 21 | #include "exportfilter.h" |
22 | 22 | |
| 23 | #define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1 |
23 | 24 | #include <proj_api.h> |
24 | 25 | |
25 | 26 | #include "vector3.h" |
diff --git a/src/message.h b/src/message.h
index 022747d0..1ab0a93f 100644
a
|
b
|
extern "C" { |
36 | 36 | #ifdef MSG_SETUP_PROJ_SEARCH_PATH |
37 | 37 | /* We only support relocatable builds on these platforms. */ |
38 | 38 | # if OS_WIN32 || OS_UNIX_MACOSX |
| 39 | #define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1 |
39 | 40 | # include <proj_api.h> |
40 | 41 | # define msg_init(ARGV) do {\ |
41 | 42 | if (msg_init_(ARGV)) pj_set_finder(msg_proj_finder_);\ |
diff --git a/tests/cs.svx b/tests/cs.svx
index 0c7cd260..563196fd 100644
a
|
b
|
|
1 | 1 | ; pos=yes warn=0 |
2 | 2 | *cs EPSG:4167 |
3 | | *cs ESRI:104305 |
| 3 | *cs EPSG:4167 ; FIXME: +init=esri:nnnn broken in PROJ 6? |
4 | 4 | *cs EUR79Z30 |
5 | 5 | *cs IJTSK |
6 | 6 | *cs IJTSK03 |
diff --git a/tests/csbad.out b/tests/csbad.out
index 36480d24..098fb72c 100644
a
|
b
|
|
65 | 65 | ./csbad.svx:24:9: error: Coordinate system unsuitable for output |
66 | 66 | *cs out jtsk03 |
67 | 67 | ^~~~~~ |
68 | | ./csbad.svx:29: error: Failed to convert coordinates: latitude or longitude exceeded limits |
69 | | *fix 2 reference 179 -89 1000 |
70 | 68 | |
71 | 69 | Removing trailing traverses... |
72 | 70 | |
… |
… |
Total length of survey legs = 0.00m ( 0.00m adjusted) |
89 | 87 | Total plan length of survey legs = 0.00m |
90 | 88 | Total vertical length of survey legs = 0.00m |
91 | 89 | 2 0-nodes. |
92 | | There were 0 warning(s) and 24 error(s) - no output files produced. |
| 90 | There were 0 warning(s) and 23 error(s) - no output files produced. |
diff --git a/tests/csbad.svx b/tests/csbad.svx
index 103fe22a..2dda4914 100644
a
|
b
|
|
1 | | ; pos=fail warn=0 error=24 |
| 1 | ; pos=fail warn=0 error=23 |
2 | 2 | *fix 1 reference 0 0 0 |
3 | 3 | *cs EPSG:-1 |
4 | 4 | *cs ERSI:1234 |
… |
… |
|
26 | 26 | ; that cavern relays the error usefully. |
27 | 27 | *cs out osgb:ha |
28 | 28 | *cs long-lat |
| 29 | ; FIXME doesn't fail with PROJ6 |
29 | 30 | *fix 2 reference 179 -89 1000 |