Skip to content
Commits on Source (16)
......@@ -943,6 +943,7 @@ PREDEFINED = HAVE_DLFCN_H \
__cplusplus \
DOXYGEN_SKIP \
HAVE_CURL \
HDFS_ENABLED \
CPL_UNUSED= \
UNUSED_IF_NO_GEOS= \
UNUSED_IF_NO_SFCGAL= \
......
......@@ -36,7 +36,8 @@ INSTALL_DIR = $(GDAL_ROOT)/install-sh -d
LIBS = $(SDE_LIB) @LIBS@ $(KAK_LIBS) $(DWG_LIBS) $(CURL_LIB) \
$(MRSID_LIBS) $(MRSID_LIDAR_LIBS) $(ECW_LIBS) $(INGRES_LIB) \
$(PCIDSK_LIB) $(RASDAMAN_LIB) $(SOSI_LIB) \
$(OPENCL_LIB) $(JVM_LIB) $(LIBICONV) $(FGDB_LIB) $(LIBXML2_LIB) $(MONGODB_LIB)
$(OPENCL_LIB) $(JVM_LIB) $(LIBICONV) $(FGDB_LIB) $(LIBXML2_LIB) $(MONGODB_LIB) \
$(JNI_LIB) $(HDFS_LIB)
SSEFLAGS = @SSEFLAGS@
SSSE3FLAGS = @SSSE3FLAGS@
......@@ -80,6 +81,7 @@ NO_SIGN_COMPARE = @NO_SIGN_COMPARE@
NO_NON_VIRTUAL_DTOR_FLAG = @NO_NON_VIRTUAL_DTOR_FLAG@
NO_LOGICAL_OP_FLAG = @NO_LOGICAL_OP_FLAG@
WARN_OLD_STYLE_CAST = @WARN_OLD_STYLE_CAST@
WARN_EFFCPLUSPLUS = @WARN_EFFCPLUSPLUS@
# Also available -DAFL_FRIENDLY for strcmp(), etc.. variants that will
# work better with American Fuzzy Lop branch examination logic
......@@ -120,9 +122,9 @@ GDAL_INCLUDE = -I$(GDAL_ROOT)/port -I$(GDAL_ROOT)/gcore \
# libtool targets and help variables
LIBGDAL := libgdal.la
LIBGDAL_CURRENT := 24
LIBGDAL_REVISION := 3
LIBGDAL_AGE := 4
LIBGDAL_CURRENT := 25
LIBGDAL_REVISION := 0
LIBGDAL_AGE := 5
# native build targets and variables
GDAL_VER = @GDAL_VER@
......@@ -190,6 +192,7 @@ LIBS += $(KEA_LIB)
#
# NetCDF Support.
#
NETCDF_MEM = @NETCDF_MEM@
NETCDF_ROOT = @NETCDF_ROOT@
NETCDF_HAS_NC4 = @NETCDF_HAS_NC4@
NETCDF_HAS_HDF4 = @NETCDF_HAS_HDF4@
......@@ -370,7 +373,6 @@ SOSI_INC = @SOSI_INC@
SOSI_LIB = @SOSI_LIB@
HAVE_SOSI = @SOSI_ENABLED@
#
# PCIDSK SDK
#
......@@ -420,6 +422,11 @@ endif
# PCRaster support
PCRASTER_SETTING = @PCRASTER_SETTING@
#
# LERC support.
#
HAVE_LERC = @HAVE_LERC@
OGDI_INCLUDE = @OGDI_INCLUDE@
PNG_SETTING = @PNG_SETTING@
......@@ -444,6 +451,7 @@ GEOMEDIA_SETTING = @ODBC_SETTING@
NETCDF_SETTING = @NETCDF_SETTING@
LIBZ_SETTING = @LIBZ_SETTING@
LIBLZMA_SETTING = @LIBLZMA_SETTING@
WEBP_SETTING = @WEBP_SETTING@
ZSTD_SETTING = @ZSTD_SETTING@
#
......@@ -534,6 +542,19 @@ MDB_ENABLED = @MDB_ENABLED@
HAVE_ARMADILLO = @HAVE_ARMADILLO@
#
# userfaultfd
#
ENABLE_UFFD = @ENABLE_UFFD@
#
# HDFS
#
HDFS_LIB = @HDFS_LIB@
HDFS_INC = @HDFS_INC@
HDFS_ENABLED = @HDFS_ENABLED@
JNI_LIB = @JNI_LIB@
#
# freexl stuff
#
......@@ -566,6 +587,8 @@ GDAL_FORMATS += coasp tsx terragen blx msgn til r northwood saga xyz hf2
GDAL_FORMATS += kmlsuperoverlay ctg e00grid zmap ngsgeoid iris map cals
GDAL_FORMATS += safe sentinel2 derived
GDAL_FORMATS += prf
GDAL_FORMATS += sigdem
GDAL_FORMATS += ignfheightasciigrid
GDAL_FORMATS += @OPT_GDAL_FORMATS@
ifneq ($(PCIDSK_SETTING),no)
......
......@@ -4,6 +4,7 @@ GDAL_OBJ = $(GDAL_ROOT)/frmts/o/*.o \
$(GDAL_ROOT)/gcore/*.o \
$(GDAL_ROOT)/port/*.o \
$(GDAL_ROOT)/alg/*.o \
$(GDAL_ROOT)/third_party/o/*.o \
$(GDAL_ROOT)/apps/commonutils.o \
$(GDAL_ROOT)/apps/gdalinfo_lib.o \
$(GDAL_ROOT)/apps/gdal_translate_lib.o \
......@@ -67,7 +68,7 @@ ifeq ($(MACOSX_FRAMEWORK),yes)
install_name_tool -id ${OSX_VERSION_FRAMEWORK_PREFIX}/GDAL .libs/libgdal.dylib
endif
lib-dependencies: port-target core-target frmts-target ogr-target gnm-target appslib-target
lib-dependencies: port-target core-target frmts-target third-party-target ogr-target gnm-target appslib-target
check-lib: lib-dependencies
$(MAKE) $(LIBGDAL-yes)
......@@ -98,6 +99,9 @@ core-target: generate_gdal_version_h
frmts-target: generate_gdal_version_h
(cd frmts; $(MAKE))
third-party-target: generate_gdal_version_h
(cd third_party; $(MAKE))
ogr-all: generate_gdal_version_h
(cd ogr; $(MAKE) all)
......@@ -120,6 +124,7 @@ clean: lclean
(cd gnm; $(MAKE) clean)
(cd gcore; $(MAKE) clean)
(cd frmts; $(MAKE) clean)
(cd third_party; $(MAKE) clean)
(cd alg; $(MAKE) clean)
(cd apps; $(MAKE) clean)
ifneq ($(BINDINGS),)
......@@ -170,7 +175,7 @@ docs:
cp data/gdalicon.png html
cp doc/images/*.* html
cp doc/grid/*.png html
cp frmts/*.html frmts/*/frmt_*.html html
cp frmts/*.html frmts/*/frmt_*.html frmts/*/drv_*.html html
cp frmts/openjpeg/*.xml html
cp frmts/wms/frmt_*.xml html
cp ogr/ogrsf_frmts/*/frmt_*.html html
......
......@@ -140,7 +140,9 @@ http://trac.osgeo.org/gdal/wiki/NewsAndStatus .
the GDAL package by one of the current owners : HowardB/FrankW/EvenR)
( procedure taken from http://peterdowns.com/posts/first-time-with-pypi.html )
a) Create a $HOME/.pypirc file :
a) Install twine https://pypi.org/project/twine/
b) Create a $HOME/.pypirc file :
[distutils] # this tells distutils what package indexes you can push to
index-servers = pypi
......@@ -156,13 +158,15 @@ repository: https://test.pypi.org/legacy/
username: yourlogin
password: yourpassword
b) cd swig/python
c) cd swig/python
d) python setup.py sdist
c) For trial :
python setup.py sdist upload -r pypitest
e) For trial :
twine upload dist/GDAL*.gz -r pypitest
d) For real :
python setup.py sdist upload -r pypi
f) For real :
twine upload dist/GDAL*.gz
21) Build and bundle the java bindings.
......
MIGRATION GUIDE FROM GDAL 2.3 to GDAL 2.4
-----------------------------------------
1) Out-of-tree drivers: RawRasterBand() constructor changes
RawRasterBand now only accepts a VSILFILE* file. Consequently the void* fpRaw
argument has become a VSILFILE* one. And the bIsVSIL = FALSE argument has
been removed. The int bOwnsFP = FALSE has seen its default value suppressed,
and has seen its type changed to the RawRasterBand::OwnFP::YES/NO enumeration,
to detect places where your code must be changed.
Caution: code like RawRasterBand(..., bNativeOrder, TRUE) must be changed to
RawRasterBand(..., bNativeOrder, RawRasterBand::OwnFP::NO, the TRUE value
being the bIsVSIL value, and the default argument being bOwnsFP == FALSE.
MIGRATION GUIDE FROM GDAL 2.2 to GDAL 2.3
-----------------------------------------
......
This diff is collapsed.
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'socket'
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# specify memory size in MiB
vm_ram = ENV['VAGRANT_VM_RAM'] || 2048
vm_cpu = ENV['VAGRANT_VM_CPU'] || 2
vm_ram_bytes = vm_ram * 1024 * 1024
config.vm.hostname = "gdal-vagrant"
config.vm.host_name = "gdal-vagrant"
# proxy configurations.
# these options are also specified by environment variables;
# VAGRANT_HTTP_PROXY, VAGRANT_HTTPS_PROXY, VAGRANT_FTP_PROXY
# VAGRANT_NO_PROXY, VAGRANT_SVN_PROXY, VAGRANT_GIT_PROXY
# if you want to set these on Vagrantfile, edit followings.
if Vagrant.has_plugin?("vagrant-proxyconf")
config.proxy.enabled = false # true|false
#config.proxy.http = "http://192.168.0.2:3128"
#config.proxy.ftp = "http://192.168.0.2:3128"
#config.proxy.https = "DIRECT"
#config.proxy.no_proxy = "localhost,127.0.0.1,.example.com"
#config.svn_proxy.http = ""
#config.git_proxy.http = ""
end
config.vm.synced_folder "../autotest/", "/home/vagrant/autotest/"
config.vm.provider :virtualbox do |vb,ovrd|
ovrd.vm.network :forwarded_port, guest: 80, host: 8080
ovrd.vm.box = "precise64"
ovrd.vm.box_url = "http://files.vagrantup.com/precise64.box"
vb.customize ["modifyvm", :id, "--memory", vm_ram]
vb.customize ["modifyvm", :id, "--cpus", vm_cpu]
vb.customize ["modifyvm", :id, "--ioapic", "on"]
vb.name = "gdal-vagrant"
end
config.vm.provider :lxc do |lxc,ovrd|
ovrd.vm.box = "fgrehm/precise64-lxc"
lxc.backingstore = 'dir'
lxc.customize 'cgroup.memory.limit_in_bytes', vm_ram_bytes
lxc.customize 'aa_allow_incomplete', 1
lxc.container_name = "gdal-vagrant"
end
config.vm.provider :hyperv do |hyperv,ovrd|
ovrd.vm.box = "hashicorp/precise64"
ovrd.ssh.username = "vagrant"
hyperv.cpus = vm_cpu
hyperv.memory = vm_ram
hyperv.vmname = "gdal-vagrant"
end
ppaRepos = [
"ppa:ubuntugis/ubuntugis-unstable", "ppa:marlam/gta"
]
packageList = [
"subversion",
"python-numpy",
"python-dev",
"postgis",
"postgresql-server-dev-9.1",
"postgresql-9.1-postgis",
"postgresql-9.1-postgis-scripts",
"libmysqlclient-dev",
#"mysql-server",
"libpq-dev",
"libpng12-dev",
"libjpeg-dev",
"libgif-dev",
"liblzma-dev",
"libgeos-dev",
"libcurl4-gnutls-dev",
"libproj-dev",
"libxml2-dev",
"libexpat-dev",
"libxerces-c-dev",
"libnetcdf-dev",
"netcdf-bin",
"libpoppler-dev",
"libspatialite-dev",
"gpsbabel",
"libboost-all-dev",
"libgmp-dev",
"libmpfr-dev",
"swig",
"libhdf4-alt-dev",
"libhdf5-serial-dev",
"libpodofo-dev",
"poppler-utils",
"libfreexl-dev",
"unixodbc-dev",
"libwebp-dev",
"openjdk-7-jdk",
"libepsilon-dev",
"libgta-dev",
"liblcms2-2",
"libpcre3-dev",
"libjasper-dev",
"libarmadillo-dev",
"make",
"g++",
"autoconf", # for libkml
"cmake", # for openjpeg
"bison",
"flex",
"doxygen",
"vim",
"ant",
"mono-mcs"
];
if Vagrant.has_plugin?("vagrant-cachier")
config.cache.scope = :box
end
if Dir.glob("#{File.dirname(__FILE__)}/.vagrant/machines/default/*/id").empty?
pkg_cmd = "sed -i 's#deb http://us.archive.ubuntu.com/ubuntu/#deb mirror://mirrors.ubuntu.com/mirrors.txt#' /etc/apt/sources.list; "
pkg_cmd << "apt-get update -qq; apt-get install -q -y python-software-properties; "
if ppaRepos.length > 0
ppaRepos.each { |repo| pkg_cmd << "add-apt-repository -y " << repo << " ; " }
pkg_cmd << "apt-get update -qq; "
end
# install packages we need we need
pkg_cmd << "apt-get install -q -y " + packageList.join(" ") << " ; "
config.vm.provision :shell, :inline => pkg_cmd
scripts = [
"sfcgal.sh",
"swig-1.3.40.sh",
"libkml.sh",
"openjpeg.sh",
"gdal.sh",
"postgis.sh"
];
scripts.each { |script| config.vm.provision :shell, :privileged => false, :path => "scripts/vagrant/" << script }
end
end
# generated automatically by aclocal 1.15 -*- Autoconf -*-
# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
......@@ -12,6 +12,44 @@
# PARTICULAR PURPOSE.
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_require_defined.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_REQUIRE_DEFINED(MACRO)
#
# DESCRIPTION
#
# AX_REQUIRE_DEFINED is a simple helper for making sure other macros have
# been defined and thus are available for use. This avoids random issues
# where a macro isn't expanded. Instead the configure script emits a
# non-fatal:
#
# ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found
#
# It's like AC_REQUIRE except it doesn't expand the required macro.
#
# Here's an example:
#
# AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
#
# LICENSE
#
# Copyright (c) 2014 Mike Frysinger <vapier@gentoo.org>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 2
AC_DEFUN([AX_REQUIRE_DEFINED], [dnl
m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])])
])dnl AX_REQUIRE_DEFINED
m4_include([m4/acinclude.m4])
m4_include([m4/ax_cflags_warn_all.m4])
m4_include([m4/ax_check_compile_flag.m4])
......
......@@ -31,9 +31,9 @@ ifeq ($(QHULL_SETTING),internal)
CPPFLAGS := -DINTERNAL_QHULL $(CPPFLAGS)
endif
CPPFLAGS := -I../frmts/vrt $(CPPFLAGS) $(OPENCL_FLAGS) $(PROJ_FLAGS) $(PROJ_INCLUDE)
CPPFLAGS := -I../frmts/vrt $(CPPFLAGS) $(OPENCL_FLAGS) $(PROJ_FLAGS) $(PROJ_INCLUDE) -Imarching_squares
CXXFLAGS := $(WARN_OLD_STYLE_CAST) $(CXXFLAGS)
CXXFLAGS := $(WARN_EFFCPLUSPLUS) $(WARN_OLD_STYLE_CAST) $(CXXFLAGS)
default: $(OBJ:.o=.$(OBJ_EXT)) gdalgridavx.$(OBJ_EXT) gdalgridsse.$(OBJ_EXT)
......
This diff is collapsed.
......@@ -49,7 +49,7 @@
#include <ctype.h>
#include <math.h>
CPL_CVSID("$Id: delaunay.c 818830b37601c33fb53567f86949c8edc1157592 2018-10-06 19:02:19 +0200 Even Rouault $")
CPL_CVSID("$Id: delaunay.c d38086d97f76b283f7c6ba57abd60da9e279cbde 2018-10-06 19:02:19 +0200 Even Rouault $")
#if defined(INTERNAL_QHULL) || defined(EXTERNAL_QHULL)
#define HAVE_INTERNAL_OR_EXTERNAL_QHULL 1
......@@ -524,6 +524,9 @@ int GDALTriangulationFindFacetDirected(const GDALTriangulation* psDT,
double dfY,
int* panOutputFacetIdx)
{
#ifdef DEBUG_VERBOSE
const int nFacetIdxInitial = nFacetIdx;
#endif
int k, nIterMax;
*panOutputFacetIdx = -1;
if( psDT->pasFacetCoefficients == NULL )
......@@ -554,6 +557,10 @@ int GDALTriangulationFindFacetDirected(const GDALTriangulation* psDT,
int neighbor = psFacet->anNeighborIdx[0];
if( neighbor < 0 )
{
#ifdef DEBUG_VERBOSE
CPLDebug("GDAL", "Outside %d in %d iters (initial = %d)",
nFacetIdx, k, nFacetIdxInitial);
#endif
*panOutputFacetIdx = nFacetIdx;
return FALSE;
}
......@@ -569,6 +576,10 @@ int GDALTriangulationFindFacetDirected(const GDALTriangulation* psDT,
int neighbor = psFacet->anNeighborIdx[1];
if( neighbor < 0 )
{
#ifdef DEBUG_VERBOSE
CPLDebug("GDAL", "Outside %d in %d iters (initial = %d)",
nFacetIdx, k, nFacetIdxInitial);
#endif
*panOutputFacetIdx = nFacetIdx;
return FALSE;
}
......@@ -584,6 +595,10 @@ int GDALTriangulationFindFacetDirected(const GDALTriangulation* psDT,
int neighbor = psFacet->anNeighborIdx[2];
if( neighbor < 0 )
{
#ifdef DEBUG_VERBOSE
CPLDebug("GDAL", "Outside %d in %d iters (initial = %d)",
nFacetIdx, k, nFacetIdxInitial);
#endif
*panOutputFacetIdx = nFacetIdx;
return FALSE;
}
......@@ -595,6 +610,10 @@ int GDALTriangulationFindFacetDirected(const GDALTriangulation* psDT,
if( bMatch )
{
#ifdef DEBUG_VERBOSE
CPLDebug("GDAL", "Inside %d in %d iters (initial = %d)",
nFacetIdx, k, nFacetIdxInitial);
#endif
*panOutputFacetIdx = nFacetIdx;
return TRUE;
}
......
/******************************************************************************
* $Id: gdal_alg.h ecc4064ad058e92440d85c2a83501cc45579c06c 2017-07-24 19:24:22Z Even Rouault $
* $Id: gdal_alg.h b9ddc19f9ccd776cac9388f260aebc24439f10aa 2018-10-09 11:45:33 +0200 Julien Cabieces $
*
* Project: GDAL Image Processing Algorithms
* Purpose: Prototypes, and definitions for various GDAL based algorithms.
......@@ -306,6 +306,8 @@ typedef struct
double adfGeoTransform[6];
int nElevField;
int nElevFieldMin;
int nElevFieldMax;
int nIDField;
int nNextID;
} OGRContourWriterInfo;
......@@ -322,6 +324,11 @@ GDALContourGenerate( GDALRasterBandH hBand,
void *hLayer, int iIDField, int iElevField,
GDALProgressFunc pfnProgress, void *pProgressArg );
CPLErr CPL_DLL
GDALContourGenerateEx( GDALRasterBandH hBand, void *hLayer,
CSLConstList options,
GDALProgressFunc pfnProgress, void *pProgressArg );
/************************************************************************/
/* Rasterizer API - geometries burned into GDAL raster. */
/************************************************************************/
......
/******************************************************************************
* $Id: gdal_alg_priv.h e13dcd4dc171dfeed63f912ba06b9374ce4f3bb2 2018-03-18 21:37:41Z Even Rouault $
* $Id: gdal_alg_priv.h fe2d81c8819bf9794bce0210098e637565728350 2018-05-06 00:49:51 +0200 Even Rouault $
*
* Project: GDAL Image Processing Algorithms
* Purpose: Prototypes and definitions for various GDAL based algorithms:
......@@ -112,15 +112,17 @@ private:
void MergePolygon( int nSrcId, int nDstId );
int NewPolygon( DataType nValue );
CPL_DISALLOW_COPY_ASSIGN(GDALRasterPolygonEnumeratorT)
public: // these are intended to be readonly.
GInt32 *panPolyIdMap;
DataType *panPolyValue;
GInt32 *panPolyIdMap = nullptr;
DataType *panPolyValue = nullptr;
int nNextPolygonId;
int nPolyAlloc;
int nNextPolygonId = 0;
int nPolyAlloc = 0;
int nConnectedness;
int nConnectedness = 0;
public:
explicit GDALRasterPolygonEnumeratorT( int nConnectedness=4 );
......
......@@ -61,7 +61,7 @@
#include <stdlib.h>
#include <string.h>
CPL_CVSID("$Id: gdal_crs.c ff8146d84de7cba8e09d212d5481ea7d2ede3e98 2017-06-27 20:47:31Z Even Rouault $")
CPL_CVSID("$Id: gdal_crs.c ee3197beea00209aedcf77e928b1e0c828251bd7 2018-10-01 23:39:49 +0200 Even Rouault $")
/* Hum, we cannot include gdal_priv.h from a .c file... */
CPL_C_START
......@@ -98,7 +98,10 @@ typedef struct
double adfFromGeoX[20];
double adfFromGeoY[20];
double x1_mean;
double y1_mean;
double x2_mean;
double y2_mean;
int nOrder;
int bReversed;
......@@ -120,10 +123,18 @@ CPL_C_END
/* crs.c */
static int CRS_georef(double, double, double *, double *,
double [], double [], int);
static int CRS_compute_georef_equations(struct Control_Points *,
static int CRS_compute_georef_equations(GCPTransformInfo *psInfo, struct Control_Points *,
double [], double [], double [], double [], int);
static int remove_outliers(GCPTransformInfo *);
#define MSUCCESS 1 /* SUCCESS */
#define MNPTERR 0 /* NOT ENOUGH POINTS */
#define MUNSOLVABLE -1 /* NOT SOLVABLE */
#define MMEMERR -2 /* NOT ENOUGH MEMORY */
#define MPARMERR -3 /* PARAMETER ERROR */
#define MINTERR -4 /* INTERNAL ERROR */
static const char * const CRS_error_message[] = {
"Failed to compute GCP transform: Not enough points available",
"Failed to compute GCP transform: Transform is not solvable",
......@@ -188,6 +199,11 @@ void *GDALCreateGCPTransformerEx( int nGCPCount, const GDAL_GCP *pasGCPList,
int nCRSresult = 0;
struct Control_Points sPoints;
double x1_sum = 0;
double y1_sum = 0;
double x2_sum = 0;
double y2_sum = 0;
memset( &sPoints, 0, sizeof(sPoints) );
if( nReqOrder == 0 )
......@@ -223,7 +239,11 @@ void *GDALCreateGCPTransformerEx( int nGCPCount, const GDAL_GCP *pasGCPList,
/* Compute the forward and reverse polynomials. */
/* -------------------------------------------------------------------- */
if(bRefine)
if( nGCPCount == 0 )
{
nCRSresult = MNPTERR;
}
else if(bRefine)
{
nCRSresult = remove_outliers(psInfo);
}
......@@ -237,7 +257,6 @@ void *GDALCreateGCPTransformerEx( int nGCPCount, const GDAL_GCP *pasGCPList,
padfRasterX = (double *) CPLCalloc(sizeof(double),nGCPCount);
padfRasterY = (double *) CPLCalloc(sizeof(double),nGCPCount);
panStatus = (int *) CPLCalloc(sizeof(int),nGCPCount);
for( iGCP = 0; iGCP < nGCPCount; iGCP++ )
{
panStatus[iGCP] = 1;
......@@ -245,7 +264,15 @@ void *GDALCreateGCPTransformerEx( int nGCPCount, const GDAL_GCP *pasGCPList,
padfGeoY[iGCP] = pasGCPList[iGCP].dfGCPY;
padfRasterX[iGCP] = pasGCPList[iGCP].dfGCPPixel;
padfRasterY[iGCP] = pasGCPList[iGCP].dfGCPLine;
x1_sum += pasGCPList[iGCP].dfGCPPixel;
y1_sum += pasGCPList[iGCP].dfGCPLine;
x2_sum += pasGCPList[iGCP].dfGCPX;
y2_sum += pasGCPList[iGCP].dfGCPY;
}
psInfo->x1_mean = x1_sum / nGCPCount;
psInfo->y1_mean = y1_sum / nGCPCount;
psInfo->x2_mean = x2_sum / nGCPCount;
psInfo->y2_mean = y2_sum / nGCPCount;
sPoints.count = nGCPCount;
sPoints.e1 = padfRasterX;
......@@ -253,7 +280,7 @@ void *GDALCreateGCPTransformerEx( int nGCPCount, const GDAL_GCP *pasGCPList,
sPoints.e2 = padfGeoX;
sPoints.n2 = padfGeoY;
sPoints.status = panStatus;
nCRSresult = CRS_compute_georef_equations( &sPoints,
nCRSresult = CRS_compute_georef_equations( psInfo, &sPoints,
psInfo->adfToGeoX, psInfo->adfToGeoY,
psInfo->adfFromGeoX, psInfo->adfFromGeoY,
nReqOrder );
......@@ -293,12 +320,14 @@ void *GDALCreateGCPTransformerEx( int nGCPCount, const GDAL_GCP *pasGCPList,
* are otherwise "ill conditioned".
*
* Note that 2nd order requires at least 6 GCPs, and 3rd order requires at
* least 10 gcps. If nReqOrder is 0 the highest order possible with the
* provided gcp count will be used.
* least 10 gcps. If nReqOrder is 0 the highest order possible (limited to 2)
* with the provided gcp count will be used.
*
* @param nGCPCount the number of GCPs in pasGCPList.
* @param pasGCPList an array of GCPs to be used as input.
* @param nReqOrder the requested polynomial order. It should be 1, 2 or 3.
* Using 3 is not recommended due to potential numeric instabilities issues.
* @param bReversed set it to TRUE to compute the reversed transformation.
*
* @return the transform argument or NULL if creation fails.
*/
......@@ -405,13 +434,13 @@ int GDALGCPTransform( void *pTransformArg, int bDstToSrc,
if( bDstToSrc )
{
CRS_georef( x[i], y[i], x + i, y + i,
CRS_georef( x[i] - psInfo->x2_mean, y[i] - psInfo->y2_mean, x + i, y + i,
psInfo->adfFromGeoX, psInfo->adfFromGeoY,
psInfo->nOrder );
}
else
{
CRS_georef( x[i], y[i], x + i, y + i,
CRS_georef( x[i] - psInfo->x1_mean, y[i] - psInfo->y1_mean, x + i, y + i,
psInfo->adfToGeoX, psInfo->adfToGeoY,
psInfo->nOrder );
}
......@@ -561,24 +590,16 @@ struct MATRIX
#define M(row,col) m->v[(((row)-1)*(m->n))+(col)-1]
#define MSUCCESS 1 /* SUCCESS */
#define MNPTERR 0 /* NOT ENOUGH POINTS */
#define MUNSOLVABLE -1 /* NOT SOLVABLE */
#define MMEMERR -2 /* NOT ENOUGH MEMORY */
#define MPARMERR -3 /* PARAMETER ERROR */
#define MINTERR -4 /* INTERNAL ERROR */
/***************************************************************************/
/*
FUNCTION PROTOTYPES FOR STATIC (INTERNAL) FUNCTIONS
*/
/***************************************************************************/
static int calccoef(struct Control_Points *,double *,double *,int);
static int calcls(struct Control_Points *,struct MATRIX *,
static int calccoef(struct Control_Points *,double,double,double *,double *,int);
static int calcls(struct Control_Points *,struct MATRIX *,double,double,
double *,double *,double *,double *);
static int exactdet(struct Control_Points *,struct MATRIX *,
static int exactdet(struct Control_Points *,struct MATRIX *,double,double,
double *,double *,double *,double *);
static int solvemat(struct MATRIX *,double *,double *,double *,double *);
static double term(int,double,double);
......@@ -664,7 +685,7 @@ CRS_georef (
/***************************************************************************/
static int
CRS_compute_georef_equations (struct Control_Points *cp,
CRS_compute_georef_equations (GCPTransformInfo *psInfo, struct Control_Points *cp,
double E12[], double N12[],
double E21[], double N21[],
int order)
......@@ -677,7 +698,7 @@ CRS_compute_georef_equations (struct Control_Points *cp,
/* CALCULATE THE FORWARD TRANSFORMATION COEFFICIENTS */
status = calccoef(cp,E12,N12,order);
status = calccoef(cp,psInfo->x1_mean,psInfo->y1_mean,E12,N12,order);
if(status != MSUCCESS)
return(status);
......@@ -692,7 +713,7 @@ CRS_compute_georef_equations (struct Control_Points *cp,
/* CALCULATE THE BACKWARD TRANSFORMATION COEFFICIENTS */
status = calccoef(cp,E21,N21,order);
status = calccoef(cp,psInfo->x2_mean,psInfo->y2_mean,E21,N21,order);
/* SWITCH THE 1 AND 2 EASTING AND NORTHING ARRAYS BACK */
......@@ -713,7 +734,7 @@ CRS_compute_georef_equations (struct Control_Points *cp,
/***************************************************************************/
static int
calccoef (struct Control_Points *cp, double E[], double N[], int order)
calccoef (struct Control_Points *cp, double x_mean, double y_mean, double E[], double N[], int order)
{
struct MATRIX m;
double *a = NULL;
......@@ -762,9 +783,9 @@ calccoef (struct Control_Points *cp, double E[], double N[], int order)
}
if(numactive == m.n)
status = exactdet(cp,&m,a,b,E,N);
status = exactdet(cp,&m, x_mean, y_mean, a,b,E,N);
else
status = calcls(cp,&m,a,b,E,N);
status = calcls(cp,&m, x_mean, y_mean,a,b,E,N);
CPLFree((char *)m.v);
CPLFree((char *)a);
......@@ -783,6 +804,8 @@ calccoef (struct Control_Points *cp, double E[], double N[], int order)
static int exactdet (
struct Control_Points *cp,
struct MATRIX *m,
double x_mean,
double y_mean,
double a[],
double b[],
double E[], /* EASTING COEFFICIENTS */
......@@ -801,7 +824,7 @@ static int exactdet (
for(j = 1 ; j <= m->n ; j++)
{
M(currow,j) = term(j,cp->e1[pntnow],cp->n1[pntnow]);
M(currow,j) = term(j,cp->e1[pntnow] - x_mean, cp->n1[pntnow] - y_mean);
}
/* POPULATE MATRIX A AND B */
......@@ -830,6 +853,8 @@ static int exactdet (
static int calcls (
struct Control_Points *cp,
struct MATRIX *m,
double x_mean,
double y_mean,
double a[],
double b[],
double E[], /* EASTING COEFFICIENTS */
......@@ -858,10 +883,10 @@ static int calcls (
for(i = 1 ; i <= m->n ; i++)
{
for(j = i ; j <= m->n ; j++)
M(i,j) += term(i,cp->e1[n],cp->n1[n]) * term(j,cp->e1[n],cp->n1[n]);
M(i,j) += term(i,cp->e1[n] - x_mean, cp->n1[n] - y_mean) * term(j,cp->e1[n] - x_mean, cp->n1[n] - y_mean);
a[i-1] += cp->e2[n] * term(i,cp->e1[n],cp->n1[n]);
b[i-1] += cp->n2[n] * term(i,cp->e1[n],cp->n1[n]);
a[i-1] += cp->e2[n] * term(i,cp->e1[n] - x_mean, cp->n1[n] - y_mean);
b[i-1] += cp->n2[n] * term(i,cp->e1[n] - x_mean, cp->n1[n] - y_mean);
}
}
}
......@@ -1040,33 +1065,22 @@ static int solvemat (struct MATRIX *m,
IF NO OUTLIER CAN BE FOUND, -1 WILL BE RETURNED.
*/
/***************************************************************************/
static int worst_outlier(struct Control_Points *cp, double E[], double N[], double dfTolerance)
static int worst_outlier(struct Control_Points *cp, double x_mean, double y_mean, int nOrder, double E[], double N[], double dfTolerance)
{
int nI = 0, nIndex = 0;
double dfDifference = 0.0;
double dfSampleRes = 0.0;
double dfLineRes = 0.0;
double dfCurrentDifference = 0.0;
double dfE1 = 0.0;
double dfN1 = 0.0;
double dfE2 = 0.0;
double dfN2 = 0.0;
double dfEn = 0.0;
double dfSampleResidual = 0.0;
double dfLineResidual = 0.0;
double *padfResiduals = (double *) CPLCalloc(sizeof(double),cp->count);
for(nI = 0; nI < cp->count; nI++)
{
dfE1 = cp->e1[nI];
dfN1 = cp->n1[nI];
dfE2 = dfE1 * dfE1;
dfN2 = dfN1 * dfN1;
dfEn = dfE1 * dfN1;
dfSampleRes = E[0] + E[1] * dfE1 + E[2] * dfN1 + E[3] * dfE2 + E[4] * dfEn + E[5] * dfN2 - cp->e2[nI];
dfLineRes = N[0] + N[1] * dfE1 + N[2] * dfN1 + N[3] * dfE2 + N[4] * dfEn + N[5] * dfN2 - cp->n2[nI];
CRS_georef( cp->e1[nI] - x_mean, cp->n1[nI] - y_mean, &dfSampleRes, &dfLineRes,E,N,nOrder );
dfSampleRes -= cp->e2[nI];
dfLineRes -= cp->n2[nI];
dfSampleResidual += dfSampleRes*dfSampleRes;
dfLineResidual += dfLineRes*dfLineRes;
......@@ -1121,6 +1135,10 @@ static int remove_outliers( GCPTransformInfo *psInfo )
double dfTolerance = 0;
struct Control_Points sPoints;
double x1_sum = 0;
double y1_sum = 0;
double x2_sum = 0;
double y2_sum = 0;
memset( &sPoints, 0, sizeof(sPoints) );
nGCPCount = psInfo->nGCPCount;
......@@ -1141,7 +1159,15 @@ static int remove_outliers( GCPTransformInfo *psInfo )
padfGeoY[nI] = psInfo->pasGCPList[nI].dfGCPY;
padfRasterX[nI] = psInfo->pasGCPList[nI].dfGCPPixel;
padfRasterY[nI] = psInfo->pasGCPList[nI].dfGCPLine;
x1_sum += psInfo->pasGCPList[nI].dfGCPPixel;
y1_sum += psInfo->pasGCPList[nI].dfGCPLine;
x2_sum += psInfo->pasGCPList[nI].dfGCPX;
y2_sum += psInfo->pasGCPList[nI].dfGCPY;
}
psInfo->x1_mean = x1_sum / nGCPCount;
psInfo->y1_mean = y1_sum / nGCPCount;
psInfo->x2_mean = x2_sum / nGCPCount;
psInfo->y2_mean = y2_sum / nGCPCount;
sPoints.count = nGCPCount;
sPoints.e1 = padfRasterX;
......@@ -1150,7 +1176,7 @@ static int remove_outliers( GCPTransformInfo *psInfo )
sPoints.n2 = padfGeoY;
sPoints.status = panStatus;
nCRSresult = CRS_compute_georef_equations( &sPoints,
nCRSresult = CRS_compute_georef_equations( psInfo, &sPoints,
psInfo->adfToGeoX, psInfo->adfToGeoY,
psInfo->adfFromGeoX, psInfo->adfFromGeoY,
nReqOrder );
......@@ -1158,7 +1184,8 @@ static int remove_outliers( GCPTransformInfo *psInfo )
while(sPoints.count > nMinimumGcps)
{
int nIndex =
worst_outlier(&sPoints, psInfo->adfFromGeoX, psInfo->adfFromGeoY,
worst_outlier(&sPoints, psInfo->x1_mean, psInfo->y1_mean, psInfo->nOrder,
psInfo->adfToGeoX, psInfo->adfToGeoY,
dfTolerance);
//If no outliers were detected, stop the GCP elimination
......@@ -1182,7 +1209,7 @@ static int remove_outliers( GCPTransformInfo *psInfo )
sPoints.count = sPoints.count - 1;
nCRSresult = CRS_compute_georef_equations( &sPoints,
nCRSresult = CRS_compute_georef_equations( psInfo, &sPoints,
psInfo->adfToGeoX, psInfo->adfToGeoY,
psInfo->adfFromGeoX, psInfo->adfFromGeoY,
nReqOrder );
......
/******************************************************************************
* $Id: gdal_nrgcrs.c 678d89afcc4ec43e300b2f337b51349139543d01 2016-06-30 22:42:39Z Kurt Schwehr $
*
* Project: Mapinfo Image Warper
* Purpose: Implementation of the GDALTransformer wrapper around CRS.C functions
* to build a polynomial transformation based on ground control
* points.
* Author: Frank Warmerdam, warmerdam@pobox.com
*
***************************************************************************
* Copyright (c) 2005, Frank Warmerdam <warmerdam@pobox.com>
*
* 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.
****************************************************************************/
#include "gdal_alg.h"
#include "cpl_conv.h"
#include "cpl_minixml.h"
extern int TwoDPolyFit( double *, double *, int, int, double *, double *, double * );
extern double TwoDPolyEval( double *, int, double, double );
typedef struct
{
double adfToGeoX[20];
double adfToGeoY[20];
double adfFromGeoX[20];
double adfFromGeoY[20];
int nOrder;
int bReversed;
} GCPTransformInfo;
/************************************************************************/
/* GDALCreateGCPTransformer() */
/************************************************************************/
/**
* Create GCP based polynomial transformer.
*
* Computes least squares fit polynomials from a provided set of GCPs,
* and stores the coefficients for later transformation of points between
* pixel/line and georeferenced coordinates.
*
* The return value should be used as a TransformArg in combination with
* the transformation function GDALGCPTransform which fits the
* GDALTransformerFunc signature. The returned transform argument should
* be deallocated with GDALDestroyGCPTransformer when no longer needed.
*
* This function may fail (returning NULL) if the provided set of GCPs
* are inadequate for the requested order, the determinate is zero or they
* are otherwise "ill conditioned".
*
* Note that 2nd order requires at least 6 GCPs, and 3rd order requires at
* least 10 gcps. If nReqOrder is 0 the highest order possible with the
* provided gcp count will be used.
*
* @param nGCPCount the number of GCPs in pasGCPList.
* @param pasGCPList an array of GCPs to be used as input.
* @param nReqOrder the requested polynomial order. It should be 1, 2 or 3.
* @param bReversed set it to TRUE to compute the reversed transformation.
*
* @return the transform argument or NULL if creation fails.
*/
void *GDALCreateGCPTransformer( int nGCPCount, const GDAL_GCP *pasGCPList,
int nReqOrder, int bReversed )
{
GCPTransformInfo *psInfo;
double *padfGeoX, *padfGeoY, *padfRasterX, *padfRasterY;
int *panStatus, iGCP;
double rms_err;
if( nReqOrder == 0 )
{
if( nGCPCount >= 10 )
nReqOrder = 3;
else if( nGCPCount >= 6 )
nReqOrder = 2;
else
nReqOrder = 1;
}
psInfo = (GCPTransformInfo *) CPLCalloc(sizeof(GCPTransformInfo),1);
psInfo->bReversed = bReversed;
psInfo->nOrder = nReqOrder;
/* -------------------------------------------------------------------- */
/* Allocate and initialize the working points list. */
/* -------------------------------------------------------------------- */
padfGeoX = (double *) CPLCalloc(sizeof(double),nGCPCount);
padfGeoY = (double *) CPLCalloc(sizeof(double),nGCPCount);
padfRasterX = (double *) CPLCalloc(sizeof(double),nGCPCount);
padfRasterY = (double *) CPLCalloc(sizeof(double),nGCPCount);
panStatus = (int *) CPLCalloc(sizeof(int),nGCPCount);
for( iGCP = 0; iGCP < nGCPCount; iGCP++ )
{
panStatus[iGCP] = 1;
padfGeoX[iGCP] = pasGCPList[iGCP].dfGCPX;
padfGeoY[iGCP] = pasGCPList[iGCP].dfGCPY;
padfRasterX[iGCP] = pasGCPList[iGCP].dfGCPPixel;
padfRasterY[iGCP] = pasGCPList[iGCP].dfGCPLine;
}
/* -------------------------------------------------------------------- */
/* Compute the forward and reverse polynomials. */
/* -------------------------------------------------------------------- */
if ( TwoDPolyFit( &rms_err, psInfo->adfFromGeoX, nReqOrder, nGCPCount,
padfRasterX, padfGeoX, padfGeoY ) < 0 )
{
CPLError( CE_Failure, CPLE_AppDefined,
"Failed to compute polynomial equations of desired order\n"
"for provided control points." );
goto CleanupAfterError;
}
if ( TwoDPolyFit( &rms_err, psInfo->adfFromGeoY, nReqOrder, nGCPCount,
padfRasterY, padfGeoX, padfGeoY ) < 0 )
{
CPLError( CE_Failure, CPLE_AppDefined,
"Failed to compute polynomial equations of desired order\n"
"for provided control points." );
goto CleanupAfterError;
}
if ( TwoDPolyFit( &rms_err, psInfo->adfToGeoX, nReqOrder, nGCPCount,
padfGeoX, padfRasterX, padfRasterY ) < 0 )
{
CPLError( CE_Failure, CPLE_AppDefined,
"Failed to compute polynomial equations of desired order\n"
"for provided control points." );
goto CleanupAfterError;
}
if ( TwoDPolyFit( &rms_err, psInfo->adfToGeoY, nReqOrder, nGCPCount,
padfGeoY, padfRasterX, padfRasterY ) < 0 )
{
CPLError( CE_Failure, CPLE_AppDefined,
"Failed to compute polynomial equations of desired order\n"
"for provided control points." );
goto CleanupAfterError;
}
/* -------------------------------------------------------------------- */
/* Dump residuals. */
/* -------------------------------------------------------------------- */
CPLDebug( "GDALCreateGCPTransformer",
"Number of GCPs %d, transformation order %d",
nGCPCount, psInfo->nOrder );
for( iGCP = 0; iGCP < nGCPCount; iGCP++ )
{
double x = pasGCPList[iGCP].dfGCPX;
double y = pasGCPList[iGCP].dfGCPY;
double z = pasGCPList[iGCP].dfGCPZ;
int bSuccess;
GDALGCPTransform( psInfo, TRUE, 1, &x, &y, &z, &bSuccess );
CPLDebug( "GDALCreateGCPTransformer",
"GCP %d. Residuals: X: %f, Y: %f", iGCP,
pasGCPList[iGCP].dfGCPPixel - x, pasGCPList[iGCP].dfGCPLine - y );
}
return psInfo;
CleanupAfterError:
CPLFree( padfGeoX );
CPLFree( padfGeoY );
CPLFree( padfRasterX );
CPLFree( padfRasterX );
CPLFree( panStatus );
CPLFree( psInfo );
return NULL;
}
/************************************************************************/
/* GDALDestroyGCPTransformer() */
/************************************************************************/
/**
* Destroy GCP transformer.
*
* This function is used to destroy information about a GCP based
* polynomial transformation created with GDALCreateGCPTransformer().
*
* @param pTransformArg the transform arg previously returned by
* GDALCreateGCPTransformer().
*/
void GDALDestroyGCPTransformer( void *pTransformArg )
{
CPLFree( pTransformArg );
}
/************************************************************************/
/* GDALGCPTransform() */
/************************************************************************/
/**
* Transforms point based on GCP derived polynomial model.
*
* This function matches the GDALTransformerFunc signature, and can be
* used to transform one or more points from pixel/line coordinates to
* georeferenced coordinates (SrcToDst) or vice versa (DstToSrc).
*
* @param pTransformArg return value from GDALCreateGCPTransformer().
* @param bDstToSrc TRUE if transformation is from the destination
* (georeferenced) coordinates to pixel/line or FALSE when transforming
* from pixel/line to georeferenced coordinates.
* @param nPointCount the number of values in the x, y and z arrays.
* @param x array containing the X values to be transformed.
* @param y array containing the Y values to be transformed.
* @param z array containing the Z values to be transformed.
* @param panSuccess array in which a flag indicating success (TRUE) or
* failure (FALSE) of the transformation are placed.
*
* @return TRUE.
*/
int GDALGCPTransform( void *pTransformArg, int bDstToSrc,
int nPointCount,
double *x, double *y, double *z,
int *panSuccess )
{
int i;
double X, Y;
GCPTransformInfo *psInfo = (GCPTransformInfo *) pTransformArg;
if( psInfo->bReversed )
bDstToSrc = !bDstToSrc;
for( i = 0; i < nPointCount; i++ )
{
X = x[i];
Y = y[i];
if( bDstToSrc )
{
x[i] = TwoDPolyEval( psInfo->adfFromGeoX, psInfo->nOrder, X, Y );
y[i] = TwoDPolyEval( psInfo->adfFromGeoY, psInfo->nOrder, X, Y );
}
else
{
x[i] = TwoDPolyEval( psInfo->adfToGeoX, psInfo->nOrder, X, Y );
y[i] = TwoDPolyEval( psInfo->adfToGeoY, psInfo->nOrder, X, Y );
}
z[i] = 0;
panSuccess[i] = TRUE;
}
return TRUE;
}
CPLXMLNode *GDALSerializeGCPTransformer( void *pTransformArg )
{
CPLError( CE_Failure, CPLE_AppDefined,
"serialization not supported for this type of gcp transformer.");
return NULL;
}
void *GDALDeserializeGCPTransformer( CPLXMLNode *psTree )
{
CPLError( CE_Failure, CPLE_AppDefined,
"deserialization not supported for this type of gcp transformer.");
return NULL;
}
......@@ -27,7 +27,7 @@
#include "gdal_simplesurf.h"
CPL_CVSID("$Id: gdal_octave.cpp 7e07230bbff24eb333608de4dbd460b7312839d0 2017-12-11 19:08:47Z Even Rouault $")
CPL_CVSID("$Id: gdal_octave.cpp fe2d81c8819bf9794bce0210098e637565728350 2018-05-06 00:49:51 +0200 Even Rouault $")
/************************************************************************/
/* ==================================================================== */
......@@ -35,12 +35,7 @@ CPL_CVSID("$Id: gdal_octave.cpp 7e07230bbff24eb333608de4dbd460b7312839d0 2017-12
/* ==================================================================== */
/************************************************************************/
GDALIntegralImage::GDALIntegralImage()
{
pMatrix = nullptr;
nHeight = 0;
nWidth = 0;
}
GDALIntegralImage::GDALIntegralImage() = default;
int GDALIntegralImage::GetHeight() { return nHeight; }
......
/******************************************************************************
* $Id: gdal_simplesurf.h 1b31a5ae8474bacb2fb8cce9c7121b390e192c4c 2016-12-04 04:32:31Z Kurt Schwehr $
* $Id: gdal_simplesurf.h fe2d81c8819bf9794bce0210098e637565728350 2018-05-06 00:49:51 +0200 Even Rouault $
* Project: GDAL
* Purpose: Correlator
* Author: Andrew Migal, migal.drew@gmail.com
......@@ -187,6 +187,8 @@ private:
*/
class GDALIntegralImage
{
CPL_DISALLOW_COPY_ASSIGN(GDALIntegralImage)
public:
GDALIntegralImage();
virtual ~GDALIntegralImage();
......@@ -260,9 +262,9 @@ public:
int GetWidth();
private:
double **pMatrix;
int nWidth;
int nHeight;
double **pMatrix = nullptr;
int nWidth = 0;
int nHeight = 0;
};
/**
......@@ -275,6 +277,8 @@ private:
*/
class GDALOctaveLayer
{
CPL_DISALLOW_COPY_ASSIGN(GDALOctaveLayer)
public:
GDALOctaveLayer();
......@@ -424,12 +428,8 @@ private:
class MatchedPointPairInfo
{
public:
MatchedPointPairInfo(int nInd_1, int nInd_2, double dfDist)
{
ind_1 = nInd_1;
ind_2 = nInd_2;
euclideanDist = dfDist;
}
MatchedPointPairInfo(int nInd_1, int nInd_2, double dfDist):
ind_1(nInd_1), ind_2(nInd_2), euclideanDist(dfDist) {}
int ind_1;
int ind_2;
......
......@@ -45,7 +45,7 @@
#include <limits>
CPL_CVSID("$Id: gdalapplyverticalshiftgrid.cpp 22f8ae3bf7bc3cccd970992655c63fc5254d3206 2018-04-08 20:13:05 +0200 Even Rouault $")
CPL_CVSID("$Id: gdalapplyverticalshiftgrid.cpp fe2d81c8819bf9794bce0210098e637565728350 2018-05-06 00:49:51 +0200 Even Rouault $")
/************************************************************************/
/* GDALApplyVSGDataset */
......@@ -55,11 +55,13 @@ class GDALApplyVSGDataset final: public GDALDataset
{
friend class GDALApplyVSGRasterBand;
GDALDataset* m_poSrcDataset;
GDALDataset* m_poReprojectedGrid;
bool m_bInverse;
double m_dfSrcUnitToMeter;
double m_dfDstUnitToMeter;
GDALDataset* m_poSrcDataset = nullptr;
GDALDataset* m_poReprojectedGrid = nullptr;
bool m_bInverse = false;
double m_dfSrcUnitToMeter = 0.0;
double m_dfDstUnitToMeter = 0.0;
CPL_DISALLOW_COPY_ASSIGN(GDALApplyVSGDataset)
public:
GDALApplyVSGDataset( GDALDataset* poSrcDataset,
......@@ -87,8 +89,10 @@ class GDALApplyVSGRasterBand final: public GDALRasterBand
{
friend class GDALApplyVSGDataset;
float *m_pafSrcData;
float *m_pafGridData;
float *m_pafSrcData = nullptr;
float *m_pafGridData = nullptr;
CPL_DISALLOW_COPY_ASSIGN(GDALApplyVSGRasterBand)
public:
GDALApplyVSGRasterBand( GDALDataType eDT,
......
......@@ -52,7 +52,7 @@
#include "cpl_worker_thread_pool.h"
#include "gdal.h"
CPL_CVSID("$Id: gdalgrid.cpp 949d180a26e40650413703b2b73b213137b171e4 2018-06-25 13:43:52 +0200 Even Rouault $")
CPL_CVSID("$Id: gdalgrid.cpp 134b9c4e437e347aac48c459a18a933ed526be5b 2018-06-25 13:43:52 +0200 Even Rouault $")
constexpr double TO_RADIANS = M_PI / 180.0;
......