Ticket #102: proj6-wip.patch

File proj6-wip.patch, 4.2 KB (added by Olly Betts, 5 years ago)

WIP patch

  • src/cavern.h

    diff --git a/src/cavern.h b/src/cavern.h
    index 59ad9456..b68bd465 100644
    a b  
    3333#include <math.h>
    3434#include <float.h>
    3535
     36#include <proj.h>
     37#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1
    3638#include <proj_api.h>
    3739
    3840#include "img_hosted.h"
  • src/commands.c

    diff --git a/src/commands.c b/src/commands.c
    index fb82ff9a..05ea3ea0 100644
    a b  
    2626#include <stddef.h> /* for offsetof */
    2727#include <string.h>
    2828
     29#include <proj.h>
     30#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1
    2931#include <proj_api.h>
    3032
    3133#include "cavern.h"
    cmd_declination(void) 
    17061708        /* Invalidate cached declination. */
    17071709        pcs->declination = HUGE_REAL;
    17081710        {
    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;
    17141716        }
    17151717    } else {
    17161718        /* *declination D UNITS */
  • src/gfxcore.cc

    diff --git a/src/gfxcore.cc b/src/gfxcore.cc
    index 0dfd1522..a9ec171f 100644
    a b  
    4747#include <wx/image.h>
    4848#include <wx/zipstrm.h>
    4949
     50#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1
    5051#include <proj_api.h>
    5152
    5253const unsigned long DEFAULT_HGT_DIM = 3601;
  • src/gpx.cc

    diff --git a/src/gpx.cc b/src/gpx.cc
    index e082cfca..ad3cfdce 100644
    a b  
    3333#include <math.h>
    3434
    3535#include "useful.h"
     36#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1
    3637#include <proj_api.h>
    3738
    3839#include "aven.h"
  • src/gpx.h

    diff --git a/src/gpx.h b/src/gpx.h
    index ca28f52a..3de66532 100644
    a b  
    2121
    2222#include "exportfilter.h"
    2323
     24#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1
    2425#include <proj_api.h>
    2526
    2627class GPX : public ExportFilter {
  • src/kml.cc

    diff --git a/src/kml.cc b/src/kml.cc
    index 8cba3e3f..019f3673 100644
    a b  
    3232#include <math.h>
    3333
    3434#include "useful.h"
     35#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1
    3536#include <proj_api.h>
    3637
    3738#include "aven.h"
  • src/kml.h

    diff --git a/src/kml.h b/src/kml.h
    index 5c50661b..f1d83d5d 100644
    a b  
    2020
    2121#include "exportfilter.h"
    2222
     23#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1
    2324#include <proj_api.h>
    2425
    2526#include "vector3.h"
  • src/message.h

    diff --git a/src/message.h b/src/message.h
    index 022747d0..1ab0a93f 100644
    a b extern "C" { 
    3636#ifdef MSG_SETUP_PROJ_SEARCH_PATH
    3737/* We only support relocatable builds on these platforms. */
    3838# if OS_WIN32 || OS_UNIX_MACOSX
     39#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H 1
    3940#  include <proj_api.h>
    4041#  define msg_init(ARGV) do {\
    4142        if (msg_init_(ARGV)) pj_set_finder(msg_proj_finder_);\
  • tests/cs.svx

    diff --git a/tests/cs.svx b/tests/cs.svx
    index 0c7cd260..563196fd 100644
    a b  
    11; pos=yes warn=0
    22*cs EPSG:4167
    3 *cs ESRI:104305
     3*cs EPSG:4167 ; FIXME: +init=esri:nnnn broken in PROJ 6?
    44*cs EUR79Z30
    55*cs IJTSK
    66*cs IJTSK03
  • tests/csbad.out

    diff --git a/tests/csbad.out b/tests/csbad.out
    index 36480d24..098fb72c 100644
    a b  
    6565./csbad.svx:24:9: error: Coordinate system unsuitable for output
    6666 *cs out jtsk03
    6767         ^~~~~~
    68 ./csbad.svx:29: error: Failed to convert coordinates: latitude or longitude exceeded limits
    69  *fix 2 reference 179 -89 1000
    7068
    7169Removing trailing traverses...
    7270
    Total length of survey legs = 0.00m ( 0.00m adjusted) 
    8987Total plan length of survey legs =    0.00m
    9088Total vertical length of survey legs =    0.00m
    9189   2 0-nodes.
    92 There were 0 warning(s) and 24 error(s) - no output files produced.
     90There were 0 warning(s) and 23 error(s) - no output files produced.
  • tests/csbad.svx

    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
    22*fix 1 reference 0 0 0
    33*cs EPSG:-1
    44*cs ERSI:1234
     
    2626; that cavern relays the error usefully.
    2727*cs out osgb:ha
    2828*cs long-lat
     29; FIXME doesn't fail with PROJ6
    2930*fix 2 reference 179 -89 1000