From 8302bf9db2d5bfa3a84a0f9ddf31a90698cccc84 Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Mon, 7 Aug 2017 10:37:40 +0200 Subject: Adding info functions to proj.h API. (#551) * Adding info functions to proj.h API. Four new functions are added with this commit: proj_info(), proj_pj_info(), proj_grid_info() and proj_init_info(). Additionally four new data types are added: PJ_INFO, PJ_PROJ_INFO, PJ_GRID_INFO and PJ_INIT_INFO. The functions return the corresponding data types. These functions allows users of the PROJ.4 library to get information about various PROJ.4 entities and the library itself. The new data types are structs that contain specific information about either the library instance, a PJ instance, a grid or an init file. Together the four new functions cover a big part of the functionality in the semi-public projects.h API and should hopefully make it easier for user to migrate their code to the proj.h API in the future. Besides covering already existing functionality in the old API, this commit introduces the ability to add metadata to init-files. This is primarily added to give users a way of knowing which version of the EPSG database they are using, but it also comes in handy for other init-files. The init-file metadata is added directly to the init-file as a special "projection" called "metadata". The info projection of the epsg init-file is thus described as: +version=9.0.0 +origin=EPSG +lastupdate=2017-01-10 The proj_init_info() function uses the internal pj_param() to read the metadata. As a consequence, "metadata" will not be available as a the name of a projection in the future. This is a reasonable price to pay considering the ease of the implementation of adding metadata to init-files this way, and of course that "metadata" is a very unlikely name for a projection in any case. A metadata tag has been added to all init-files in the nad-directory. For most only a subset of the possible parameters has been added. * Replaced calls to sprintf and strncpy with safer options. Added pj_strlcpy for internal use. * Fail gracefully when getting non-initialized PJ in proj_pj_info() * Change length of filename member in PJ_INIT_INFO and PJ_GRID_INFO to 260 (MAX_PATH) --- nad/CH | 1 + nad/GL27 | 1 + nad/IGNF | 1 + nad/epsg | 1 + nad/esri | 1 + nad/nad27 | 1 + nad/nad83 | 1 + nad/world | 2 ++ 8 files changed, 9 insertions(+) (limited to 'nad') diff --git a/nad/CH b/nad/CH index 7ae73187..80b6967f 100644 --- a/nad/CH +++ b/nad/CH @@ -16,6 +16,7 @@ # # This init file uses the official one # + +origin=Swisstopo +lastupdate=2012-02-27 # CH1903/LV03 <1903_LV03> +proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=600000 +y_0=200000 +ellps=bessel +units=m +nadgrids=chenyx06etrs.gsb +no_defs # CH1903 diff --git a/nad/GL27 b/nad/GL27 index dd927bd2..73fa9754 100644 --- a/nad/GL27 +++ b/nad/GL27 @@ -1,5 +1,6 @@ # SCCSID @(#)GL27 1.1 93/08/25 GIE REL # Great Lakes Grids + +lastupdate=1993-08-25 # Lake Erie, Ontario and St. Lawrence River. proj=omerc ellps=clrk66 k_0=0.9999 lonc=78d00'W lat_0=44d00'N alpha=55d40' diff --git a/nad/IGNF b/nad/IGNF index 5a5d559a..a29657fb 100644 --- a/nad/IGNF +++ b/nad/IGNF @@ -1,3 +1,4 @@ + +version=1.0.0 +origin=IGNF +lastupdate=2011-11-27 # W [AMANU49] # W [AMANU63] +title=Ile d'Amsterdam 1963 +proj=geocent +towgs84=109.7530,-528.1330,-362.2440 +a=6378388.0000 +rf=297.0000000000000 +units=m +no_defs <> diff --git a/nad/epsg b/nad/epsg index 5159b79d..4276161d 100644 --- a/nad/epsg +++ b/nad/epsg @@ -1,3 +1,4 @@ + +version=9.0.0 +origin=EPSG +lastupdate=2017-01-10 # HD1909 <3819> +proj=longlat +ellps=bessel +towgs84=595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408 +no_defs <> # TWD67 diff --git a/nad/esri b/nad/esri index b59fa216..36e35be2 100644 --- a/nad/esri +++ b/nad/esri @@ -1,3 +1,4 @@ + +origin=Esri +lastupdate=2017-02-26 # Anguilla 1957 / British West Indies Grid <2000> +proj=tmerc +lat_0=0 +lon_0=-62 +k=0.999500 +x_0=400000 +y_0=0 +ellps=clrk80 +units=m +no_defs <> # Antigua 1943 / British West Indies Grid diff --git a/nad/nad27 b/nad/nad27 index 6e06900c..c5e43962 100644 --- a/nad/nad27 +++ b/nad/nad27 @@ -4,6 +4,7 @@ # State Plane Coordinate Systems, # North American Datum 1927 + +lastupdate=1992-12-20 # 101: alabama east: nad27 <101> proj=tmerc datum=NAD27 lon_0=-85d50 lat_0=30d30 k=.99996 diff --git a/nad/nad83 b/nad/nad83 index e740a4d5..1b65f519 100644 --- a/nad/nad83 +++ b/nad/nad83 @@ -4,6 +4,7 @@ # State Plane Coordinate Systems, # North American Datum 1983 + +lastupdate=1992-12-20 # 101: alabama east: nad83 <101> proj=tmerc datum=NAD83 lon_0=-85d50 lat_0=30d30 k=.99996 diff --git a/nad/world b/nad/world index 092df230..9119eed8 100644 --- a/nad/world +++ b/nad/world @@ -1,6 +1,8 @@ # SCCSID @(#)world 1.2 95/08/05 GIE REL # proj +init files for various non-U.S. coordinate systems. # + +lastupdate=2016-12-12 + # Swiss Coordinate System +proj=somerc +lat_0=46d57'8.660"N +lon_0=7d26'22.500"E +ellps=bessel +x_0=600000 +y_0=200000 -- cgit v1.2.3