Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove all traces of nad2bin and nad2nad
Browse files Browse the repository at this point in the history
The source material for the default grids used by
PROJ has been moved to the proj-datumgrid repository. For that
reason it is no longer necessary to include the nad2bin program
in the PROJ repository and source distribution. From now on the
nad2bin application will be kept in the proj-datumgrid repo.

Previously the null grid was generated by running nad2bin on the
null.lla file. Since nad2bin is no longer available null.lla has
been replaced by its binary counterpart null. This file will be
distributed and installed alongside PROJ.

Build scripts and documenation has been adjusted so that nad2bin
is not mentioned anywhere. Additionally all references to nad2nad
has been removed as well. nad2nad has not been part of the PROJ
distribution for quite some time so this has been long overdue.
kbevers committed Feb 4, 2019
1 parent 2e6dde7 commit 8cbb997
Showing 14 changed files with 12 additions and 740 deletions.
55 changes: 1 addition & 54 deletions cmake/ProjUtilities.cmake
Original file line number Diff line number Diff line change
@@ -111,57 +111,4 @@ function(proj_target_output_name TARGET_NAME OUTPUT_NAME)
endif()

set(${OUTPUT_NAME} ${TARGET_NAME}${SUFFIX} PARENT_SCOPE)
endfunction()


#
# conversion from lla name to lla convert name ( without lla extension)
#

function(proj_lla_output_name LLA_INPUT_NAME LLA_OUTPUT_NAME )
get_filename_component(filename ${LLA_INPUT_NAME} NAME_WE)
get_filename_component(pathname ${LLA_INPUT_NAME} PATH)
set(${LLA_OUTPUT_NAME} ${pathname}/${filename} PARENT_SCOPE)
set(${LLA_OUTPUT_NAME} ${pathname}/${filename} PARENT_SCOPE)
endfunction()

function(proj_lla_target_name LLA_INPUT_NAME LLA_TARGET )
get_filename_component(filename ${LLA_INPUT_NAME} NAME_WE)
set(${LLA_TARGET} ${filename} PARENT_SCOPE)
endfunction()

#
# in place conversion of lla file to gsb
#

function(proj_convert_grid_lla2gsb GRID_DIRECTORY)
set(NAD2BIN_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
set(NAD2BIN_PATH ${NAD2BIN_DIR}/nad2bin${CMAKE_EXECUTABLE_SUFFIX})
file(TO_NATIVE_PATH ${NAD2BIN_PATH} NAD2BIN_EXE)
file(GLOB LLA_FILES ${${GRID_DIRECTORY}}/*.lla)
foreach(LLA ${LLA_FILES} )
proj_lla_output_name(${LLA} DEST_FILE)
file(TO_NATIVE_PATH ${DEST_FILE} DEST)
proj_lla_target_name(${LLA} LLA_TARGET)
if(NOT EXISTS ${DEST})
add_custom_target( ${LLA_TARGET} ALL
COMMAND ${NAD2BIN_EXE} ${DEST} "<" ${LLA}
DEPENDS nad2bin )
endif(NOT EXISTS ${DEST})
endforeach(LLA)
endfunction()

#
# add lla output list to an existing file list
#

function(proj_append_lla_output_file LLA_INPUT_FILE FILE_LIST)
set(LIST_OUT ${${FILE_LIST}})
foreach(LLA ${${LLA_INPUT_FILE}} )
proj_lla_output_name(${LLA} DEST_FILE)
file(TO_NATIVE_PATH ${DEST_FILE} DEST)
set(LIST_OUT ${LIST_OUT} ${DEST_FILE} )
endforeach(LLA ${LLA_INPUT_FILE})
set(${FILE_LIST} ${LIST_OUT} PARENT_SCOPE)
endfunction()

endfunction()
11 changes: 0 additions & 11 deletions data/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -22,17 +22,6 @@ file(GLOB GTX_FILES *.gtx)
set(GRIDSHIFT_FILES ${GSB_FILES} ${GTX_FILES})
set(GRIDSHIFT_FILES ${GRIDSHIFT_FILES}
)
option(CONVERT_DATA "convert some ascii file to binary file for use in proj4" OFF)
if(CONVERT_DATA)
if (BUILD_NAD2BIN)
set(LLA_GRID_DIR ${CMAKE_CURRENT_SOURCE_DIR})
proj_convert_grid_lla2gsb(LLA_GRID_DIR)
file(GLOB LLA_FILES *.lla)
proj_append_lla_output_file(LLA_FILES GRIDSHIFT_FILES)
else()
message(ERROR " you need to compile nad2bin exe in order to convert data file" )
endif(BUILD_NAD2BIN)
endif(CONVERT_DATA)

set(ALL_SQL_IN "${CMAKE_CURRENT_SOURCE_DIR}/all.sql.in")
set(PROJ_DB "${CMAKE_CURRENT_SOURCE_DIR}/proj.db")
33 changes: 5 additions & 28 deletions data/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
DATAPATH = $(top_srcdir)/data

pkgdata_DATA = GL27 nad.lst nad27 nad83 world other.extra \
CH \
CH null \
ITRF2000 ITRF2008 ITRF2014 proj.db

SQL_ORDERED_LIST = sql/begin.sql \
@@ -40,34 +40,11 @@ EXTRA_DIST = GL27 nad.lst nad27 nad83 \
world other.extra \
CH \
ITRF2000 ITRF2008 ITRF2014 \
CMakeLists.txt tests/test_nodata.gtx null.lla \
CMakeLists.txt tests/test_nodata.gtx null \
generate_all_sql_in.cmake sql_filelist.cmake \
$(SQL_ORDERED_LIST)

process-nad2bin:
@if [ -f $(DATAPATH)/null.lla -a ! -f null ] || [ -f $(DATAPATH)/conus.lla -a ! -f conus ] ; then \
for x in $(DATAPATH)/*.lla ; do \
DEST=`basename $$x .lla`; \
echo "../src/nad2bin$(EXEEXT) $$DEST < $$x"; \
../src/nad2bin$(EXEEXT) $$DEST < $$x ; \
done; \
fi

install-data-local: process-nad2bin
$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
@if [ -f $(DATAPATH)/null.lla -a ! -f $(DATAPATH)/null ] || [ -f $(DATAPATH)/conus.lla -a ! -f $(DATAPATH)/conus ] ; then \
for x in $(DATAPATH)/*.lla ; do \
DEST=$(DESTDIR)$(pkgdatadir)/`basename $$x .lla`; \
echo "../src/nad2bin$(EXEEXT) $$DEST < $$x"; \
../src/nad2bin$(EXEEXT) $$DEST < $$x ; \
if [ $$? -ne 0 ] ; then \
echo "nad2bin$(EXEEXT) failed to install $$DEST"; \
exit 1; \
fi; \
done; \
else \
echo "nad2nad NADCON source files not present"; \
fi
install-data-local:
@for gridfile in $(DATAPATH)/*.gsb $(DATAPATH)/*.gtx $(DATAPATH)/ntv1_can.dat dummy \
$(DATAPATH)/alaska $(DATAPATH)/conus $(DATAPATH)/hawaii $(DATAPATH)/null \
$(DATAPATH)/prvi $(DATAPATH)/stgeorge $(DATAPATH)/stlrnc $(DATAPATH)/stpaul \
@@ -97,9 +74,9 @@ proj.db: $(DATAPATH)/sql/*.sql
exit 1; \
fi


# For out-of-tree builds, link all file of the source data dir to the generated data
check-local: process-nad2bin
check-local:
@if [ ! -f GL27 ]; then \
for x in $(DATAPATH)/*; do \
ln -sf $$x .; \
7 changes: 3 additions & 4 deletions data/README
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
The files in this directory are support data for PROJ programs
as well as test scripts for testing proj installation.
The files in this directory are support data for PROJ programs.

File Contents:

@@ -28,7 +27,7 @@ nad.lst --- Reference list of SPCS States and NGS datum identifiers

IGNF --- Translation of French Mapping Agency codes into PROJ via init= mechanism.

install --- Unix shell (sh) script to install nad2nad file and proj
init files. Read beginning for usage instructions.
install --- Unix shell (sh) script to install proj init files.
Read beginning for usage instructions.

Additional data files are available in https://github.com/OSGeo/proj-datumgrid/
26 changes: 0 additions & 26 deletions data/install.in
Original file line number Diff line number Diff line change
@@ -23,31 +23,5 @@ do
echo "file $x installed"
fi
done
# just test for conus and assume others are there
if [ -f conus.lla ] ; then
# install nad2nad NADCON files
echo "installing ${lib}/nad2783"
lib=${lib}/nad2783
if [ ! -d $lib ] ; then
mkdir $lib
if [ $? -ne 0 ] ; then
echo "failed to make dir $lib"
echo "nad2nad lib install stopped"
exit 1
fi
fi
# Process ascii grid into nad2nad compatible files.
for x in *.lla ; do
dest=`expr $x : '\(.*\)\.lla'`
cat < $x | ../src/nad2bin ${lib}/${dest}
if [ $? -ne 0 ] ; then
echo "nad2nad file install failed on file ${lib}/${dest}"
exit 1
fi
echo "${lib}/${dest} installed"
done
else
echo "nad2nad NADCON files not present"
fi
echo "normal completion"
exit 0
Binary file added data/null
Binary file not shown.
5 changes: 0 additions & 5 deletions data/null.lla

This file was deleted.

3 changes: 1 addition & 2 deletions docs/source/usage/transformation.rst
Original file line number Diff line number Diff line change
@@ -210,8 +210,7 @@ at each grid location. Actually grid shifts are normally computed based on an
interpolation between the containing four grid points.

PROJ supports use of grid files for shifting between various reference frames.
The grid shift table formats are ctable (the binary format produced by the PROJ
``nad2bin`` program), NTv1 (the old Canadian format), and NTv2 (``.gsb`` - the new
The grid shift table formats are ctable, NTv1 (the old Canadian format), and NTv2 (``.gsb`` - the new
Canadian and Australian format).

The text in this section is based on the *cs2cs* framework. Gridshifting is off
195 changes: 0 additions & 195 deletions man/man1/nad2nad.1

This file was deleted.

6 changes: 0 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -7,7 +7,6 @@ option(BUILD_CCT "Build cct (coordinate conversion and transformation tool)"
option(BUILD_CS2CS "Build cs2cs (coordinate systems to coordinate systems translation tool)" ON)
option(BUILD_GEOD "Build geod (computation of geodesic lines)" ON)
option(BUILD_GIE "Build gie (geospatial integrity investigation environment - a PROJ.4 test tool)" ON)
option(BUILD_NAD2BIN "Build nad2bin (format conversion tool)" ON)
option(BUILD_PROJ "Build proj (cartographic projection tool : latlong <-> projected coordinates)" ON)
option(BUILD_PROJINFO "Build projinfo (SRS and coordinate operation metadata/query tool)" ON)

@@ -50,11 +49,6 @@ if(BUILD_GEOD)
set(BIN_TARGETS ${BIN_TARGETS} geod)
endif(BUILD_GEOD)

if(BUILD_NAD2BIN)
include(bin_nad2bin.cmake)
set(BIN_TARGETS ${BIN_TARGETS} nad2bin)
endif(BUILD_NAD2BIN)

if(BUILD_PROJ)
include(bin_proj.cmake)
set(BIN_TARGETS ${BIN_TARGETS} binproj)
6 changes: 2 additions & 4 deletions src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AM_CFLAGS = @C_WFLAGS@

bin_PROGRAMS = proj nad2bin geod cs2cs gie cct projinfo
bin_PROGRAMS = proj geod cs2cs gie cct projinfo
EXTRA_PROGRAMS = multistresstest test228

TESTS = geodtest
@@ -14,15 +14,14 @@ include_HEADERS = proj.h proj_experimental.h proj_constants.h proj_api.h geodesi
org_proj4_PJ.h proj_symbol_rename.h

EXTRA_DIST = bin_cct.cmake bin_gie.cmake bin_cs2cs.cmake \
bin_geod.cmake bin_nad2bin.cmake bin_proj.cmake bin_projinfo.cmake \
bin_geod.cmake bin_proj.cmake bin_projinfo.cmake \
lib_proj.cmake CMakeLists.txt bin_geodtest.cmake tests/geodtest.cpp \
wkt1_grammar.y wkt2_grammar.y apps/emess.h

proj_SOURCES = apps/proj.cpp apps/emess.cpp
projinfo_SOURCES = apps/projinfo.cpp
cs2cs_SOURCES = apps/cs2cs.cpp apps/emess.cpp
cct_SOURCES = apps/cct.cpp apps/proj_strtod.cpp apps/proj_strtod.h apps/optargpm.h
nad2bin_SOURCES = apps/nad2bin.cpp
geod_SOURCES = apps/geod.cpp apps/geod_set.cpp apps/geod_interface.cpp apps/geod_interface.h apps/emess.cpp

gie_SOURCES = apps/gie.cpp apps/proj_strtod.cpp apps/proj_strtod.h apps/optargpm.h
@@ -35,7 +34,6 @@ cs2cs_LDADD = libproj.la
geod_LDADD = libproj.la
proj_LDADD = libproj.la
projinfo_LDADD = libproj.la
nad2bin_LDADD = libproj.la

gie_LDADD = libproj.la
multistresstest_LDADD = libproj.la @THREAD_LIB@
382 changes: 0 additions & 382 deletions src/apps/nad2bin.cpp

This file was deleted.

17 changes: 0 additions & 17 deletions src/bin_nad2bin.cmake

This file was deleted.

6 changes: 0 additions & 6 deletions src/nad_list.h

This file was deleted.

0 comments on commit 8cbb997

Please sign in to comment.