Commit Graph

4543 Commits

Author SHA1 Message Date
Adam Wulkiewicz
de14869fbc [srs] Rename upper-case global types and move them if possible.
- Types defined in projects.h: COMPLEX, PJ_ELLPS, PJ_DATUM, PJ_UNITS,
  PJ_PRIME_MERIDIANS.
- Move types used for global data, tables defining ellipsoids, datums,
  units and meridians to files defining the tables.
- Remove types that are not used in Boost.Geometry: DERIVS and FACTORS.
2018-04-13 19:15:34 +02:00
Adam Wulkiewicz
9f28e8d8aa [srs] Rename upper-case variable and type names. 2018-04-13 18:48:50 +02:00
Adam Wulkiewicz
4f86b6fb7e [srs] Rename macro-like variables datum type and error code.
- Names were herited from proj4.
- Replace static variables with enums.
- Add more error codes and use them with projection_exception()
  instead of magic numbers.
2018-04-12 23:46:46 +02:00
Adam Wulkiewicz
9b2bb48fae Merge branch 'develop' into fix/projections_names 2018-04-12 22:53:19 +02:00
Vissarion Fysikopoulos
cc381b3c7f [algorithms] [tests] Fix envelope algorithm for spherical and geographic polygons and rings 2018-04-11 17:12:27 +03:00
Adam Wulkiewicz
0a1ba2763a [srs] Rename projections' global constants.
Use lower-case names to avoid clashes with macros.
Move constants to separate file.
2018-04-09 04:03:29 +02:00
Adam Wulkiewicz
1aeef5d396 [srs] Support horizontal shift grids (nadgrids) in transformation.
Relevant proj4 code was converted to C++ and Boostified. So all grids formats
are supported (ctable, ctable2, ntv1, ntv2), also vertical geoid grid GTX
format but it is not used right now. There are some differences though:
- proj4 stores loaded grids in global storage and pointers to a relevant subset
  of grids in projection parameters structure. In Boost.Geometry this is moved
  outside transformation structure to allow users to place global storage(s)
  wherever they like.
- in proj4 the grids are loaded implicitly when there is +nadgrids parameter
  passed. In Boost.Geometry an object representing a subset of grids explicitly
  has to be initialized and then passed into transforming function.
- in proj4 grids has to be "installed" into certain directories. In
  Boost.Geometry user can implement StreamPolicy opening any input stream
  having unformatted input interface. The default one uses std::ifstream
  opening files having the same names as the ones in +nadgrids parameter in
  working directory.

Added classes:
  srs::grids, srs::ifstream_policy, srs::grids_storage,
  srs::projection_grids, srs::transformation_grids
and for multithreading:
  srs::shared_grids

Added functions (also overloads)
  srs::transformation::initialize_grids(grids_storage)
  srs::transformation::forward(in, out, transformation_grids)
  srs::transformation::inverse(in, out, transformation_grids)
2018-04-08 14:15:21 +02:00
Adam Wulkiewicz
49b9e7bfa3 Merge pull request #465 from awulkiew/feature/projections_update
Update implemented projections to proj4 5.0.0 state.
2018-04-07 14:55:17 +02:00
Adam Wulkiewicz
e3802efb04 Merge pull request #467 from vissarion/feature_box_box_fix
Few fixes in distance computation
2018-03-28 16:09:08 +02:00
Vissarion Fysikopoulos
ff6547bc7b [formulas] Fix a bug in thomas inverse formula 2018-03-28 16:59:03 +03:00
Vissarion Fysikopoulos
df23bb19b8 [strategies] Fix inverse strategy type call from point segment distance computation strategy 2018-03-28 16:54:08 +03:00
Vissarion Fysikopoulos
ab2ab3144d [strategies] [tests] Diagonal case fix for box-box distance 2018-03-28 14:42:08 +03:00
Barend Gehrels
68296965f5 ticket #13386 - workaround for some gcc compilers 2018-03-27 21:50:18 +02:00
Barend Gehrels
7bfd8c6ca3 Revert "ticket #13386 - workaround for some gcc compilers complaining about"
This reverts commit 54f5ead9e8.
2018-03-27 21:46:05 +02:00
Barend Gehrels
54f5ead9e8 ticket #13386 - workaround for some gcc compilers complaining about
Also move the const according to conventions, in this method.
2018-03-27 21:28:13 +02:00
Adam Wulkiewicz
b9e33ae18f [index][doc] Improve description of predicates. 2018-03-23 00:18:31 +01:00
Adam Wulkiewicz
22f49ce7b4 [srs] Allow defining prime meridian in DMS format. 2018-03-22 22:11:53 +01:00
Adam Wulkiewicz
65df039169 [srs] In dms parser replace memset with init. list or std::fill. 2018-03-22 22:10:41 +01:00
Adam Wulkiewicz
7df9d6d235 [srs] Simplify pj_consts struct holding projection parameters. 2018-03-21 18:21:42 +01:00
Adam Wulkiewicz
7d73240ad9 [srs] Improve projections' parameters handling.
Replace pj_param() taking type of parameter in a string with a set of
functions:
- pj_param_exist() - check if a parameter exists,
- pj_param_X() - check if a parameter exists and assign it to variable,
- pj_get_param_X() - return parameter if it exists or default value,
may be:
- s (returning std::string),
- i (int),
- f (floating point or user-defined numeric type),
- r (angle defined in DMS format as radians in FP or UD type),
- b (bool)

Use the above e.g. to avoid traversing parameters list twice per
parameter in some cases.

Add pj_mkparam() overload taking name and value as separate arguments to
avoid parsing of string in 'param=value' format.
2018-03-20 23:24:03 +01:00
Adam Wulkiewicz
c32e32c18f [srs] In bonne proj avoid calc_t to bool implicit conversion. 2018-03-18 03:14:08 +01:00
Adam Wulkiewicz
2490451d8e [srs][test] Do not include projections by default (due to possible clashes with macros). 2018-03-15 20:37:34 +01:00
Adam Wulkiewicz
331c584c27 [srs] Replace apa table with struct and return it from pj_authset() instead of dummy/true bool value. 2018-03-15 18:58:31 +01:00
Adam Wulkiewicz
ffa8c32856 [srs] Add missing include and fix unused variable warnings. 2018-03-15 18:39:46 +01:00
Adam Wulkiewicz
4c2753701e [srs] Replace en table with struct and return it from pj_enfn() instead of dummy/true bool value. 2018-03-15 17:48:52 +01:00
Adam Wulkiewicz
8794ffb121 [srs] Update v* and w* projections (proj4 5.0.0). 2018-03-15 16:57:05 +01:00
Adam Wulkiewicz
e39e242fe5 [srs] Update t* and u* projections (proj4 5.0.0). 2018-03-15 13:46:40 +01:00
Adam Wulkiewicz
409729c299 [srs] Update r* and s* projections (proj4 5.0.0). 2018-03-14 18:54:29 +01:00
Adam Wulkiewicz
40448ee99b [srs] Update p* and q* projections (proj4 5.0.0). 2018-03-14 17:04:03 +01:00
Adam Wulkiewicz
c1406db0f3 [srs] Update n* and o* projections (proj4 5.0.0). 2018-03-14 16:07:57 +01:00
Adam Wulkiewicz
ffeeaedb38 [is_valid] Add missing core/cs.hpp include. 2018-03-14 11:31:24 +01:00
Adam Wulkiewicz
9459b39bee [srs] Update m* projections (proj4 5.0.0). 2018-03-14 01:23:32 +01:00
Adam Wulkiewicz
d770d18d6c [srs] Update l* projections (proj4 5.0.0). 2018-03-14 00:25:05 +01:00
Adam Wulkiewicz
f492512df4 [srs] Update i* and k* projections (proj4 5.0.0). 2018-03-13 02:44:39 +01:00
Adam Wulkiewicz
f4f1874f19 [srs] Update h* projections (proj4 5.0.0), add pj_calc_ellipsoid_params() function and comment in geos projection. 2018-03-12 23:13:15 +01:00
Adam Wulkiewicz
1f4a271d74 [srs] Update f* and g* projections (proj4 5.0.0). 2018-03-12 03:17:05 +01:00
Adam Wulkiewicz
e71bb85217 [srs] Update eck1, eck2, eck3, eck4, eck5, eqc, eqdc, etmerc (proj4 5.0.0). 2018-03-10 00:29:06 +01:00
Adam Wulkiewicz
57bd186feb [srs] Update cc, collg and denoy (proj4 5.0.0). 2018-03-09 19:21:55 +01:00
Adam Wulkiewicz
fc73443860 [srs] Update bacon, bipc, boggs, bonne (proj4 5.0.0). 2018-03-09 18:55:31 +01:00
Adam Wulkiewicz
4400796fc3 [srs] Update aea, aeqd, airy, aitoff and august (proj4 5.0.0). 2018-03-09 18:20:08 +01:00
Adam Wulkiewicz
04af0a1796 [srs] Fix error in tcea projection (not removed template parameter). 2018-03-09 18:19:14 +01:00
Adam Wulkiewicz
fe2e9d2877 [srs] Add new projection error/exception codes. 2018-03-09 18:17:33 +01:00
Adam Wulkiewicz
7f3562c059 [srs] Update some of the projections (to proj4 5.0.0). 2018-03-09 02:49:39 +01:00
Adam Wulkiewicz
8e3257325b [srs] Fix igh projection (wrong variant of underlying sinu projection).
- Use spherical sinu projection instead of elliptical/spheroidal.
2018-03-07 22:54:03 +01:00
Adam Wulkiewicz
8c8d06d3a9 [srs] Fix goode projection (wrong variant of underlying sinu projection).
- Use spherical sinu projection instead of elliptical/spheroidal.
- Rearrange and simplify the code in order to properly
  initialize underlying sinu projection object requireing es = 0.
  It's possible that es = 0 should be set in spherical sinu projection
  for safety.
2018-03-07 19:08:04 +01:00
Adam Wulkiewicz
5ac66e34ca [srs] Update aeqd projection (proj4 4.9.3).
Use geodesic formulas.

Credit: Charles Karney
2018-03-07 11:17:29 +01:00
Adam Wulkiewicz
2a2e0ac41e [doc][srs][strategies] Add/improve docs of geographic strategies and spheroid. 2018-03-02 23:22:36 +01:00
Adam Wulkiewicz
ff427c0366 [srs] Remove potentially not thread-safe strerror() call. 2018-02-24 03:43:33 +01:00
Barend Gehrels
f4bf11b8bb [simplify] use equals_point_point instead of plain equals 2018-02-19 18:41:36 +01:00
Barend Gehrels
d561e2c6cb [simplify] process review remarks, mainly in using geometry::range instead
of the bare traits
2018-02-19 18:38:30 +01:00