Commit 8fcbf2e5 authored by Dan Lipsa's avatar Dan Lipsa
Browse files

Remove all proj4 files to start fresh.

proj4 is updated from a very old source for which there is no repo online.
We remove all files to start fresh on a recent proj4.
parent c7a68904
Pipeline #7159 passed with stage
#------------------------------------------------------------------------------
# libproj4 -- library of cartographic projections
#
project( libproj4 )
#------------------------------------------------------------------------------
# Platform configuration tests and options.
# Shared or static library?
if ( NOT DEFINED BUILD_SHARED_LIBS )
option( BUILD_SHARED_LIBS "Should libproj4 be built as a shared library (or static)?" OFF )
endif ()
# Only experts should turn this on:
option( PROJ_LIST_EXTERNAL "Does an external project define proj_list or should libproj4 define it?" OFF )
mark_as_advanced( PROJ_LIST_EXTERNAL )
if ( PROJ_LIST_EXTERNAL AND BUILD_SHARED_LIBS )
message( FATAL_ERROR "You may not define both PROJ_LIST_EXTERNAL and BUILD_SHARED_LIBS. Turn one off and re-run CMake." )
endif ()
# Make libproj4 thread-safe?
option( PROJ_USE_PTHREADS "Should libproj4 be built as a thread-friendly library?" ${VTK_USE_PTHREADS} )
mark_as_advanced( PROJ_USE_PTHREADS )
if ( PROJ_USE_PTHREADS )
if ( NOT VTK_USE_PTHREADS )
message( FATAL_ERROR "Your platform does not appear to support pthreads. Please turn PROJ_USE_PTHREADS off and retry." )
endif ()
endif ()
# Include code that requires GSL
option( PROJ_USE_GSL "Should libproj4 include projection code that relies on GSL?" OFF )
mark_as_advanced( PROJ_USE_GSL )
if ( PROJ_USE_GSL )
find_package( PkgConfig )
if ( PKG_CONFIG_FOUND )
pkg_check_modules( GSL REQUIRED gsl )
endif ()
if ( NOT GSL_FOUND )
message( FATAL_ERROR "You must install GSL and its pkg-config file OR turn PROJ_USE_GSL off" )
endif ()
endif ()
# Test for "double complex" type and "atanh()" support.
if ( UNIX )
set( LINK_LIBRARIES m )
endif ()
include(CheckSymbolExists)
set(CMAKE_REQUIRED_LIBRARIES m)
check_symbol_exists(csin complex.h PROJ_HAVE_COMPLEX)
check_symbol_exists(atanh math.h PROJ_HAVE_ATANH)
set(CMAKE_REQUIRED_LIBRARIES)
#------------------------------------------------------------------------------
# Source
set( AZIM_SRCS
proj_aeqd.c proj_aitoff.c proj_geos.c
proj_gilbert.c proj_gnom.c proj_hammer.c
proj_laea.c proj_mod_ster.c proj_nsper.c
proj_nzmg.c proj_ortho.c proj_rouss.c
proj_sterea.c proj_stere.c proj_wag7.c
proj_wag9.c
)
set( CONIC_SRCS
proj_aea.c proj_bipc.c proj_bonne.c
proj_eqdc.c proj_hill.c proj_imw_p.c
proj_kocc.c proj_lcca.c proj_lcc.c
proj_poly.c proj_rpoly.c proj_sconics.c
)
set( CYLIND_SRCS
proj_ardn_cls.c proj_braun2.c proj_cass.c
proj_cc.c proj_cea.c proj_cubic.c
proj_cyl_stere.c proj_eqc.c proj_labrd.c
proj_lsat.c proj_merc.c proj_mill_2.c
proj_mill.c proj_mill_per.c proj_ocea.c
proj_omerc.c proj_somerc.c proj_tcc.c
proj_tcea.c proj_tmerc.c proj_tob_sqr.c
proj_etmerc.c
)
if ( PROJ_HAVE_COMPLEX )
set( CYLIND_SRCS
${CYLIND_SRCS}
proj_ftmerc.c
)
endif ()
if ( PROJ_HAVE_ATANH )
set( CYLIND_SRCS
${CYLIND_SRCS}
proj_gstmerc.c
proj_ktmerc.c
)
endif ()
set( MISC_SRCS
proj_airy.c proj_apian2.c proj_armadillo.c
proj_august.c proj_bacon.c
proj_eisen.c proj_four1.c proj_guyou.c
proj_lagrng.c proj_larr.c proj_lask.c
proj_nocol.c proj_ob_tran.c proj_oea.c
proj_tpeqd.c proj_vandg2.c proj_vandg4.c
proj_vandg.c
)
set( PSEUDO_SRCS
proj_baker.c proj_baranyi4.c proj_baranyi.c
proj_boggs.c proj_collg.c proj_crast.c
proj_denoy.c proj_eck1.c proj_eck2.c
proj_eck3.c proj_eck4.c proj_eck5.c
proj_equi_moll.c proj_erdi_ksz.c proj_fahey.c
proj_fc-loerr.c proj_fouc_s.c proj_four2.c
proj_gins8.c proj_gn_sinu.c proj_goode.c
proj_hatano.c proj_holzel.c proj_loxim.c
proj_maurer.c proj_mayr.c proj_mbtfpp.c
proj_mbtfpq.c proj_mbt_fps.c proj_mcb_s3.c
proj_moll.c proj_nell.c
proj_oxford.c proj_putp2.c proj_putp3.c
proj_putp4p.c proj_putp5.c proj_putp6.c
proj_robin.c proj_semiconf.c proj_s_min_err.c
proj_sts.c proj_tob_g1.c proj_trapez.c
proj_urm5.c proj_urmfps.c proj_wag2.c
proj_wag3.c proj_wag5.c proj_wink1.c
proj_wink2.c
)
if ( PROJ_HAVE_ATANH )
set( PSEUDO_SRCS
${PSEUDO_SRCS}
proj_nell_h.c
)
endif ()
set( SUPPORT_SRCS
proj_adjlon.c proj_auth.c proj_deriv.c
proj_dmstor.c proj_ellps.c proj_ell_set.c
proj_err_list.c proj_errno.c proj_factors.c
proj_fwd.c proj_gauss.c proj_init.c
proj_inv.c proj_mdist.c
proj_msfn.c proj_param.c proj_phi2.c
proj_pr_list.c proj_rtodms.c proj_strerrno.c
proj_strerror_r.c proj_trans.c proj_translate.c
proj_tsfn.c proj_units.c proj_zpoly1.c
proj_psi.c
)
if ( NOT PROJ_LIST_EXTERNAL )
set( SUPPORT_SRCS
${SUPPORT_SRCS}
proj_list.c
)
#------------------------------------------------------------------------------
# Doesn't work with CMake 2.4
# set_source_files_properties(
# FILES
# proj_list.c
# PROPERTIES
# OBJECT_DEPENDS ${libproj4_SOURCE_DIR}/proj_list.h
# )
endif ()
set( LP4_SRCS
${AZIM_SRCS} ${CONIC_SRCS} ${CYLIND_SRCS}
${MISC_SRCS} ${PSEUDO_SRCS} ${SUPPORT_SRCS}
)
#------------------------------------------------------------------------------
# Executable and library targets
include_directories(
${libproj4_SOURCE_DIR}
${libproj4_BINARY_DIR}
)
vtk_add_library( vtkproj4
${LP4_SRCS}
)
if ( UNIX )
target_link_libraries( vtkproj4
LINK_PUBLIC
m
)
endif ()
if ( PROJ_LIBRARY_PROPERTIES )
set_target_properties( vtkproj4
PROPERTIES
${PROJ_LIBRARY_PROPERTIES}
)
endif ()
add_executable( lproj
lproj.c
)
target_link_libraries( lproj
vtkproj4
)
if ( GSL_FOUND )
include_directories( GSL_INCLUDE_DIRS )
target_link_libraries( proj4
${GSL_LIBRARIES}
)
endif ()
configure_file(
${libproj4_SOURCE_DIR}/proj_config.h.cmake
${libproj4_BINARY_DIR}/proj_config.h
)
#------------------------------------------------------------------------------
# Install targets
IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
INSTALL(FILES
${libproj4_SOURCE_DIR}/lib_proj.h
${libproj4_SOURCE_DIR}/vtk_libproj4_mangle.h
${libproj4_BINARY_DIR}/proj_config.h
DESTINATION ${VTK_INSTALL_INCLUDE_DIR}/vtklibproj4
COMPONENT Development)
ENDIF()
Id
This constitutes "release" 3 of libproj4. This release changes
the name space to "proj_" prefix of all global identifiers. Also,
this release should be 'thread-safe' except for proj_rtodms() which
is *not* used by any of the library procedures.
This file takes the place of a "configure" system which is
far too complex for this humble peon to figure out how to use.
Fortunately, the libproj4 system is easy to install and should
be quite portable across Unix, Linux operating systems. Typical
sequence is to:
make libproj4
make lproj
make install
But before doing the above please examine the beginning of the
Makefile and adjust the options at the beginning of the Makefile. For
installation the default destination directories are in the home
directory of the installer. To make the library and lproj executable
easily usable by other users modify the directory base set by the
parameter 'prefix.' You may have to be super user to use some of the
settings.
----- T H R E A D S ----
To make libproj4 threads friendly, use "THEADS=1". Any program using
thelibrary will have to reference '-lpthread' library. If one is
never interested in thread program comment out the option.
The library procedure proj_rtodms is not threads friendly but it is *not*
used by any projection routine and is supplied as a supplementary
procedure.
This is some contention between 'info' documentation and GNU software
regarding the implementation of the 'strerror_r' function. Non-GNU
standards require integer return whereas GNU default implementation
returns a pointer to a string---not compatible with threads.
----- N O T I C E -----
The Mayr projection requires the use of the Gnu Scientific Library
for the general case usage where the +n= option is employed. The
distributed form of the Makefile excludes this option by commenting
out the line reading "GSL=1". When the library is compiled in
this manner trying "+proj=mayr +n=" will cause a failure. To enable
the full function of the mayr remove the # from the GSL=1 line before
compiling the library. Note: when the library is compiled in this
manner any program using the library will also have to link with
the GSL library.
As always, please submit any bugs to the author at:
geraldi.evenden@gmail.com
PS: the release/version of libproj4 is based upon the date that forms
the name of the distribution file and the name of a null file in this
directory. Each program/header file will have its own revision/date
entry.
Log: README
Revision 3.2 2008/06/21 17:06:10 gie
update comments about Makefile
Revision 3.1 2006/01/24 01:44:57 gie
new release
Revision 1.2 2005/02/04 01:54:13 gie
added PS
Revision 1.1 2005/02/04 01:47:45 gie
Initial revision
/* General projections header file */
/*
** libproj4 -- library of cartographic projections
**
** Id
**
** Copyright (c) 2003, 2005, 2006 Gerald I. Evenden
**
** Permission is hereby granted, free of charge, to any person obtaining
** a copy of this software and associated documentation files (the
** "Software"), to deal in the Software without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Software, and to
** permit persons to whom the Software is furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be
** included in all copies or substantial portions of the Software.
**
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef PROJECTS_H
#define PROJECTS_H 1
#include "proj_config.h"
#if defined(__BORLANDC__)
// Disable Borland compiler warning messages that often occur in valid code.
# if !defined(VTK_DISPLAY_WIN32_WARNINGS)
# pragma warn -8004 /* assigned a value that is never used */
# pragma warn -8008 /* condition is always false */
# pragma warn -8026 /* funcs w/class-by-value args not expanded inline */
# pragma warn -8027 /* functions w/ do/for/while not expanded inline */
# pragma warn -8060 /* possibly incorrect assignment */
# pragma warn -8066 /* unreachable code */
# pragma warn -8072 /* suspicious pointer arithmetic */
# endif
#endif
#if defined(_MSC_VER)
// Disable MSVC compiler warning messages that often occur in valid code.
# if !defined(VTK_DISPLAY_WIN32_WARNINGS)
# pragma warning ( disable : 4706 ) /* assignment in conditional expression */
# endif
#endif
/* standard inclusions */
#include <math.h>
#include <stdlib.h>
/* depending who's compiling */
#ifdef __cplusplus
#define BEGIN_C_DECLS extern "C" {
#define END_C_DECLS }
#else
#define BEGIN_C_DECLS
#define END_C_DECLS
#endif
/* some useful constants */
#define HALFPI 1.5707963267948966
#define FORTPI 0.78539816339744833
#ifndef PI
#define PI 3.14159265358979323846
#endif
#define TWOPI 6.2831853071795864769
#define RAD_TO_DEG 57.29577951308232
#define DEG_TO_RAD .0174532925199432958
typedef struct { double u, v; } PROJ_UV;
typedef struct { double r, i; } PROJ_COMPLEX;
#ifdef PROJ_UV_TYPE
#define PROJ_XY PROJ_UV
#define PROJ_LP PROJ_UV
#else
typedef struct { double x, y; } PROJ_XY;
typedef struct { double lam, phi; } PROJ_LP;
#endif
PROJ_EXPORT int * proj_errno_loc(void);
#define proj_errno (*proj_errno_loc())
typedef struct {int errnum; char * name; } PROJ_ERR_LIST;
typedef union { double f; int i; const char *s; } PROJ_PVALUE;
struct PROJ_ELLPS {
char *id; /* ellipse keyword name */
char *major; /* a= value */
char *ell; /* elliptical parameter */
char *name; /* comments */
};
struct PROJ_UNITS {
char *id; /* units keyword */
char *to_meter; /* multiply by value to get meters */
char *name; /* comments */
};
struct PROJ_DERIVS {
double x_l, x_p; /* derivatives of x for lambda-phi */
double y_l, y_p; /* derivatives of y for lambda-phi */
};
struct PROJ_FACTORS {
struct PROJ_DERIVS der;
double h, k; /* meridinal, parallel scales */
double omega, thetap; /* angular distortion, theta prime */
double conv; /* convergence */
double s; /* areal scale factor */
double a, b; /* max-min scale error */
int code; /* info as to analytics, see following */
};
#define IS_ANAL_XL_YL 01 /* derivatives of lon analytic */
#define IS_ANAL_XP_YP 02 /* derivatives of lat analytic */
#define IS_ANAL_HK 04 /* h and k analytic */
#define IS_ANAL_CONV 010 /* convergence analytic */
/* parameter list struct */
typedef struct ARG_list {
struct ARG_list *next;
char used;
char param[1]; } paralist;
/* base projection data structure */
typedef struct PROJconsts {
PROJ_XY (*fwd)(PROJ_LP, struct PROJconsts *);
PROJ_LP (*inv)(PROJ_XY, struct PROJconsts *);
void (*spc)(PROJ_LP, struct PROJconsts *, struct PROJ_FACTORS *);
void (*pfree)(struct PROJconsts *);
const char *descr;
paralist *params; /* parameter list */
int over; /* over-range flag */
int geoc; /* geocentric latitude flag */
double
a, /* major axis or radius if es==0 */
e, /* eccentricity */
es, /* e ^ 2 */
ra, /* 1/A */
one_es, /* 1 - e^2 */
rone_es, /* 1/one_es */
lam0, phi0, /* central longitude, latitude */
x0, y0, /* easting and northing */
k0, /* general scaling factor */
to_meter, fr_meter; /* cartesian scaling */
#ifdef PROJ_PARMS__
PROJ_PARMS__
#endif /* end of optional extensions */
} PROJ;
struct PROJ_LIST {
const char *id; /* projection keyword */
PROJ *(*proj)(PROJ *); /* projection entry point */
char * const *descr; /* description text */
};
/* Generate proj_list external or make list from include file */
BEGIN_C_DECLS
#ifndef PROJ_LIST_H
extern PROJ_EXPORT const struct PROJ_LIST proj_list[];
#else
# define PROJ_HEAD(id, name) \
extern PROJ_EXPORT PROJ *proj_##id(PROJ *); extern PROJ_EXPORT char * const proj_s_##id;
# include PROJ_LIST_H
# undef PROJ_HEAD
# define PROJ_HEAD(id, name) {#id, proj_##id, &proj_s_##id},
PROJ_EXPORT const struct PROJ_LIST
proj_list[] = {
# include PROJ_LIST_H
{0, 0, 0},
};
# undef PROJ_HEAD
#endif
#if defined ( _MSC_VER )
#pragma warning ( disable : 4132 )
// const object should be initialized...
// these two are initialized in the .c files...
#endif
#ifndef PROJ_ELLPS__
extern
#endif
PROJ_EXPORT const struct PROJ_ELLPS proj_ellps[];
#ifndef PROJ_UNITS__
extern
#endif
PROJ_EXPORT const struct PROJ_UNITS proj_units[];
#if defined ( _MSC_VER )
#pragma warning ( default : 4132 )
#endif
#ifdef PROJ_LIB__
/* repeatative projection code */
#define PROJ_HEAD(id, name) static const char des_##id [] = name
#define ENTRYA(name) const char * const proj_s_##name = des_##name; \
PROJ *proj_##name(PROJ *P) { if (!P) { \
if ((P = (PROJ *)malloc(sizeof(PROJ)))) { \
P->pfree = freeup; P->fwd = 0; P->inv = 0; \
P->spc = 0; P->descr = des_##name;
#define ENTRYX } return P; } else {
#define ENTRY0(name) ENTRYA(name) ENTRYX
#define ENTRY1(name, a) ENTRYA(name) P->a = 0; ENTRYX
#define ENTRY2(name, a, b) ENTRYA(name) P->a = 0; P->b = 0; ENTRYX
#define ENDENTRY(p) } return (p); }
#define E_ERROR(err) { proj_errno = err; freeup(P); return(0); }
#define E_ERROR_0 { freeup(P); return(0); }
#define F_ERROR { proj_errno = -20; return(xy); }
#define I_ERROR { proj_errno = -20; return(lp); }
#define FORWARD(name) static PROJ_XY name(PROJ_LP lp,PROJ*P) {PROJ_XY xy={0.,0.}
#define INVERSE(name) static PROJ_LP name(PROJ_XY xy,PROJ*P) {PROJ_LP lp={0.,0.}
#define FREEUP static void freeup(PROJ *P) {
#define SPECIAL(name) static void name(PROJ_LP lp, PROJ *P, struct PROJ_FACTORS *fac)
#endif
/* procedure prototypes */
PROJ_EXPORT double proj_dmstor(const char *, char **);
PROJ_EXPORT void proj_set_rtodms(int, int);
PROJ_EXPORT char *proj_rad2dms(char *, double, const char *);
PROJ_EXPORT char *proj_rtodms(char *, double, const char *);
PROJ_EXPORT double proj_adjlon(double);
PROJ_EXPORT double proj_acos(double);
PROJ_EXPORT double proj_asin(double);
PROJ_EXPORT double proj_sqrt(double);
PROJ_EXPORT double proj_atan2(double, double);
PROJ_EXPORT PROJ_PVALUE proj_param(paralist *, const char *);
PROJ_EXPORT paralist *proj_mkparam(char *);
PROJ_EXPORT int proj_ell_set(paralist *, double *, double *);
PROJ_EXPORT void *proj_mdist_ini(double);
PROJ_EXPORT double proj_mdist(double, double, double, const void *);
PROJ_EXPORT double proj_inv_mdist(double, const void *);
PROJ_EXPORT void *proj_gauss_ini(double, double, double *,double *);
PROJ_EXPORT PROJ_LP proj_gauss(PROJ_LP, const void *);
PROJ_EXPORT PROJ_LP proj_inv_gauss(PROJ_LP, const void *);
PROJ_EXPORT PROJ_LP proj_translate(PROJ_LP, const void *);
PROJ_EXPORT PROJ_LP proj_inv_translate(PROJ_LP, const void *);
PROJ_EXPORT void *proj_translate_ini(double, double);
PROJ_EXPORT double proj_tsfn(double, double, double);
PROJ_EXPORT double proj_msfn(double, double, double);
PROJ_EXPORT double proj_phi2(double, double);
PROJ_EXPORT double proj_qsfn(double, const void *);
PROJ_EXPORT double proj_psi(double, double, double);
PROJ_EXPORT double proj_apsi(double, double);
PROJ_EXPORT void *proj_auth_ini(double, double *);
PROJ_EXPORT double proj_auth_lat(double, const void *);
PROJ_EXPORT double proj_auth_inv(double, const void *);
PROJ_EXPORT PROJ_COMPLEX proj_zpoly1(PROJ_COMPLEX, PROJ_COMPLEX *, int);
PROJ_EXPORT PROJ_COMPLEX proj_zpolyd1(PROJ_COMPLEX, PROJ_COMPLEX *, int, PROJ_COMPLEX *);
PROJ_EXPORT int proj_deriv(PROJ_LP, double, PROJ *, struct PROJ_DERIVS *);
PROJ_EXPORT int proj_factors(PROJ_LP, PROJ *, double, struct PROJ_FACTORS *);
PROJ_EXPORT PROJ_XY proj_fwd(PROJ_LP, PROJ *);
PROJ_EXPORT PROJ_LP proj_inv(PROJ_XY, PROJ *);
PROJ_EXPORT void proj_pr_list(PROJ *);
PROJ_EXPORT void proj_free(PROJ *);
PROJ_EXPORT PROJ *proj_init(int, char **);
PROJ_EXPORT char *proj_strerrno(int);
PROJ_EXPORT int proj_strerror_r(int, char *, int);
END_C_DECLS
#endif /* end of basic projections header */
/*
** Log: lib_proj.h
** Revision 1.2 2008-11-10 20:40:20 jeff
** COMP: Ignoring assignment in conditional expression warning.
**
** Revision 1.1 2008-11-07 16:41:13 jeff
** ENH: Adding a 2D geoview. Adding the geographic projection library libproj4
** to Utilities. Updating the architecture of the geospatial views. All
** multi-resolution sources are now subclasses of vtkGeoSource. Each source
** has its own worker thread for fetching refined images or geometry.
** On the 3D side, vtkGeoGlobeSource is an appropriate source for vtkGeoTerrain,
** and vtkGeoAlignedImageSource is an appropriate source for
** vtkGeoAlignedImageRepresentation. On the 2D side, vtkGeoProjectionSource is an
** appropriate source for vtkGeoTerrain2D, and the image source is the same.
**
** Revision 3.3 2008/06/04 17:15:22 gie
** new material
**
** Revision 3.2 2006/01/24 01:17:22 gie
** updates
**
** Revision 3.1 2006/01/11 02:41:14 gie
** Initial
**
**
*/
/*
** lproj: projgram to exercise library of cartographic projections
**
** Copyright (c) 2003, 2005, 2006 Gerald I. Evenden
*/
static const char
RCS_ID[] = "Id";
/*
** Permission is hereby granted, free of charge, to any person obtaining
** a copy of this software and associated documentation files (the
** "Software"), to deal in the Software without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Software, and to
** permit persons to whom the Software is furnished to do so, subject to
** the following conditions:
**
** The above copyright notice and this permission notice shall be
** included in all copies or substantial portions of the Software.
**
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF