[gdal] 01/04: Imported Upstream version 2.2.0~rc1+dfsg
Bas Couwenberg
sebastic at debian.org
Fri Apr 28 18:21:22 UTC 2017
This is an automated email from the git hooks/post-receive script.
sebastic pushed a commit to branch experimental-2.2
in repository gdal.
commit 8cb46a5aa047b4627c0f04b56cb2cefed9f61116
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date: Fri Apr 28 18:37:55 2017 +0200
Imported Upstream version 2.2.0~rc1+dfsg
---
NEWS | 9 ++
frmts/idrisi/IdrisiDataset.cpp | 17 +-
frmts/netcdf/netcdfdataset.cpp | 60 ++++++-
gcore/gdal_version.h | 6 +-
man/man1/gdal-config.1 | 2 +-
man/man1/gdal2tiles.1 | 2 +-
man/man1/gdal_calc.1 | 2 +-
man/man1/gdal_contour.1 | 2 +-
man/man1/gdal_edit.1 | 2 +-
man/man1/gdal_fillnodata.1 | 2 +-
man/man1/gdal_grid.1 | 2 +-
man/man1/gdal_merge.1 | 2 +-
man/man1/gdal_pansharpen.1 | 2 +-
man/man1/gdal_polygonize.1 | 2 +-
man/man1/gdal_proximity.1 | 2 +-
man/man1/gdal_rasterize.1 | 2 +-
man/man1/gdal_retile.1 | 2 +-
man/man1/gdal_sieve.1 | 2 +-
man/man1/gdal_translate.1 | 2 +-
man/man1/gdal_utilities.1 | 2 +-
man/man1/gdaladdo.1 | 2 +-
man/man1/gdalbuildvrt.1 | 2 +-
man/man1/gdalcompare.1 | 2 +-
man/man1/gdaldem.1 | 2 +-
man/man1/gdalinfo.1 | 2 +-
man/man1/gdallocationinfo.1 | 2 +-
man/man1/gdalmanage.1 | 2 +-
man/man1/gdalmove.1 | 2 +-
man/man1/gdalsrsinfo.1 | 2 +-
man/man1/gdaltindex.1 | 2 +-
man/man1/gdaltransform.1 | 2 +-
man/man1/gdalwarp.1 | 2 +-
man/man1/gnm_utilities.1 | 2 +-
man/man1/gnmanalyse.1 | 2 +-
man/man1/gnmmanage.1 | 2 +-
man/man1/nearblack.1 | 2 +-
man/man1/ogr2ogr.1 | 2 +-
man/man1/ogr_utilities.1 | 2 +-
man/man1/ogrinfo.1 | 2 +-
man/man1/ogrlineref.1 | 2 +-
man/man1/ogrmerge.1 | 2 +-
man/man1/ogrtindex.1 | 2 +-
man/man1/pct2rgb.1 | 2 +-
man/man1/rgb2pct.1 | 2 +-
ogr/ogrfielddefn.cpp | 11 +-
ogr/ogrsf_frmts/geojson/ogresrijsonreader.cpp | 212 +++++++++++++++----------
ogr/ogrsf_frmts/geojson/ogrgeojsonreader.h | 6 +-
ogr/ogrsf_frmts/gpx/ogrgpxlayer.cpp | 58 ++++---
ogr/ogrsf_frmts/pgdump/ogrpgdumplayer.cpp | 12 +-
ogr/ogrsf_frmts/s57/s57featuredefns.cpp | 11 +-
ogr/ogrsf_frmts/s57/s57reader.cpp | 30 +++-
ogr/ogrsf_frmts/sqlite/ogrsqlitevirtualogr.cpp | 2 +-
port/cpl_multiproc.cpp | 32 ++--
53 files changed, 356 insertions(+), 190 deletions(-)
diff --git a/NEWS b/NEWS
index 4fdd557..8258afd 100644
--- a/NEWS
+++ b/NEWS
@@ -327,6 +327,7 @@ HFA driver:
Idrisi driver:
* use geotransform of source dataset even if it doesn't have a SRS (#6727)
+ * make Create() zero-initialize the .rst file (#6873)
ILWIS driver:
* avoid IniFile::Load() to set the bChanged flag, so as to avoid a rewrite of files when just opening datasets
@@ -403,6 +404,7 @@ NetCDF driver:
* read/write US_survey_foot unit for linear units of projection
* apply 'add_offset' and 'scale_factor' on x and y variables when present, such as in files produced by NOAA from the new GOES-16 (GOES-R) satellite (github #200)
* add a HONOUR_VALID_RANGE=YES/NO open option to control whether pixel values outside of the validity range should be set to the nodata value (#6857)
+ * fix crash on int64/uint64 dimensions and variables, and add support for them (#6870)
NITF driver:
* add support for writing JPEG2000 compressed images with JP2OpenJPEG driver
@@ -589,6 +591,7 @@ GeoJSON driver:
* in case top level id is a negative integer, put the value in a 'id' attribute (#6538)
* ESRI Json reader: support multilinestring from esriGeometryPolyline
* ESRI Json reader: do not set field width of 2147483647 (#6529)
+ * ESRI Json reader: support reading M and ZM geometries
* Add CPL_json_object_object_get() and use it, to avoid deprecation warnings on json_object_object_get()
* TopoJSON reader: sanitize invalid polygons (such as found in the 'TopoJSON' layer of http://bl.ocks.org/mbostock/raw/4090846/us.json)
* writer: fix segfaults on NULL geometry with -lco WRITE_BBOX=YES (#6698)
@@ -645,6 +648,9 @@ GPKG driver:
* use GEOMETRYCOLLECTION instead of GEOMCOLLECTION for SQL and gpkg_geometry_columns.geometry_type_name
* do not warn if gpkg_metadata extension declared
+GPX driver:
+ * ignore wpt/rtept/trkpt with empty content for lat or lon
+
ILI driver:
* ILI1: fix crash in JoinSurfaceLayer() when the multicurve of the feature of the poSurfaceLineLayer layer is empty (#6688)
* ILI1: make polygon reconstruction in Surface layers robust to curves not in natural order (#6728)
@@ -713,6 +719,7 @@ OSM driver:
PG driver:
* fix insertion of binary/bytea content in non-copy mode (#6566)
* fix errors caused by missing geometry_columns/spatial_ref_sys tables in non PostGIS databases, that prevent reading more than 500 features (QGIS #10904)
+ * avoid errors with field default expressions like 'foo'::text (#6872)
PLScenes driver:
* add HTTP retry logic (#6655)
@@ -724,6 +731,7 @@ S57 driver:
* fix crashes if the s57objectclasses.csv resource file contains invalid lines
* remove data/s57attributes_aml.csv data/s57attributes_iw.csv data/s57objectclasses_aml.csv data/s57objectclasses_iw.csv and move their content into main s57attributes.csv and s57objectclasses.csv files (#6673)
* Update s57 attributes and object classes according to s-57 reference (github #202)
+ * add POSACC and QUAPOS fields for geometric primitive layers (github #205)
SDE driver:
* rename driver to OGR_SDE. Fix build (#6714)
@@ -761,6 +769,7 @@ SQLite/Spatialite driver:
* SQLite/GPKG: change default page_size to 4096 bytes.
* Update layer statistics for Spatialite 4 DB (#6838)
* Remove traces of support of SQLite < 3.6.0
+ * SQLite dialect: properly quote column names when needed (github #214)
VFK driver:
* allow reading multiple VFK files into single DB support amendment VFK files
diff --git a/frmts/idrisi/IdrisiDataset.cpp b/frmts/idrisi/IdrisiDataset.cpp
index 469319f..4c6b8bb 100644
--- a/frmts/idrisi/IdrisiDataset.cpp
+++ b/frmts/idrisi/IdrisiDataset.cpp
@@ -44,7 +44,7 @@
#include <cmath>
-CPL_CVSID( "$Id: IdrisiDataset.cpp 36981 2016-12-20 19:46:41Z rouault $" );
+CPL_CVSID( "$Id: IdrisiDataset.cpp 38148 2017-04-26 20:18:07Z rouault $" );
#ifdef WIN32
# define PATHDELIM '\\'
@@ -557,7 +557,7 @@ IdrisiDataset::~IdrisiDataset()
{
FlushCache();
- if( papszRDC != NULL )
+ if( papszRDC != NULL && eAccess == GA_Update )
{
//int bSuccessMin = FALSE;
//int bSuccessMax = FALSE;
@@ -583,11 +583,8 @@ IdrisiDataset::~IdrisiDataset()
poBand->SetMinMax( dfMin, dfMax);
}
- if( eAccess == GA_Update )
- {
- CSLSetNameValueSeparator( papszRDC, ": " );
- SaveAsCRLF( papszRDC, pszDocFilename );
- }
+ CSLSetNameValueSeparator( papszRDC, ": " );
+ SaveAsCRLF( papszRDC, pszDocFilename );
CSLDestroy( papszRDC );
}
@@ -1041,6 +1038,12 @@ GDALDataset *IdrisiDataset::Create( const char *pszFilename,
"Attempt to create file %s' failed.\n", pszFilename );
return NULL;
}
+
+ const int nTargetDTSize = EQUAL(pszLDataType, rstBYTE) ? 1 :
+ EQUAL(pszLDataType, rstINTEGER) ? 2 :
+ EQUAL(pszLDataType, rstRGB24) ? 3 : 4;
+ VSIFTruncateL(fp,
+ static_cast<vsi_l_offset>(nXSize) * nYSize * nTargetDTSize);
VSIFCloseL( fp );
return (IdrisiDataset *) GDALOpen( pszFilename, GA_Update );
diff --git a/frmts/netcdf/netcdfdataset.cpp b/frmts/netcdf/netcdfdataset.cpp
index 07cc4bc..9493c1b 100644
--- a/frmts/netcdf/netcdfdataset.cpp
+++ b/frmts/netcdf/netcdfdataset.cpp
@@ -62,7 +62,7 @@
#include "ogr_core.h"
#include "ogr_srs_api.h"
-CPL_CVSID("$Id: netcdfdataset.cpp 38053 2017-04-18 15:22:27Z rouault $");
+CPL_CVSID("$Id: netcdfdataset.cpp 38132 2017-04-25 16:34:14Z rouault $");
// Internal function declarations.
@@ -1196,12 +1196,14 @@ CPLErr netCDFRasterBand::CreateBandMetadata( const int *paDimIds )
snprintf(szMetaTemp, sizeof(szMetaTemp), "%d", sData);
break;
case NC_INT:
+ {
int nData;
/* status = */ nc_get_vara_int(cdfid, nVarID,
start,
count, &nData);
snprintf(szMetaTemp, sizeof(szMetaTemp), "%d", nData);
break;
+ }
case NC_FLOAT:
float fData;
/* status = */ nc_get_vara_float(cdfid, nVarID,
@@ -1234,12 +1236,32 @@ CPLErr netCDFRasterBand::CreateBandMetadata( const int *paDimIds )
snprintf(szMetaTemp, sizeof(szMetaTemp), "%u", usData);
break;
case NC_UINT:
+ {
unsigned int unData;
/* status = */ nc_get_vara_uint(cdfid, nVarID,
start,
count, &unData);
snprintf(szMetaTemp, sizeof(szMetaTemp), "%u", unData);
break;
+ }
+ case NC_INT64:
+ {
+ long long nData;
+ /* status = */ nc_get_vara_longlong(cdfid, nVarID,
+ start,
+ count, &nData);
+ snprintf(szMetaTemp, sizeof(szMetaTemp), CPL_FRMT_GIB, nData);
+ break;
+ }
+ case NC_UINT64:
+ {
+ unsigned long long unData;
+ /* status = */ nc_get_vara_ulonglong(cdfid, nVarID,
+ start,
+ count, &unData);
+ snprintf(szMetaTemp, sizeof(szMetaTemp), CPL_FRMT_GUIB, unData);
+ break;
+ }
#endif
default:
CPLDebug("GDAL_netCDF", "invalid dim %s, type=%d",
@@ -8738,6 +8760,40 @@ static CPLErr NCDFGet1DVar( int nCdfId, int nVarId, char **pszValue )
CPLFree(punTemp);
break;
}
+ case NC_INT64:
+ {
+ long long *pnTemp = static_cast<long long *>(
+ CPLCalloc(nVarLen, sizeof(long long)));
+ nc_get_vara_longlong(nCdfId, nVarId, start, count, pnTemp);
+ char szTemp[256];
+ size_t m = 0;
+ for(; m < nVarLen - 1; m++)
+ {
+ snprintf(szTemp, sizeof(szTemp), CPL_FRMT_GIB ",", pnTemp[m]);
+ NCDFSafeStrcat(&pszVarValue, szTemp, &nVarValueSize);
+ }
+ snprintf(szTemp, sizeof(szTemp), CPL_FRMT_GIB, pnTemp[m]);
+ NCDFSafeStrcat(&pszVarValue, szTemp, &nVarValueSize);
+ CPLFree(pnTemp);
+ break;
+ }
+ case NC_UINT64:
+ {
+ unsigned long long *pnTemp = static_cast<unsigned long long *>(
+ CPLCalloc(nVarLen, sizeof(unsigned long long)));
+ nc_get_vara_ulonglong(nCdfId, nVarId, start, count, pnTemp);
+ char szTemp[256];
+ size_t m = 0;
+ for(; m < nVarLen - 1; m++)
+ {
+ snprintf(szTemp, sizeof(szTemp), CPL_FRMT_GUIB ",", pnTemp[m]);
+ NCDFSafeStrcat(&pszVarValue, szTemp, &nVarValueSize);
+ }
+ snprintf(szTemp, sizeof(szTemp), CPL_FRMT_GUIB, pnTemp[m]);
+ NCDFSafeStrcat(&pszVarValue, szTemp, &nVarValueSize);
+ CPLFree(pnTemp);
+ break;
+ }
#endif
default:
CPLDebug("GDAL_netCDF", "NCDFGetVar1D unsupported type %d", nVarType);
@@ -8746,7 +8802,7 @@ static CPLErr NCDFGet1DVar( int nCdfId, int nVarId, char **pszValue )
break;
}
- if( nVarLen > 1 && nVarType != NC_CHAR )
+ if( pszVarValue != NULL && nVarLen > 1 && nVarType != NC_CHAR )
NCDFSafeStrcat(&pszVarValue, "}", &nVarValueSize);
/* set return values */
diff --git a/gcore/gdal_version.h b/gcore/gdal_version.h
index 7ea8324..a5ba3e0 100644
--- a/gcore/gdal_version.h
+++ b/gcore/gdal_version.h
@@ -1,4 +1,4 @@
-/* $Id: gdal_version.h 38124 2017-04-23 12:46:45Z rouault $ */
+/* $Id: gdal_version.h 38167 2017-04-28 16:00:45Z rouault $ */
/* -------------------------------------------------------------------- */
/* GDAL Version Information. */
@@ -23,8 +23,8 @@
#endif
#ifndef GDAL_RELEASE_DATE
-# define GDAL_RELEASE_DATE 20170423
+# define GDAL_RELEASE_DATE 20170428
#endif
#ifndef GDAL_RELEASE_NAME
-# define GDAL_RELEASE_NAME "2.2.0beta2"
+# define GDAL_RELEASE_NAME "2.2.0"
#endif
diff --git a/man/man1/gdal-config.1 b/man/man1/gdal-config.1
index 4ab9453..bd5d20f 100644
--- a/man/man1/gdal-config.1
+++ b/man/man1/gdal-config.1
@@ -1,4 +1,4 @@
-.TH "gdal-config" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdal-config" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal2tiles.1 b/man/man1/gdal2tiles.1
index 60bc433..8c18403 100644
--- a/man/man1/gdal2tiles.1
+++ b/man/man1/gdal2tiles.1
@@ -1,4 +1,4 @@
-.TH "gdal2tiles" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdal2tiles" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_calc.1 b/man/man1/gdal_calc.1
index 7416e06..bc6007e 100644
--- a/man/man1/gdal_calc.1
+++ b/man/man1/gdal_calc.1
@@ -1,4 +1,4 @@
-.TH "gdal_calc" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdal_calc" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_contour.1 b/man/man1/gdal_contour.1
index b891543..dc094a4 100644
--- a/man/man1/gdal_contour.1
+++ b/man/man1/gdal_contour.1
@@ -1,4 +1,4 @@
-.TH "gdal_contour" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdal_contour" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_edit.1 b/man/man1/gdal_edit.1
index 5c7620e..804543e 100644
--- a/man/man1/gdal_edit.1
+++ b/man/man1/gdal_edit.1
@@ -1,4 +1,4 @@
-.TH "gdal_edit" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdal_edit" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_fillnodata.1 b/man/man1/gdal_fillnodata.1
index 430d872..14c04b4 100644
--- a/man/man1/gdal_fillnodata.1
+++ b/man/man1/gdal_fillnodata.1
@@ -1,4 +1,4 @@
-.TH "gdal_fillnodata" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdal_fillnodata" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_grid.1 b/man/man1/gdal_grid.1
index 60ac800..2ffd052 100644
--- a/man/man1/gdal_grid.1
+++ b/man/man1/gdal_grid.1
@@ -1,4 +1,4 @@
-.TH "gdal_grid" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdal_grid" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_merge.1 b/man/man1/gdal_merge.1
index be4b80f..8453289 100644
--- a/man/man1/gdal_merge.1
+++ b/man/man1/gdal_merge.1
@@ -1,4 +1,4 @@
-.TH "gdal_merge" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdal_merge" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_pansharpen.1 b/man/man1/gdal_pansharpen.1
index 4e08bed..07191b3 100644
--- a/man/man1/gdal_pansharpen.1
+++ b/man/man1/gdal_pansharpen.1
@@ -1,4 +1,4 @@
-.TH "gdal_pansharpen" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdal_pansharpen" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_polygonize.1 b/man/man1/gdal_polygonize.1
index 8523fba..b1e26e6 100644
--- a/man/man1/gdal_polygonize.1
+++ b/man/man1/gdal_polygonize.1
@@ -1,4 +1,4 @@
-.TH "gdal_polygonize" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdal_polygonize" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_proximity.1 b/man/man1/gdal_proximity.1
index f997c2c..45a353f 100644
--- a/man/man1/gdal_proximity.1
+++ b/man/man1/gdal_proximity.1
@@ -1,4 +1,4 @@
-.TH "gdal_proximity" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdal_proximity" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_rasterize.1 b/man/man1/gdal_rasterize.1
index 48844c2..f25540e 100644
--- a/man/man1/gdal_rasterize.1
+++ b/man/man1/gdal_rasterize.1
@@ -1,4 +1,4 @@
-.TH "gdal_rasterize" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdal_rasterize" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_retile.1 b/man/man1/gdal_retile.1
index c4efa3d..516139c 100644
--- a/man/man1/gdal_retile.1
+++ b/man/man1/gdal_retile.1
@@ -1,4 +1,4 @@
-.TH "gdal_retile" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdal_retile" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_sieve.1 b/man/man1/gdal_sieve.1
index 45da4ae..ca20acf 100644
--- a/man/man1/gdal_sieve.1
+++ b/man/man1/gdal_sieve.1
@@ -1,4 +1,4 @@
-.TH "gdal_sieve" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdal_sieve" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_translate.1 b/man/man1/gdal_translate.1
index 61b66c0..66a4efd 100644
--- a/man/man1/gdal_translate.1
+++ b/man/man1/gdal_translate.1
@@ -1,4 +1,4 @@
-.TH "gdal_translate" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdal_translate" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_utilities.1 b/man/man1/gdal_utilities.1
index 91ff88f..346da27 100644
--- a/man/man1/gdal_utilities.1
+++ b/man/man1/gdal_utilities.1
@@ -1,4 +1,4 @@
-.TH "gdal_utilities" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdal_utilities" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdaladdo.1 b/man/man1/gdaladdo.1
index 2f9fca0..79a4b8c 100644
--- a/man/man1/gdaladdo.1
+++ b/man/man1/gdaladdo.1
@@ -1,4 +1,4 @@
-.TH "gdaladdo" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdaladdo" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdalbuildvrt.1 b/man/man1/gdalbuildvrt.1
index 2443dfc..7a2a672 100644
--- a/man/man1/gdalbuildvrt.1
+++ b/man/man1/gdalbuildvrt.1
@@ -1,4 +1,4 @@
-.TH "gdalbuildvrt" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdalbuildvrt" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdalcompare.1 b/man/man1/gdalcompare.1
index d08ffd4..d5212b9 100644
--- a/man/man1/gdalcompare.1
+++ b/man/man1/gdalcompare.1
@@ -1,4 +1,4 @@
-.TH "gdalcompare" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdalcompare" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdaldem.1 b/man/man1/gdaldem.1
index fbcbbc4..b9a64dd 100644
--- a/man/man1/gdaldem.1
+++ b/man/man1/gdaldem.1
@@ -1,4 +1,4 @@
-.TH "gdaldem" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdaldem" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdalinfo.1 b/man/man1/gdalinfo.1
index 149db02..60f85ea 100644
--- a/man/man1/gdalinfo.1
+++ b/man/man1/gdalinfo.1
@@ -1,4 +1,4 @@
-.TH "gdalinfo" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdalinfo" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdallocationinfo.1 b/man/man1/gdallocationinfo.1
index 77cbacf..6198e67 100644
--- a/man/man1/gdallocationinfo.1
+++ b/man/man1/gdallocationinfo.1
@@ -1,4 +1,4 @@
-.TH "gdallocationinfo" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdallocationinfo" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdalmanage.1 b/man/man1/gdalmanage.1
index ebb376f..290405a 100644
--- a/man/man1/gdalmanage.1
+++ b/man/man1/gdalmanage.1
@@ -1,4 +1,4 @@
-.TH "gdalmanage" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdalmanage" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdalmove.1 b/man/man1/gdalmove.1
index d5ce4be..78263cb 100644
--- a/man/man1/gdalmove.1
+++ b/man/man1/gdalmove.1
@@ -1,4 +1,4 @@
-.TH "gdalmove" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdalmove" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdalsrsinfo.1 b/man/man1/gdalsrsinfo.1
index 3bdf31b..b86a256 100644
--- a/man/man1/gdalsrsinfo.1
+++ b/man/man1/gdalsrsinfo.1
@@ -1,4 +1,4 @@
-.TH "gdalsrsinfo" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdalsrsinfo" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdaltindex.1 b/man/man1/gdaltindex.1
index 35bf4da..282793d 100644
--- a/man/man1/gdaltindex.1
+++ b/man/man1/gdaltindex.1
@@ -1,4 +1,4 @@
-.TH "gdaltindex" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdaltindex" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdaltransform.1 b/man/man1/gdaltransform.1
index 88582ac..ee028ac 100644
--- a/man/man1/gdaltransform.1
+++ b/man/man1/gdaltransform.1
@@ -1,4 +1,4 @@
-.TH "gdaltransform" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdaltransform" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdalwarp.1 b/man/man1/gdalwarp.1
index 68595a1..865c5fb 100644
--- a/man/man1/gdalwarp.1
+++ b/man/man1/gdalwarp.1
@@ -1,4 +1,4 @@
-.TH "gdalwarp" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gdalwarp" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gnm_utilities.1 b/man/man1/gnm_utilities.1
index 739e127..2d2baea 100644
--- a/man/man1/gnm_utilities.1
+++ b/man/man1/gnm_utilities.1
@@ -1,4 +1,4 @@
-.TH "gnm_utilities" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gnm_utilities" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gnmanalyse.1 b/man/man1/gnmanalyse.1
index 88138b2..5859b61 100644
--- a/man/man1/gnmanalyse.1
+++ b/man/man1/gnmanalyse.1
@@ -1,4 +1,4 @@
-.TH "gnmanalyse" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gnmanalyse" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gnmmanage.1 b/man/man1/gnmmanage.1
index b44e333..b330b04 100644
--- a/man/man1/gnmmanage.1
+++ b/man/man1/gnmmanage.1
@@ -1,4 +1,4 @@
-.TH "gnmmanage" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "gnmmanage" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/nearblack.1 b/man/man1/nearblack.1
index 751bee9..832f662 100644
--- a/man/man1/nearblack.1
+++ b/man/man1/nearblack.1
@@ -1,4 +1,4 @@
-.TH "nearblack" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "nearblack" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/ogr2ogr.1 b/man/man1/ogr2ogr.1
index 3ada4d8..2596fb0 100644
--- a/man/man1/ogr2ogr.1
+++ b/man/man1/ogr2ogr.1
@@ -1,4 +1,4 @@
-.TH "ogr2ogr" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "ogr2ogr" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/ogr_utilities.1 b/man/man1/ogr_utilities.1
index b170bf5..8836842 100644
--- a/man/man1/ogr_utilities.1
+++ b/man/man1/ogr_utilities.1
@@ -1,4 +1,4 @@
-.TH "ogr_utilities" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "ogr_utilities" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/ogrinfo.1 b/man/man1/ogrinfo.1
index f729895..a5d3925 100644
--- a/man/man1/ogrinfo.1
+++ b/man/man1/ogrinfo.1
@@ -1,4 +1,4 @@
-.TH "ogrinfo" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "ogrinfo" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/ogrlineref.1 b/man/man1/ogrlineref.1
index eb05590..1d4b620 100644
--- a/man/man1/ogrlineref.1
+++ b/man/man1/ogrlineref.1
@@ -1,4 +1,4 @@
-.TH "ogrlineref" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "ogrlineref" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/ogrmerge.1 b/man/man1/ogrmerge.1
index 4d78957..83a70ae 100644
--- a/man/man1/ogrmerge.1
+++ b/man/man1/ogrmerge.1
@@ -1,4 +1,4 @@
-.TH "ogrmerge" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "ogrmerge" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/ogrtindex.1 b/man/man1/ogrtindex.1
index 779bdef..73b701e 100644
--- a/man/man1/ogrtindex.1
+++ b/man/man1/ogrtindex.1
@@ -1,4 +1,4 @@
-.TH "ogrtindex" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "ogrtindex" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/pct2rgb.1 b/man/man1/pct2rgb.1
index ccc4335..64a01ca 100644
--- a/man/man1/pct2rgb.1
+++ b/man/man1/pct2rgb.1
@@ -1,4 +1,4 @@
-.TH "pct2rgb" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "pct2rgb" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/rgb2pct.1 b/man/man1/rgb2pct.1
index d4f103f..7c758a1 100644
--- a/man/man1/rgb2pct.1
+++ b/man/man1/rgb2pct.1
@@ -1,4 +1,4 @@
-.TH "rgb2pct" 1 "Sun Apr 23 2017" "GDAL" \" -*- nroff -*-
+.TH "rgb2pct" 1 "Fri Apr 28 2017" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/ogr/ogrfielddefn.cpp b/ogr/ogrfielddefn.cpp
index 85305e9..197a00a 100644
--- a/ogr/ogrfielddefn.cpp
+++ b/ogr/ogrfielddefn.cpp
@@ -41,7 +41,7 @@
#include "cpl_string.h"
-CPL_CVSID("$Id: ogrfielddefn.cpp 37441 2017-02-24 23:16:17Z goatbar $");
+CPL_CVSID("$Id: ogrfielddefn.cpp 38135 2017-04-25 22:42:55Z rouault $");
/************************************************************************/
/* OGRFieldDefn() */
@@ -434,14 +434,9 @@ void OGRFieldDefn::SetDefault( const char* pszDefaultIn )
CPLFree(pszDefault);
pszDefault = NULL;
- if( pszDefaultIn && pszDefaultIn[0] == '\'' )
+ if( pszDefaultIn && pszDefaultIn[0] == '\'' &&
+ pszDefaultIn[strlen(pszDefaultIn)-1] == '\'' )
{
- if( pszDefaultIn[strlen(pszDefaultIn)-1] != '\'' )
- {
- CPLError(CE_Failure, CPLE_AppDefined,
- "Incorrectly quoted string literal");
- return;
- }
const char* pszPtr = pszDefaultIn + 1; // Used after for.
for( ; *pszPtr != '\0'; pszPtr++ )
{
diff --git a/ogr/ogrsf_frmts/geojson/ogresrijsonreader.cpp b/ogr/ogrsf_frmts/geojson/ogresrijsonreader.cpp
index 085ba4d..bb5b899 100644
--- a/ogr/ogrsf_frmts/geojson/ogresrijsonreader.cpp
+++ b/ogr/ogrsf_frmts/geojson/ogresrijsonreader.cpp
@@ -50,7 +50,7 @@
#include "ogrgeojsonutils.h"
// #include "symbol_renames.h"
-CPL_CVSID("$Id: ogresrijsonreader.cpp 38115 2017-04-23 07:24:41Z rouault $");
+CPL_CVSID("$Id: ogresrijsonreader.cpp 38127 2017-04-23 14:58:22Z rouault $");
/************************************************************************/
/* OGRESRIJSONReader() */
@@ -465,68 +465,71 @@ OGRwkbGeometryType OGRESRIJSONGetGeometryType( json_object* poObj )
}
/************************************************************************/
-/* OGRESRIJSONReadPoint() */
+/* OGRESRIJSONGetCoordinateToDouble() */
/************************************************************************/
-OGRPoint* OGRESRIJSONReadPoint( json_object* poObj)
+static double OGRESRIJSONGetCoordinateToDouble( json_object* poObjCoord,
+ const char* pszCoordName,
+ bool& bValid )
{
- CPLAssert( NULL != poObj );
-
- json_object* poObjX = OGRGeoJSONFindMemberByName( poObj, "x" );
- if( NULL == poObjX )
- {
- CPLError( CE_Failure, CPLE_AppDefined,
- "Invalid Point object. "
- "Missing \'x\' member." );
- return NULL;
- }
-
- const int iTypeX = json_object_get_type(poObjX);
- if( json_type_double != iTypeX && json_type_int != iTypeX )
+ const int iType = json_object_get_type(poObjCoord);
+ if( json_type_double != iType && json_type_int != iType )
{
CPLError(
CE_Failure, CPLE_AppDefined,
- "Invalid X coordinate. Type is not double or integer for \'%s\'.",
- json_object_to_json_string(poObjX) );
- return NULL;
+ "Invalid '%s' coordinate. "
+ "Type is not double or integer for \'%s\'.",
+ pszCoordName,
+ json_object_to_json_string(poObjCoord) );
+ bValid = false;
+ return 0.0;
}
- json_object* poObjY = OGRGeoJSONFindMemberByName( poObj, "y" );
- if( NULL == poObjY )
+ return json_object_get_double( poObjCoord );
+}
+
+/************************************************************************/
+/* OGRESRIJSONGetCoordinate() */
+/************************************************************************/
+
+static double OGRESRIJSONGetCoordinate( json_object* poObj,
+ const char* pszCoordName,
+ bool& bValid )
+{
+ json_object* poObjCoord = OGRGeoJSONFindMemberByName( poObj, pszCoordName );
+ if( NULL == poObjCoord )
{
CPLError( CE_Failure, CPLE_AppDefined,
- "Invalid Point object. "
- "Missing \'y\' member." );
- return NULL;
+ "Invalid Point object. "
+ "Missing '%s' member.", pszCoordName );
+ bValid = false;
+ return 0.0;
}
- const int iTypeY = json_object_get_type(poObjY);
- if( json_type_double != iTypeY && json_type_int != iTypeY )
- {
- CPLError(
- CE_Failure, CPLE_AppDefined,
- "Invalid Y coordinate. Type is not double or integer for \'%s\'.",
- json_object_to_json_string(poObjY) );
- return NULL;
- }
+ return OGRESRIJSONGetCoordinateToDouble( poObjCoord, pszCoordName, bValid );
+}
- const double dfX = json_object_get_double( poObjX );
- const double dfY = json_object_get_double( poObjY );
+/************************************************************************/
+/* OGRESRIJSONReadPoint() */
+/************************************************************************/
+
+OGRPoint* OGRESRIJSONReadPoint( json_object* poObj)
+{
+ CPLAssert( NULL != poObj );
+
+ bool bValid = true;
+ const double dfX = OGRESRIJSONGetCoordinate(poObj, "x", bValid);
+ const double dfY = OGRESRIJSONGetCoordinate(poObj, "y", bValid);
+ if( !bValid )
+ return NULL;
json_object* poObjZ = OGRGeoJSONFindMemberByName( poObj, "z" );
if( NULL == poObjZ )
return new OGRPoint(dfX, dfY);
- const int iTypeZ = json_object_get_type(poObjZ);
- if( json_type_double != iTypeZ && json_type_int != iTypeZ )
- {
- CPLError( CE_Failure, CPLE_AppDefined,
- "Invalid Z coordinate. Type is not double or integer "
- "for \'%s\'.",
- json_object_to_json_string(poObjZ) );
+ const double dfZ = OGRESRIJSONGetCoordinateToDouble(poObjZ, "z", bValid);
+ if( !bValid )
return NULL;
- }
- const double dfZ = json_object_get_double( poObjZ );
return new OGRPoint(dfX, dfY, dfZ);
}
@@ -541,7 +544,7 @@ static bool OGRESRIJSONReaderParseZM( json_object* poObj, bool *bHasZ,
// The ESRI geojson spec states that geometries other than point can
// have the attributes hasZ and hasM. A geometry that has a z value
// implies the 3rd number in the tuple is z. if hasM is true, but hasZ
- // is not, it is the M value, and is not supported in OGR.
+ // is not, it is the M value.
bool bZ = false;
json_object* poObjHasZ = OGRGeoJSONFindMemberByName( poObj, "hasZ" );
if( poObjHasZ != NULL )
@@ -573,8 +576,10 @@ static bool OGRESRIJSONReaderParseZM( json_object* poObj, bool *bHasZ,
/************************************************************************/
static bool OGRESRIJSONReaderParseXYZMArray( json_object* poObjCoords,
+ bool /*bHasZ*/, bool bHasM,
double* pdfX, double* pdfY,
- double* pdfZ, int* pnNumCoords )
+ double* pdfZ, double* pdfM,
+ int* pnNumCoords )
{
if( poObjCoords == NULL )
{
@@ -610,17 +615,8 @@ static bool OGRESRIJSONReaderParseXYZMArray( json_object* poObjCoords,
return false;
}
- int iType = json_object_get_type(poObjCoord);
- if( json_type_double != iType && json_type_int != iType )
- {
- CPLError( CE_Failure, CPLE_AppDefined,
- "Invalid X coordinate. Type is not double or integer "
- "for \'%s\'.",
- json_object_to_json_string(poObjCoord) );
- return false;
- }
-
- const double dfX = json_object_get_double( poObjCoord );
+ bool bValid = true;
+ const double dfX = OGRESRIJSONGetCoordinateToDouble(poObjCoord, "x", bValid);
// Read Y coordinate.
poObjCoord = json_object_array_get_idx( poObjCoords, 1 );
@@ -631,20 +627,12 @@ static bool OGRESRIJSONReaderParseXYZMArray( json_object* poObjCoords,
return false;
}
- iType = json_object_get_type(poObjCoord);
- if( json_type_double != iType && json_type_int != iType )
- {
- CPLError(
- CE_Failure, CPLE_AppDefined,
- "Invalid Y coordinate. Type is not double or integer for \'%s\'.",
- json_object_to_json_string(poObjCoord) );
+ const double dfY = OGRESRIJSONGetCoordinateToDouble(poObjCoord, "y", bValid);
+ if( !bValid )
return false;
- }
-
- const double dfY = json_object_get_double( poObjCoord );
- // Read Z coordinate.
- if( coordDimension > 2 )
+ // Read Z or M or Z and M coordinates.
+ if( coordDimension > 2)
{
poObjCoord = json_object_array_get_idx( poObjCoords, 2 );
if( poObjCoord == NULL )
@@ -654,23 +642,48 @@ static bool OGRESRIJSONReaderParseXYZMArray( json_object* poObjCoords,
return false;
}
- iType = json_object_get_type(poObjCoord);
- if( json_type_double != iType && json_type_int != iType )
- {
- CPLError( CE_Failure, CPLE_AppDefined,
- "Invalid Z coordinate. Type is not double or integer "
- "for \'%s\'.",
- json_object_to_json_string(poObjCoord) );
+ const double dfZorM = OGRESRIJSONGetCoordinateToDouble(poObjCoord,
+ (coordDimension > 3 || !bHasM) ? "z": "m", bValid);
+ if( !bValid )
return false;
- }
- const double dfZ = json_object_get_double( poObjCoord );
if( pdfZ != NULL )
- *pdfZ = dfZ;
+ {
+ if (coordDimension > 3 || !bHasM)
+ *pdfZ = dfZorM;
+ else
+ *pdfZ = 0.0;
+ }
+ if( pdfM != NULL && coordDimension == 3 )
+ {
+ if (bHasM)
+ *pdfM = dfZorM;
+ else
+ *pdfM = 0.0;
+ }
+ if( coordDimension == 4 )
+ {
+ poObjCoord = json_object_array_get_idx( poObjCoords, 3 );
+ if( poObjCoord == NULL )
+ {
+ CPLDebug( "ESRIJSON",
+ "OGRESRIJSONReaderParseXYZMArray: got null object." );
+ return false;
+ }
+
+ const double dfM = OGRESRIJSONGetCoordinateToDouble(poObjCoord,
+ "m", bValid);
+ if( !bValid )
+ return false;
+ if( pdfM != NULL )
+ *pdfM = dfM;
+ }
}
else
{
if( pdfZ != NULL )
*pdfZ = 0.0;
+ if( pdfM != NULL )
+ *pdfM = 0.0;
}
if( pnNumCoords != NULL )
@@ -754,8 +767,9 @@ OGRGeometry* OGRESRIJSONReadLineString( json_object* poObj )
double dfX = 0.0;
double dfY = 0.0;
double dfZ = 0.0;
+ double dfM = 0.0;
if( !OGRESRIJSONReaderParseXYZMArray (
- poObjCoords, &dfX, &dfY, &dfZ, &nNumCoords) )
+ poObjCoords, bHasZ, bHasM, &dfX, &dfY, &dfZ, &dfM, &nNumCoords) )
{
if( poRet != poLine )
delete poRet;
@@ -763,10 +777,18 @@ OGRGeometry* OGRESRIJSONReadLineString( json_object* poObj )
return NULL;
}
- if( nNumCoords > 2 && (bHasZ || !bHasM) )
+ if( nNumCoords == 3 && !bHasM )
{
poLine->addPoint( dfX, dfY, dfZ);
}
+ else if( nNumCoords == 3 )
+ {
+ poLine->addPointM( dfX, dfY, dfM);
+ }
+ else if( nNumCoords == 4 )
+ {
+ poLine->addPoint( dfX, dfY, dfZ, dfM);
+ }
else
{
poLine->addPoint( dfX, dfY );
@@ -844,8 +866,9 @@ OGRGeometry* OGRESRIJSONReadPolygon( json_object* poObj)
double dfX = 0.0;
double dfY = 0.0;
double dfZ = 0.0;
+ double dfM = 0.0;
if( !OGRESRIJSONReaderParseXYZMArray (
- poObjCoords, &dfX, &dfY, &dfZ, &nNumCoords) )
+ poObjCoords, bHasZ, bHasM, &dfX, &dfY, &dfZ, &dfM, &nNumCoords) )
{
for( int j = 0; j <= iRing; j++ )
delete papoGeoms[j];
@@ -853,10 +876,18 @@ OGRGeometry* OGRESRIJSONReadPolygon( json_object* poObj)
return NULL;
}
- if( nNumCoords > 2 && (bHasZ || !bHasM) )
+ if( nNumCoords == 3 && !bHasM )
{
poLine->addPoint( dfX, dfY, dfZ);
}
+ else if( nNumCoords == 3 )
+ {
+ poLine->addPointM( dfX, dfY, dfM);
+ }
+ else if( nNumCoords == 4 )
+ {
+ poLine->addPoint( dfX, dfY, dfZ, dfM);
+ }
else
{
poLine->addPoint( dfX, dfY );
@@ -918,17 +949,28 @@ OGRMultiPoint* OGRESRIJSONReadMultiPoint( json_object* poObj)
double dfX = 0.0;
double dfY = 0.0;
double dfZ = 0.0;
+ double dfM = 0.0;
if( !OGRESRIJSONReaderParseXYZMArray (
- poObjCoords, &dfX, &dfY, &dfZ, &nNumCoords) )
+ poObjCoords, bHasZ, bHasM, &dfX, &dfY, &dfZ, &dfM, &nNumCoords) )
{
delete poMulti;
return NULL;
}
- if( nNumCoords > 2 && (bHasZ || !bHasM) )
+ if( nNumCoords == 3 && !bHasM )
{
poMulti->addGeometryDirectly( new OGRPoint(dfX, dfY, dfZ) );
}
+ else if( nNumCoords == 3 )
+ {
+ OGRPoint* poPoint = new OGRPoint(dfX, dfY);
+ poPoint->setM(dfM);
+ poMulti->addGeometryDirectly( poPoint );
+ }
+ else if( nNumCoords == 4 )
+ {
+ poMulti->addGeometryDirectly( new OGRPoint(dfX, dfY, dfZ, dfM) );
+ }
else
{
poMulti->addGeometryDirectly( new OGRPoint(dfX, dfY) );
diff --git a/ogr/ogrsf_frmts/geojson/ogrgeojsonreader.h b/ogr/ogrsf_frmts/geojson/ogrgeojsonreader.h
index 7b10742..4eee0bf 100644
--- a/ogr/ogrsf_frmts/geojson/ogrgeojsonreader.h
+++ b/ogr/ogrsf_frmts/geojson/ogrgeojsonreader.h
@@ -1,5 +1,5 @@
/******************************************************************************
- * $Id: ogrgeojsonreader.h 37858 2017-03-29 10:19:55Z rouault $
+ * $Id: ogrgeojsonreader.h 38146 2017-04-26 14:09:40Z rouault $
*
* Project: OpenGIS Simple Features Reference Implementation
* Purpose: Defines GeoJSON reader within OGR OGRGeoJSON Driver.
@@ -180,8 +180,8 @@ json_object* json_ex_get_object_by_path( json_object* poObj,
json_object CPL_DLL* CPL_json_object_object_get( struct json_object* obj,
const char *key );
-bool OGRJSonParse( const char* pszText, json_object** ppoObj,
- bool bVerboseError = true );
+bool CPL_DLL OGRJSonParse( const char* pszText, json_object** ppoObj,
+ bool bVerboseError = true );
/************************************************************************/
/* GeoJSON Geometry Translators */
diff --git a/ogr/ogrsf_frmts/gpx/ogrgpxlayer.cpp b/ogr/ogrsf_frmts/gpx/ogrgpxlayer.cpp
index 050202b..6ab2be9 100644
--- a/ogr/ogrsf_frmts/gpx/ogrgpxlayer.cpp
+++ b/ogr/ogrsf_frmts/gpx/ogrgpxlayer.cpp
@@ -32,7 +32,7 @@
#include "cpl_string.h"
#include "ogr_p.h"
-CPL_CVSID("$Id: ogrgpxlayer.cpp 37371 2017-02-13 11:41:59Z rouault $");
+CPL_CVSID("$Id: ogrgpxlayer.cpp 38144 2017-04-26 13:33:17Z rouault $");
static const int FLD_TRACK_FID = 0;
static const int FLD_TRACK_SEG_ID = 1;
@@ -513,37 +513,43 @@ void OGRGPXLayer::startElementCbk(const char *pszName, const char **ppszAttr)
for (int i = 0; ppszAttr[i]; i += 2)
{
- if (strcmp(ppszAttr[i], "lat") == 0)
+ if (strcmp(ppszAttr[i], "lat") == 0 && ppszAttr[i + 1][0])
{
hasFoundLat = true;
latVal = CPLAtof(ppszAttr[i + 1]);
}
- else if (strcmp(ppszAttr[i], "lon") == 0)
+ else if (strcmp(ppszAttr[i], "lon") == 0 && ppszAttr[i + 1][0])
{
hasFoundLon = true;
lonVal = CPLAtof(ppszAttr[i + 1]);
}
}
+ poFeature->SetFID( nNextFID++ );
+
if (hasFoundLat && hasFoundLon)
{
- poFeature->SetFID( nNextFID++ );
poFeature->SetGeometryDirectly( new OGRPoint( lonVal, latVal ) );
+ }
+ else
+ {
+ CPLDebug("GPX", "Skipping %s (FID=%d) without lat and/or lon",
+ pszName, nNextFID);
+ }
- if (gpxGeomType == GPX_ROUTE_POINT)
- {
- rtePtId++;
- poFeature->SetField( FLD_ROUTE_FID, rteFID-1);
- poFeature->SetField( FLD_ROUTE_PT_ID, rtePtId-1);
- }
- else if (gpxGeomType == GPX_TRACK_POINT)
- {
- trkSegPtId++;
+ if (gpxGeomType == GPX_ROUTE_POINT)
+ {
+ rtePtId++;
+ poFeature->SetField( FLD_ROUTE_FID, rteFID-1);
+ poFeature->SetField( FLD_ROUTE_PT_ID, rtePtId-1);
+ }
+ else if (gpxGeomType == GPX_TRACK_POINT)
+ {
+ trkSegPtId++;
- poFeature->SetField( FLD_TRACK_FID, trkFID-1);
- poFeature->SetField( FLD_TRACK_SEG_ID, trkSegId-1);
- poFeature->SetField( FLD_TRACK_PT_ID, trkSegPtId-1);
- }
+ poFeature->SetField( FLD_TRACK_FID, trkFID-1);
+ poFeature->SetField( FLD_TRACK_SEG_ID, trkSegId-1);
+ poFeature->SetField( FLD_TRACK_PT_ID, trkSegPtId-1);
}
}
else if (gpxGeomType == GPX_TRACK && strcmp(pszName, "trk") == 0)
@@ -616,12 +622,12 @@ void OGRGPXLayer::startElementCbk(const char *pszName, const char **ppszAttr)
hasFoundLon = false;
for (int i = 0; ppszAttr[i]; i += 2)
{
- if (strcmp(ppszAttr[i], "lat") == 0)
+ if (strcmp(ppszAttr[i], "lat") == 0 && ppszAttr[i + 1][0])
{
hasFoundLat = true;
latVal = CPLAtof(ppszAttr[i + 1]);
}
- else if (strcmp(ppszAttr[i], "lon") == 0)
+ else if (strcmp(ppszAttr[i], "lon") == 0 && ppszAttr[i + 1][0])
{
hasFoundLon = true;
lonVal = CPLAtof(ppszAttr[i + 1]);
@@ -632,6 +638,11 @@ void OGRGPXLayer::startElementCbk(const char *pszName, const char **ppszAttr)
{
lineString->addPoint(lonVal, latVal);
}
+ else
+ {
+ CPLDebug("GPX", "Skipping %s without lat and/or lon",
+ pszName);
+ }
}
}
else if (gpxGeomType == GPX_ROUTE && strcmp(pszName, "rtept") == 0 &&
@@ -643,12 +654,12 @@ void OGRGPXLayer::startElementCbk(const char *pszName, const char **ppszAttr)
hasFoundLon = false;
for (int i = 0; ppszAttr[i]; i += 2)
{
- if (strcmp(ppszAttr[i], "lat") == 0)
+ if (strcmp(ppszAttr[i], "lat") == 0 && ppszAttr[i + 1][0])
{
hasFoundLat = true;
latVal = CPLAtof(ppszAttr[i + 1]);
}
- else if (strcmp(ppszAttr[i], "lon") == 0)
+ else if (strcmp(ppszAttr[i], "lon") == 0 && ppszAttr[i + 1][0])
{
hasFoundLon = true;
lonVal = CPLAtof(ppszAttr[i + 1]);
@@ -659,6 +670,11 @@ void OGRGPXLayer::startElementCbk(const char *pszName, const char **ppszAttr)
{
lineString->addPoint(lonVal, latVal);
}
+ else
+ {
+ CPLDebug("GPX", "Skipping %s without lat and/or lon",
+ pszName);
+ }
}
}
else if (bEleAs25D &&
diff --git a/ogr/ogrsf_frmts/pgdump/ogrpgdumplayer.cpp b/ogr/ogrsf_frmts/pgdump/ogrpgdumplayer.cpp
index 25e96cb..001fbd3 100644
--- a/ogr/ogrsf_frmts/pgdump/ogrpgdumplayer.cpp
+++ b/ogr/ogrsf_frmts/pgdump/ogrpgdumplayer.cpp
@@ -31,7 +31,7 @@
#include "cpl_string.h"
#include "ogr_p.h"
-CPL_CVSID("$Id: ogrpgdumplayer.cpp 37371 2017-02-13 11:41:59Z rouault $");
+CPL_CVSID("$Id: ogrpgdumplayer.cpp 38135 2017-04-25 22:42:55Z rouault $");
static const int USE_COPY_UNSET = -1;
@@ -1436,8 +1436,16 @@ void OGRPGCommonLayerNormalizeDefault(OGRFieldDefn* poFieldDefn,
return;
CPLString osDefault(pszDefault);
size_t nPos = osDefault.find("::character varying");
- if( nPos != std::string::npos )
+ if( nPos != std::string::npos &&
+ nPos + strlen("::character varying") == osDefault.size() )
+ {
osDefault.resize(nPos);
+ }
+ else if( (nPos = osDefault.find("::text")) != std::string::npos &&
+ nPos + strlen("::text") == osDefault.size() )
+ {
+ osDefault.resize(nPos);
+ }
else if( strcmp(osDefault, "now()") == 0 )
osDefault = "CURRENT_TIMESTAMP";
else if( strcmp(osDefault, "('now'::text)::date") == 0 )
diff --git a/ogr/ogrsf_frmts/s57/s57featuredefns.cpp b/ogr/ogrsf_frmts/s57/s57featuredefns.cpp
index 82ea96c..f811a4b 100644
--- a/ogr/ogrsf_frmts/s57/s57featuredefns.cpp
+++ b/ogr/ogrsf_frmts/s57/s57featuredefns.cpp
@@ -32,7 +32,7 @@
#include "ogr_api.h"
#include "s57.h"
-CPL_CVSID("$Id: s57featuredefns.cpp 35911 2016-10-24 15:03:26Z goatbar $");
+CPL_CVSID("$Id: s57featuredefns.cpp 38140 2017-04-26 08:41:23Z rouault $");
/************************************************************************/
/* S57GenerateGeomFeatureDefn() */
@@ -267,6 +267,15 @@ S57GenerateVectorPrimitiveFeatureDefn( int nRCNM,
poFDefn->AddFieldDefn( &oField );
/* -------------------------------------------------------------------- */
+/* Geometric primitive attributes */
+/* -------------------------------------------------------------------- */
+ oField.Set( "POSACC", OFTReal, 10, 2 );
+ poFDefn->AddFieldDefn( &oField );
+
+ oField.Set( "QUAPOS", OFTInteger, 2, 0 );
+ poFDefn->AddFieldDefn( &oField );
+
+/* -------------------------------------------------------------------- */
/* For lines we want to capture the point links for the first */
/* and last nodes. */
/* -------------------------------------------------------------------- */
diff --git a/ogr/ogrsf_frmts/s57/s57reader.cpp b/ogr/ogrsf_frmts/s57/s57reader.cpp
index f2db12d..cb050bb 100644
--- a/ogr/ogrsf_frmts/s57/s57reader.cpp
+++ b/ogr/ogrsf_frmts/s57/s57reader.cpp
@@ -37,7 +37,7 @@
#include <algorithm>
#include <string>
-CPL_CVSID("$Id: s57reader.cpp 36948 2016-12-18 13:32:14Z rouault $");
+CPL_CVSID("$Id: s57reader.cpp 38138 2017-04-26 08:10:11Z rouault $");
/**
* Recode the given string from a source encoding to UTF-8 encoding. The source
@@ -1507,6 +1507,34 @@ OGRFeature *S57Reader::ReadVector( int nFeatureId, int nRCNM )
"MASK",iSubField) );
}
+/* -------------------------------------------------------------------- */
+/* Geometric attributes */
+/* Retrieve POSACC and QUAPOS attributes */
+/* -------------------------------------------------------------------- */
+
+ const int posaccField = poRegistrar->FindAttrByAcronym("POSACC");
+ const int quaposField = poRegistrar->FindAttrByAcronym("QUAPOS");
+
+ DDFField * poATTV = poRecord->FindField("ATTV");
+ if( poATTV != NULL )
+ {
+ for( int j = 0; j < poATTV->GetRepeatCount(); j++ )
+ {
+ const int subField = poRecord->GetIntSubfield("ATTV",0,"ATTL",j);
+ // POSACC field
+ if (subField == posaccField) {
+ poFeature->SetField( "POSACC",
+ poRecord->GetFloatSubfield("ATTV",0,"ATVL",j) );
+ }
+
+ // QUAPOS field
+ if (subField == quaposField) {
+ poFeature->SetField( "QUAPOS",
+ poRecord->GetIntSubfield("ATTV",0,"ATVL",j) );
+ }
+ }
+ }
+
return poFeature;
}
diff --git a/ogr/ogrsf_frmts/sqlite/ogrsqlitevirtualogr.cpp b/ogr/ogrsf_frmts/sqlite/ogrsqlitevirtualogr.cpp
index f5353cd..8f78f0e 100644
--- a/ogr/ogrsf_frmts/sqlite/ogrsqlitevirtualogr.cpp
+++ b/ogr/ogrsf_frmts/sqlite/ogrsqlitevirtualogr.cpp
@@ -940,7 +940,7 @@ int OGR2SQLITE_Filter(sqlite3_vtab_cursor* pCursor,
(ch = pszFieldName[j]) != '\0'; j++ )
{
if (!(isalnum((int)ch) || ch == '_'))
- bNeedsQuoting = FALSE;
+ bNeedsQuoting = TRUE;
}
if( bNeedsQuoting )
diff --git a/port/cpl_multiproc.cpp b/port/cpl_multiproc.cpp
index cc29f1f..a641043 100644
--- a/port/cpl_multiproc.cpp
+++ b/port/cpl_multiproc.cpp
@@ -55,7 +55,7 @@
#include "cpl_error.h"
#include "cpl_vsi.h"
-CPL_CVSID("$Id: cpl_multiproc.cpp 37003 2016-12-23 14:54:07Z goatbar $");
+CPL_CVSID("$Id: cpl_multiproc.cpp 38158 2017-04-27 17:51:26Z rouault $");
#if defined(CPL_MULTIPROC_STUB) && !defined(DEBUG)
# define MUTEX_NONE
@@ -444,7 +444,7 @@ const char *CPLGetThreadingModel()
/* CPLCreateMutex() */
/************************************************************************/
-#ifndef MUTEX_NONE
+#ifdef MUTEX_NONE
CPLMutex *CPLCreateMutex()
{
return (CPLMutex *) 0xdeadbeef;
@@ -465,7 +465,7 @@ CPLMutex *CPLCreateMutex()
}
#endif
-CPLMutex *CPLCreateMutexEx( int nOptions )
+CPLMutex *CPLCreateMutexEx( int /*nOptions*/ )
{
return CPLCreateMutex();
@@ -481,7 +481,7 @@ int CPLAcquireMutex( CPLMutex *hMutex, double /* dfWaitInSeconds */ )
return TRUE;
}
#else
-int CPLAcquireMutex( CPLMutex *hMutex, double dfWaitInSeconds )
+int CPLAcquireMutex( CPLMutex *hMutex, double /*dfWaitInSeconds*/ )
{
unsigned char *pabyMutex = reinterpret_cast<unsigned char *>(hMutex);
@@ -503,7 +503,7 @@ void CPLReleaseMutex( CPLMutex * /* hMutex */ ) {}
#else
void CPLReleaseMutex( CPLMutex *hMutex )
{
- unsigned char *pabyMutex = retinterpret_cast<unsigned char *>(hMutex);
+ unsigned char *pabyMutex = reinterpret_cast<unsigned char *>(hMutex);
CPLAssert( pabyMutex[1] == 'r' && pabyMutex[2] == 'e'
&& pabyMutex[3] == 'd' );
@@ -2150,11 +2150,11 @@ void CPLDestroySpinLock( CPLSpinLock* psSpin )
void *CPLGetTLS( int nIndex )
{
- void** papTLSList = CPLGetTLSList(NULL);
+ void** l_papTLSList = CPLGetTLSList(NULL);
CPLAssert( nIndex >= 0 && nIndex < CTLS_MAX );
- return papTLSList[nIndex];
+ return l_papTLSList[nIndex];
}
/************************************************************************/
@@ -2164,13 +2164,13 @@ void *CPLGetTLS( int nIndex )
void *CPLGetTLSEx( int nIndex, int* pbMemoryErrorOccurred )
{
- void** papTLSList = CPLGetTLSList(pbMemoryErrorOccurred);
- if( papTLSList == NULL )
+ void** l_papTLSList = CPLGetTLSList(pbMemoryErrorOccurred);
+ if( l_papTLSList == NULL )
return NULL;
CPLAssert( nIndex >= 0 && nIndex < CTLS_MAX );
- return papTLSList[nIndex];
+ return l_papTLSList[nIndex];
}
/************************************************************************/
@@ -2192,12 +2192,12 @@ void CPLSetTLS( int nIndex, void *pData, int bFreeOnExit )
void CPLSetTLSWithFreeFunc( int nIndex, void *pData, CPLTLSFreeFunc pfnFree )
{
- void **papTLSList = CPLGetTLSList(NULL);
+ void **l_papTLSList = CPLGetTLSList(NULL);
CPLAssert( nIndex >= 0 && nIndex < CTLS_MAX );
- papTLSList[nIndex] = pData;
- papTLSList[CTLS_MAX + nIndex] = (void*) pfnFree;
+ l_papTLSList[nIndex] = pData;
+ l_papTLSList[CTLS_MAX + nIndex] = (void*) pfnFree;
}
/************************************************************************/
@@ -2211,12 +2211,12 @@ void CPLSetTLSWithFreeFuncEx( int nIndex, void *pData,
int* pbMemoryErrorOccurred )
{
- void **papTLSList = CPLGetTLSList(pbMemoryErrorOccurred);
+ void **l_papTLSList = CPLGetTLSList(pbMemoryErrorOccurred);
CPLAssert( nIndex >= 0 && nIndex < CTLS_MAX );
- papTLSList[nIndex] = pData;
- papTLSList[CTLS_MAX + nIndex] = (void*) pfnFree;
+ l_papTLSList[nIndex] = pData;
+ l_papTLSList[CTLS_MAX + nIndex] = (void*) pfnFree;
}
#ifndef HAVE_SPINLOCK_IMPL
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/gdal.git
More information about the Pkg-grass-devel
mailing list