diff options
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/build_esri_projection_mapping.py | 60 | ||||
| -rwxr-xr-x | scripts/doxygen.sh | 2 | ||||
| -rwxr-xr-x | scripts/reformat_cpp.sh | 5 |
3 files changed, 51 insertions, 16 deletions
diff --git a/scripts/build_esri_projection_mapping.py b/scripts/build_esri_projection_mapping.py index 00a49c68..752f9850 100644 --- a/scripts/build_esri_projection_mapping.py +++ b/scripts/build_esri_projection_mapping.py @@ -751,7 +751,19 @@ def generate_mapping(WKT2_name, esri_proj_name, Params, suffix=''): all_projs.append([esri_proj_name, WKT2_name_s, c_name]) else: all_projs.append([esri_proj_name, WKT2_name, c_name]) - print('static const ESRIParamMapping %s[] = { ' % c_name) + + qualifier = 'static ' + if c_name in ('paramsESRI_Plate_Carree', + 'paramsESRI_Equidistant_Cylindrical', + 'paramsESRI_Gauss_Kruger', + 'paramsESRI_Transverse_Mercator', + 'paramsESRI_Hotine_Oblique_Mercator_Azimuth_Natural_Origin', + 'paramsESRI_Rectified_Skew_Orthomorphic_Natural_Origin', + 'paramsESRI_Hotine_Oblique_Mercator_Azimuth_Center', + 'paramsESRI_Rectified_Skew_Orthomorphic_Center'): + qualifier = '' + + print(qualifier + 'const ESRIParamMapping %s[] = { ' % c_name) for param in Params: for param_name in param: param_value = param[param_name] @@ -803,24 +815,22 @@ print(""" * DEALINGS IN THE SOFTWARE. ****************************************************************************/ -#ifndef FROM_COORDINATE_OPERATION_CPP -#error This file should only be included from coordinateoperation.cpp +#ifndef FROM_PROJ_CPP +#define FROM_PROJ_CPP #endif -#ifndef ESRI_PROJECTION_MAPPINGS_HH_INCLUDED -#define ESRI_PROJECTION_MAPPINGS_HH_INCLUDED +#include "esriparammappings.hpp" +#include "proj_constants.h" -#include "coordinateoperation_internal.hpp" +#include "proj/internal/internal.hpp" -//! @cond Doxygen_Suppress +NS_PROJ_START -// --------------------------------------------------------------------------- +using namespace internal; -// anonymous namespace -namespace { +namespace operation { -using namespace ::NS_PROJ; -using namespace ::NS_PROJ::operation; +//! @cond Doxygen_Suppress """) @@ -841,6 +851,7 @@ for item in config: count += 1 print('') + print('static const ESRIMethodMapping esriMappings[] = {') for esri_proj_name, WKT2_name, c_name in all_projs: if WKT2_name.startswith('EPSG_'): @@ -852,11 +863,32 @@ for esri_proj_name, WKT2_name, c_name in all_projs: print('};') print(""" + // --------------------------------------------------------------------------- -} // namespace { +const ESRIMethodMapping *getEsriMappings(size_t &nElts) { + nElts = sizeof(esriMappings) / sizeof(esriMappings[0]); + return esriMappings; +} + +// --------------------------------------------------------------------------- + +std::vector<const ESRIMethodMapping *> +getMappingsFromESRI(const std::string &esri_name) { + std::vector<const ESRIMethodMapping *> res; + for (const auto &mapping : esriMappings) { + if (ci_equal(esri_name, mapping.esri_name)) { + res.push_back(&mapping); + } + } + return res; +} //! @endcond -#endif // ESRI_PROJECTION_MAPPINGS_HH_INCLUDED +// --------------------------------------------------------------------------- + +} // namespace operation +NS_PROJ_END + """) diff --git a/scripts/doxygen.sh b/scripts/doxygen.sh index fd3a0468..f169c78e 100755 --- a/scripts/doxygen.sh +++ b/scripts/doxygen.sh @@ -38,7 +38,7 @@ rm -rf docs/build/xml/ # Ugly hack to workaround a bug of Doxygen 1.8.17 that erroneously detect proj_network_get_header_value_cbk_type/ as a variable sed "s/const char\* (\*proj_network_get_header_value_cbk_type/CONST_CHAR\* (\*proj_network_get_header_value_cbk_type/" < src/proj.h > docs/build/tmp_breathe/proj.h -(cat Doxyfile; printf "GENERATE_HTML=NO\nGENERATE_XML=YES\nINPUT= src/iso19111 include/proj docs/build/tmp_breathe/proj.h src/filemanager.cpp src/networkfilemanager.cpp docs/build/tmp_breathe/general_doc.dox.reworked.h") | doxygen - > docs/build/tmp_breathe/docs_log.txt 2>&1 +(cat Doxyfile; printf "GENERATE_HTML=NO\nGENERATE_XML=YES\nINPUT= src/iso19111 src/iso19111/operation include/proj docs/build/tmp_breathe/proj.h src/filemanager.cpp src/networkfilemanager.cpp docs/build/tmp_breathe/general_doc.dox.reworked.h") | doxygen - > docs/build/tmp_breathe/docs_log.txt 2>&1 if grep -i warning docs/build/tmp_breathe/docs_log.txt; then echo "Doxygen warnings found" && cat docs/build/tmp_breathe/docs_log.txt && /bin/false; else diff --git a/scripts/reformat_cpp.sh b/scripts/reformat_cpp.sh index 50a572a1..89237b65 100755 --- a/scripts/reformat_cpp.sh +++ b/scripts/reformat_cpp.sh @@ -16,7 +16,10 @@ esac TOPDIR="$SCRIPT_DIR/.." for i in "$TOPDIR"/include/proj/*.hpp "$TOPDIR"/include/proj/internal/*.hpp \ - "$TOPDIR"/src/iso19111/*.cpp "$TOPDIR"/test/unit/*.cpp \ + "$TOPDIR"/src/iso19111/*.cpp \ + "$TOPDIR"/src/iso19111/operation/*.cpp \ + "$TOPDIR"/src/iso19111/operation/*.hpp \ + "$TOPDIR"/test/unit/*.cpp \ "$TOPDIR"/src/apps/projinfo.cpp "$TOPDIR"/src/apps/projsync.cpp \ "$TOPDIR"/src/tracing.cpp "$TOPDIR"/src/grids.hpp "$TOPDIR"/src/grids.cpp \ "$TOPDIR"/src/filemanager.hpp "$TOPDIR"/src/filemanager.cpp \ |
