[gdal] 03/06: Imported Upstream version 2.1.0~rc4+dfsg
Sebastiaan Couwenberg
sebastic at moszumanska.debian.org
Fri Apr 29 10:45:51 UTC 2016
This is an automated email from the git hooks/post-receive script.
sebastic pushed a commit to branch experimental-2.1
in repository gdal.
commit 7882fbfda5571c56007e6a93eb1aeaf7cc485464
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date: Fri Apr 29 11:03:46 2016 +0200
Imported Upstream version 2.1.0~rc4+dfsg
---
NEWS | 10 +++
alg/gdal_rpc.cpp | 44 ++++++++++-
frmts/ecw/gdal_ecw.h | 30 ++++++-
gcore/gdal_version.h | 2 +-
gcore/gdaldataset.cpp | 13 +++-
man/man1/_home_rouault_dist_wrk_gdal_apps_.1 | 2 +-
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/ogrtindex.1 | 2 +-
man/man1/pct2rgb.1 | 2 +-
man/man1/rgb2pct.1 | 2 +-
ogr/ogrfeaturequery.cpp | 6 +-
ogr/ogrsf_frmts/generic/ogr_gensql.cpp | 20 ++---
ogr/ogrsf_frmts/kml/kml.cpp | 20 ++++-
ogr/ogrsf_frmts/kml/kml.h | 4 +-
ogr/ogrsf_frmts/kml/kmlnode.cpp | 3 +-
ogr/ogrsf_frmts/openfilegdb/filegdbtable.cpp | 6 +-
ogr/ogrsf_frmts/osm/ogr_osm.h | 9 ++-
ogr/ogrsf_frmts/osm/ogrosmdatasource.cpp | 103 ++++++++++++++++---------
ogr/ogrsf_frmts/shape/ogrshapedatasource.cpp | 6 +-
ogr/ogrsf_frmts/shape/ogrshapelayer.cpp | 6 +-
ogr/ogrsf_frmts/sqlite/ogrsqliteexecutesql.cpp | 12 ++-
ogr/ogrsf_frmts/vrt/ogrvrtlayer.cpp | 12 ++-
ogr/swq_op_general.cpp | 11 +++
port/cpl_error.cpp | 6 +-
59 files changed, 279 insertions(+), 124 deletions(-)
diff --git a/NEWS b/NEWS
index 50de67f..b07ca8e 100644
--- a/NEWS
+++ b/NEWS
@@ -189,6 +189,7 @@ Algorithms:
* RPC DEM: take into account vertical datum of the DEM when present to convert DEM elevations to ellipsoidal heights (#6084)
* RPC DEM: do fallback cubic -> bilinear and bilinear -> near on DEM edges
* RPC DEM: improve inverse transformer to validate error threshold and improve convergence (#6162, #6377)
+ * RPC: fix issues with dateline (#6472)
* TPS solver: discard duplicated GCP to avoid avoidable error, warning when 2 GCPs have same (pixel,line) but different (X,Y) or the reverse
* Warper: rework multithreaded computations to use a thread pool rather than forking threads each time
* Warper: avoid really excessive processing time for some warping with target areas completely off the source raster (especially when involving RPC) (#6182)
@@ -258,6 +259,7 @@ ECRG driver:
ECW driver:
* use wide char Open API on Windows when GDAL_FILENAME_IS_UTF8=YES (https://github.com/OSGeo/gdal/pull/70)
+ * fix reading of ECW in /vsi file systems (with SDK >= 4) (#6482)
GeoRaster driver:
* fix deflate read error depending on endianness (#6252)
@@ -474,6 +476,8 @@ Core:
* OGRFeature::SetGeometry()/SetGeometryDirectly(): make it work when passed geometry is the currently installed geometry (#6312)
* OGR SQL: do not silently skip NULL values in the first records when evaluating a SELECT DISTINCT (#6020)
* OGR SQL: correctly sort NULL values in first positions (#6155)
+ * OGR SQL: fix CAST(x AS bigint) to return an evaluated int64 node, and not int32 (#6479)
+ * OGR SQL: handle 'fid' as Integer64 in where clause, and allow CAST(fid AS bigint) in selected columns (#6484)
* Add OGRUpdateFieldType()
* Decorate a few functions/methods of the OGR layer API with CPL_WARN_UNUSED_RESULT
* WKT export: use 15 significant figures, instead of 15 figures after decimal point (#6145)
@@ -598,6 +602,7 @@ JML driver:
* remove arbitrary limitation preventing from reading geometries with <gml:coordinates> larger than 10 MB (#6338)
KML driver:
+ * fix crash on KML files without content but with nested folders (#6486)
LIBKML driver:
* for documents without folder, use document name when available as name of layer (#6409)
@@ -630,10 +635,12 @@ OpenFileGDB driver:
* do not emit warning if SDC/CDF table detected and that FileGDB driver is present
* fix min/max on columns without indices (#6150)
* build correct geometry for a multi-part wkbMultiLineStringZ (#6332)
+ * add support for reading SHPT_GENERALPOINT (#6478)
OSM driver:
* correct fields ids for the (non frequently used) Node message
* do not override 'our' osm_id (the node, way or relation id) with a tag named 'osm_id' (#6347)
+ * properly deal with polygons in other_relations geometrycollection (#6475)
PG driver:
* Add PRELUDE_STATEMENTS and CLOSING_STATEMENTS open option to be for example able to specify options, like statement_timeout, with pg_bouncer
@@ -659,6 +666,7 @@ Shapefile driver:
* accept opening standalone .dbf files whose header length is not a multiple of 32 bytes (#6035)
* fix REPACK crash on shapefile without .dbf (#6274)
* add capability to restore/build a missing .shx file when defining SHAPE_RESTORE_SHX to TRUE (#5035)
+ * avoid CreateLayer() to error out when passed wkbUnknown | wkb25D (#6473)
SQLite/Spatialite driver:
* support file:xxx URI syntax (derived from patch by joker99, #6150)
@@ -1577,6 +1585,7 @@ SQLite/Spatialite driver:
* make GetFIDColumn() work when run as first method call (#5781)
* emit warning when reading text values in a integer/real field (possible since SQLite has no strong typing)
* support reading date/datetime from Julian day floating point representation
+ * SQLite dialect: fix insertion in geometry_columns of table names that are not in upper-case (#6483)
SUA driver:
* tweak detection logic to read beyond first 10KB bytes when needed (#5975)
@@ -1602,6 +1611,7 @@ VRT driver:
* do not propagate ignoring of x and y cols of a PointFromColumns to the source layer (#5777)
* add an optional 'name' attribute on FID element, so as to be able to force the report of a FID column name even if it is not exposed as a regular field (related to #5845)
* handle optional <OpenOptions><OOI key='key'>value</OOI></OpenOptions> to specify open options
+ * do not enable passthrough filtering if redefining <FID> (#6480)
Tiger driver:
* Fix potential buffer underflow when providing /vsistdin/ to Tiger driver (#5567)
diff --git a/alg/gdal_rpc.cpp b/alg/gdal_rpc.cpp
index 7c24a0b..43f00aa 100644
--- a/alg/gdal_rpc.cpp
+++ b/alg/gdal_rpc.cpp
@@ -1,5 +1,5 @@
/******************************************************************************
- * $Id: gdal_rpc.cpp 33846 2016-04-01 14:53:13Z rouault $
+ * $Id: gdal_rpc.cpp 34067 2016-04-23 17:56:51Z rouault $
*
* Project: Image Warper
* Purpose: Implements a rational polynomial (RPC) based transformer.
@@ -39,7 +39,7 @@
#include "gdalsse_priv.h"
#endif
-CPL_CVSID("$Id: gdal_rpc.cpp 33846 2016-04-01 14:53:13Z rouault $");
+CPL_CVSID("$Id: gdal_rpc.cpp 34067 2016-04-23 17:56:51Z rouault $");
CPL_C_START
CPLXMLNode *GDALSerializeRPCTransformer( void *pTransformArg );
@@ -310,8 +310,19 @@ static void RPCTransformPoint( const GDALRPCTransformInfo *psRPCTransformInfo,
// Make sure padfTerms is aligned on a 16-byte boundary for SSE2 aligned loads
double* padfTerms = adfTermsWithMargin + (((size_t)adfTermsWithMargin) % 16) / 8;
+ // Avoid dateline issues
+ double diffLong = dfLong - psRPCTransformInfo->sRPC.dfLONG_OFF;
+ if( diffLong < -270 )
+ {
+ diffLong += 360;
+ }
+ else if( diffLong > 270 )
+ {
+ diffLong -= 360;
+ }
+
const double dfNormalizedLong =
- (dfLong - psRPCTransformInfo->sRPC.dfLONG_OFF) / psRPCTransformInfo->sRPC.dfLONG_SCALE;
+ diffLong / psRPCTransformInfo->sRPC.dfLONG_SCALE;
const double dfNormalizedLat =
(dfLat - psRPCTransformInfo->sRPC.dfLAT_OFF) / psRPCTransformInfo->sRPC.dfLAT_SCALE;
const double dfNormalizedHeight =
@@ -481,6 +492,8 @@ static bool GDALRPCGetHeightAtLongLat( const GDALRPCTransformInfo *psTransform,
dfVDatumShift = -dfZ;
}
+ bool bRetried = false;
+retry:
GDALApplyGeoTransform( (double*)(psTransform->adfDEMReverseGeoTransform),
dfXTemp, dfYTemp, &dfX, &dfY );
if( pdfDEMPixel )
@@ -490,6 +503,31 @@ static bool GDALRPCGetHeightAtLongLat( const GDALRPCTransformInfo *psTransform,
if( !GDALRPCGetDEMHeight( psTransform, dfX, dfY, &dfDEMH) )
{
+ // Try to handle the case where the DEM is in LL WGS84 and spans over [-180,180],
+ // (or very close to it ), presumably with much hole in the middle if using VRT,
+ // and the longitude goes beyond that interval
+ if( !bRetried && psTransform->poCT == NULL && (dfXIn >= 180 || dfXIn <= -180) )
+ {
+ int nRasterXSize = psTransform->poDS->GetRasterXSize();
+ double dfMinDEMLong = psTransform->adfDEMGeoTransform[0];
+ double dfMaxDEMLong = psTransform->adfDEMGeoTransform[0] + nRasterXSize * psTransform->adfDEMGeoTransform[1];
+ if( fabs( dfMinDEMLong - -180 ) < 0.1 && fabs( dfMaxDEMLong - 180 ) < 0.1 )
+ {
+ if( dfXIn >= 180 )
+ {
+ dfXTemp = dfXIn - 360;
+ dfYTemp = dfYIn;
+ }
+ else
+ {
+ dfXTemp = dfXIn + 360;
+ dfYTemp = dfYIn;
+ }
+ bRetried = true;
+ goto retry;
+ }
+ }
+
if( psTransform->bHasDEMMissingValue )
dfDEMH = psTransform->dfDEMMissingValue;
else
diff --git a/frmts/ecw/gdal_ecw.h b/frmts/ecw/gdal_ecw.h
index 697a94c..103faf9 100644
--- a/frmts/ecw/gdal_ecw.h
+++ b/frmts/ecw/gdal_ecw.h
@@ -170,7 +170,7 @@ class VSIIOStream : public CNCSJPCIOStream
#if ECWSDK_VERSION >= 40
virtual VSIIOStream *Clone() {
-
+ CPLDebug( "ECW", "VSIIOStream::Clone()" );
VSILFILE *fpNewVSIL = VSIFOpenL( m_Filename, "rb" );
if (fpNewVSIL == NULL)
{
@@ -234,6 +234,10 @@ class VSIIOStream : public CNCSJPCIOStream
}
virtual bool NCS_FASTCALL Seek(INT64 offset, Origin origin = CURRENT) {
+#ifdef DEBUG_VERBOSE
+ CPLDebug( "ECW", "VSIIOStream::Seek(" CPL_FRMT_GIB ",%d)",
+ static_cast<GIntBig>(offset), (int) origin );
+#endif
bool success = false;
switch(origin) {
case START:
@@ -268,12 +272,34 @@ class VSIIOStream : public CNCSJPCIOStream
Seek( 0, END );
size = Tell();
Seek( curPos, START );
-
+#ifdef DEBUG_VERBOSE
+ CPLDebug( "ECW", "VSIIOStream::Size()=" CPL_FRMT_GIB, static_cast<GIntBig>(size) );
+#endif
return size;
}
}
+#if ECWSDK_VERSION >= 40
+ /* New, and needed, in ECW SDK 4 */
+ virtual bool Read(INT64 offset, void* buffer, UINT32 count)
+ {
+#ifdef DEBUG_VERBOSE
+ CPLDebug( "ECW", "VSIIOStream::Read(" CPL_FRMT_GIB ",%u)", static_cast<GIntBig>(offset), count );
+#endif
+ /* SDK 4.3 doc says it is not supposed to update the file pointer. */
+ /* Later versions have no comment... */
+ INT64 curPos = Tell();
+ Seek( offset, START );
+ bool ret = Read(buffer, count);
+ Seek( curPos, START );
+ return ret;
+ }
+#endif
+
virtual bool NCS_FASTCALL Read(void* buffer, UINT32 count) {
+#ifdef DEBUG_VERBOSE
+ CPLDebug( "ECW", "VSIIOStream::Read(%u)", count );
+#endif
if( count == 0 )
return true;
diff --git a/gcore/gdal_version.h b/gcore/gdal_version.h
index c9e6e14..83a38e7 100644
--- a/gcore/gdal_version.h
+++ b/gcore/gdal_version.h
@@ -22,7 +22,7 @@
#endif
#ifndef GDAL_RELEASE_DATE
-# define GDAL_RELEASE_DATE 20160422
+# define GDAL_RELEASE_DATE 20160425
#endif
#ifndef GDAL_RELEASE_NAME
# define GDAL_RELEASE_NAME "2.1.0"
diff --git a/gcore/gdaldataset.cpp b/gcore/gdaldataset.cpp
index cf1cf3d..2dc9275 100644
--- a/gcore/gdaldataset.cpp
+++ b/gcore/gdaldataset.cpp
@@ -1,5 +1,5 @@
/******************************************************************************
- * $Id: gdaldataset.cpp 33808 2016-03-29 21:15:28Z goatbar $
+ * $Id: gdaldataset.cpp 34092 2016-04-25 09:09:46Z rouault $
*
* Project: GDAL Core
* Purpose: Base class for raster file formats.
@@ -47,7 +47,7 @@
#include <map>
-CPL_CVSID("$Id: gdaldataset.cpp 33808 2016-03-29 21:15:28Z goatbar $");
+CPL_CVSID("$Id: gdaldataset.cpp 34092 2016-04-25 09:09:46Z rouault $");
CPL_C_START
GDALAsyncReader *
@@ -5534,6 +5534,7 @@ GDALSQLParseInfo* GDALDataset::BuildParseInfo(swq_select* psSelectInfo,
psParseInfo->sFieldList.ids = (int *)
CPLMalloc( sizeof(int) * (nFieldCount+SPECIAL_FIELD_COUNT) );
+ bool bIsFID64 = false;
for( iTable = 0; iTable < psSelectInfo->table_count; iTable++ )
{
swq_table_def *psTableDef = psSelectInfo->table_defs + iTable;
@@ -5609,6 +5610,12 @@ GDALSQLParseInfo* GDALDataset::BuildParseInfo(swq_select* psSelectInfo,
GEOM_FIELD_INDEX_TO_ALL_FIELD_INDEX(poSrcLayer->GetLayerDefn(), iField);
}
}
+
+ if( iTable == 0 && poSrcLayer->GetMetadataItem(OLMD_FID64) != NULL &&
+ EQUAL(poSrcLayer->GetMetadataItem(OLMD_FID64), "YES") )
+ {
+ bIsFID64 = true;
+ }
}
/* -------------------------------------------------------------------- */
@@ -5626,7 +5633,7 @@ GDALSQLParseInfo* GDALDataset::BuildParseInfo(swq_select* psSelectInfo,
for (iField = 0; iField < SPECIAL_FIELD_COUNT; iField++)
{
psParseInfo->sFieldList.names[psParseInfo->sFieldList.count] = (char*) SpecialFieldNames[iField];
- psParseInfo->sFieldList.types[psParseInfo->sFieldList.count] = SpecialFieldTypes[iField];
+ psParseInfo->sFieldList.types[psParseInfo->sFieldList.count] = (iField == SPF_FID && bIsFID64) ? SWQ_INTEGER64: SpecialFieldTypes[iField];
psParseInfo->sFieldList.table_ids[psParseInfo->sFieldList.count] = 0;
psParseInfo->sFieldList.ids[psParseInfo->sFieldList.count] = nFIDIndex + iField;
psParseInfo->sFieldList.count++;
diff --git a/man/man1/_home_rouault_dist_wrk_gdal_apps_.1 b/man/man1/_home_rouault_dist_wrk_gdal_apps_.1
index b41a99d..d0b7f83 100644
--- a/man/man1/_home_rouault_dist_wrk_gdal_apps_.1
+++ b/man/man1/_home_rouault_dist_wrk_gdal_apps_.1
@@ -1,4 +1,4 @@
-.TH "apps Directory Reference" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "apps Directory Reference" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal-config.1 b/man/man1/gdal-config.1
index 2c2ef53..e3df1f4 100644
--- a/man/man1/gdal-config.1
+++ b/man/man1/gdal-config.1
@@ -1,4 +1,4 @@
-.TH "gdal-config" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdal-config" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal2tiles.1 b/man/man1/gdal2tiles.1
index 29cd475..02b306a 100644
--- a/man/man1/gdal2tiles.1
+++ b/man/man1/gdal2tiles.1
@@ -1,4 +1,4 @@
-.TH "gdal2tiles" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdal2tiles" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_calc.1 b/man/man1/gdal_calc.1
index a845af2..8038dc9 100644
--- a/man/man1/gdal_calc.1
+++ b/man/man1/gdal_calc.1
@@ -1,4 +1,4 @@
-.TH "gdal_calc" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdal_calc" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_contour.1 b/man/man1/gdal_contour.1
index 18d81e1..3a30877 100644
--- a/man/man1/gdal_contour.1
+++ b/man/man1/gdal_contour.1
@@ -1,4 +1,4 @@
-.TH "gdal_contour" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdal_contour" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_edit.1 b/man/man1/gdal_edit.1
index cb6ae42..f3e6acb 100644
--- a/man/man1/gdal_edit.1
+++ b/man/man1/gdal_edit.1
@@ -1,4 +1,4 @@
-.TH "gdal_edit" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdal_edit" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_fillnodata.1 b/man/man1/gdal_fillnodata.1
index 3fd9863..0f637e7 100644
--- a/man/man1/gdal_fillnodata.1
+++ b/man/man1/gdal_fillnodata.1
@@ -1,4 +1,4 @@
-.TH "gdal_fillnodata" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdal_fillnodata" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_grid.1 b/man/man1/gdal_grid.1
index d066e0c..4d850cc 100644
--- a/man/man1/gdal_grid.1
+++ b/man/man1/gdal_grid.1
@@ -1,4 +1,4 @@
-.TH "gdal_grid" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdal_grid" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_merge.1 b/man/man1/gdal_merge.1
index dd1ce35..a7725eb 100644
--- a/man/man1/gdal_merge.1
+++ b/man/man1/gdal_merge.1
@@ -1,4 +1,4 @@
-.TH "gdal_merge" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdal_merge" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_pansharpen.1 b/man/man1/gdal_pansharpen.1
index 54517d3..652c234 100644
--- a/man/man1/gdal_pansharpen.1
+++ b/man/man1/gdal_pansharpen.1
@@ -1,4 +1,4 @@
-.TH "gdal_pansharpen" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdal_pansharpen" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_polygonize.1 b/man/man1/gdal_polygonize.1
index c6243df..4646b5d 100644
--- a/man/man1/gdal_polygonize.1
+++ b/man/man1/gdal_polygonize.1
@@ -1,4 +1,4 @@
-.TH "gdal_polygonize" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdal_polygonize" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_proximity.1 b/man/man1/gdal_proximity.1
index 5442589..f368833 100644
--- a/man/man1/gdal_proximity.1
+++ b/man/man1/gdal_proximity.1
@@ -1,4 +1,4 @@
-.TH "gdal_proximity" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdal_proximity" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_rasterize.1 b/man/man1/gdal_rasterize.1
index 89e575c..86a47a0 100644
--- a/man/man1/gdal_rasterize.1
+++ b/man/man1/gdal_rasterize.1
@@ -1,4 +1,4 @@
-.TH "gdal_rasterize" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdal_rasterize" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_retile.1 b/man/man1/gdal_retile.1
index d28f619..3551991 100644
--- a/man/man1/gdal_retile.1
+++ b/man/man1/gdal_retile.1
@@ -1,4 +1,4 @@
-.TH "gdal_retile" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdal_retile" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_sieve.1 b/man/man1/gdal_sieve.1
index 18e1b13..ebc4b9c 100644
--- a/man/man1/gdal_sieve.1
+++ b/man/man1/gdal_sieve.1
@@ -1,4 +1,4 @@
-.TH "gdal_sieve" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdal_sieve" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_translate.1 b/man/man1/gdal_translate.1
index 03107fb..e89caef 100644
--- a/man/man1/gdal_translate.1
+++ b/man/man1/gdal_translate.1
@@ -1,4 +1,4 @@
-.TH "gdal_translate" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdal_translate" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdal_utilities.1 b/man/man1/gdal_utilities.1
index c95c96d..d7242c3 100644
--- a/man/man1/gdal_utilities.1
+++ b/man/man1/gdal_utilities.1
@@ -1,4 +1,4 @@
-.TH "gdal_utilities" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdal_utilities" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdaladdo.1 b/man/man1/gdaladdo.1
index b9d39be..9f504ab 100644
--- a/man/man1/gdaladdo.1
+++ b/man/man1/gdaladdo.1
@@ -1,4 +1,4 @@
-.TH "gdaladdo" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdaladdo" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdalbuildvrt.1 b/man/man1/gdalbuildvrt.1
index cdf664a..d215644 100644
--- a/man/man1/gdalbuildvrt.1
+++ b/man/man1/gdalbuildvrt.1
@@ -1,4 +1,4 @@
-.TH "gdalbuildvrt" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdalbuildvrt" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdalcompare.1 b/man/man1/gdalcompare.1
index d90183c..61b5fb4 100644
--- a/man/man1/gdalcompare.1
+++ b/man/man1/gdalcompare.1
@@ -1,4 +1,4 @@
-.TH "gdalcompare" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdalcompare" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdaldem.1 b/man/man1/gdaldem.1
index 6792f62..ab9c927 100644
--- a/man/man1/gdaldem.1
+++ b/man/man1/gdaldem.1
@@ -1,4 +1,4 @@
-.TH "gdaldem" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdaldem" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdalinfo.1 b/man/man1/gdalinfo.1
index f073a45..a6c0979 100644
--- a/man/man1/gdalinfo.1
+++ b/man/man1/gdalinfo.1
@@ -1,4 +1,4 @@
-.TH "gdalinfo" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdalinfo" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdallocationinfo.1 b/man/man1/gdallocationinfo.1
index 2717926..48a5a8c 100644
--- a/man/man1/gdallocationinfo.1
+++ b/man/man1/gdallocationinfo.1
@@ -1,4 +1,4 @@
-.TH "gdallocationinfo" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdallocationinfo" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdalmanage.1 b/man/man1/gdalmanage.1
index db2b0f3..0d794d8 100644
--- a/man/man1/gdalmanage.1
+++ b/man/man1/gdalmanage.1
@@ -1,4 +1,4 @@
-.TH "gdalmanage" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdalmanage" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdalmove.1 b/man/man1/gdalmove.1
index 277e63f..a92c305 100644
--- a/man/man1/gdalmove.1
+++ b/man/man1/gdalmove.1
@@ -1,4 +1,4 @@
-.TH "gdalmove" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdalmove" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdalsrsinfo.1 b/man/man1/gdalsrsinfo.1
index d26e899..6dbc36c 100644
--- a/man/man1/gdalsrsinfo.1
+++ b/man/man1/gdalsrsinfo.1
@@ -1,4 +1,4 @@
-.TH "gdalsrsinfo" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdalsrsinfo" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdaltindex.1 b/man/man1/gdaltindex.1
index 06df3d6..fa1ed91 100644
--- a/man/man1/gdaltindex.1
+++ b/man/man1/gdaltindex.1
@@ -1,4 +1,4 @@
-.TH "gdaltindex" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdaltindex" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdaltransform.1 b/man/man1/gdaltransform.1
index 1ea7f04..0d1f207 100644
--- a/man/man1/gdaltransform.1
+++ b/man/man1/gdaltransform.1
@@ -1,4 +1,4 @@
-.TH "gdaltransform" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdaltransform" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gdalwarp.1 b/man/man1/gdalwarp.1
index d043c3f..6a3cf91 100644
--- a/man/man1/gdalwarp.1
+++ b/man/man1/gdalwarp.1
@@ -1,4 +1,4 @@
-.TH "gdalwarp" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gdalwarp" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gnm_utilities.1 b/man/man1/gnm_utilities.1
index 0baf4db..e4e0dbd 100644
--- a/man/man1/gnm_utilities.1
+++ b/man/man1/gnm_utilities.1
@@ -1,4 +1,4 @@
-.TH "gnm_utilities" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gnm_utilities" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gnmanalyse.1 b/man/man1/gnmanalyse.1
index 39becec..57c58ae 100644
--- a/man/man1/gnmanalyse.1
+++ b/man/man1/gnmanalyse.1
@@ -1,4 +1,4 @@
-.TH "gnmanalyse" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gnmanalyse" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/gnmmanage.1 b/man/man1/gnmmanage.1
index faa3b65..6907dee 100644
--- a/man/man1/gnmmanage.1
+++ b/man/man1/gnmmanage.1
@@ -1,4 +1,4 @@
-.TH "gnmmanage" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "gnmmanage" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/nearblack.1 b/man/man1/nearblack.1
index 0ab9b00..5f9d31a 100644
--- a/man/man1/nearblack.1
+++ b/man/man1/nearblack.1
@@ -1,4 +1,4 @@
-.TH "nearblack" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "nearblack" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/ogr2ogr.1 b/man/man1/ogr2ogr.1
index be85c0f..aa9d08f 100644
--- a/man/man1/ogr2ogr.1
+++ b/man/man1/ogr2ogr.1
@@ -1,4 +1,4 @@
-.TH "ogr2ogr" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "ogr2ogr" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/ogr_utilities.1 b/man/man1/ogr_utilities.1
index 81f6c78..006b050 100644
--- a/man/man1/ogr_utilities.1
+++ b/man/man1/ogr_utilities.1
@@ -1,4 +1,4 @@
-.TH "ogr_utilities" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "ogr_utilities" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/ogrinfo.1 b/man/man1/ogrinfo.1
index d570e33..0db692d 100644
--- a/man/man1/ogrinfo.1
+++ b/man/man1/ogrinfo.1
@@ -1,4 +1,4 @@
-.TH "ogrinfo" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "ogrinfo" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/ogrlineref.1 b/man/man1/ogrlineref.1
index 1412f62..4aeefd3 100644
--- a/man/man1/ogrlineref.1
+++ b/man/man1/ogrlineref.1
@@ -1,4 +1,4 @@
-.TH "ogrlineref" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "ogrlineref" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/ogrtindex.1 b/man/man1/ogrtindex.1
index 273ffa2..67ea0e1 100644
--- a/man/man1/ogrtindex.1
+++ b/man/man1/ogrtindex.1
@@ -1,4 +1,4 @@
-.TH "ogrtindex" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "ogrtindex" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/pct2rgb.1 b/man/man1/pct2rgb.1
index 3ba10e3..07eb042 100644
--- a/man/man1/pct2rgb.1
+++ b/man/man1/pct2rgb.1
@@ -1,4 +1,4 @@
-.TH "pct2rgb" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "pct2rgb" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/man/man1/rgb2pct.1 b/man/man1/rgb2pct.1
index ce78a69..ea15c35 100644
--- a/man/man1/rgb2pct.1
+++ b/man/man1/rgb2pct.1
@@ -1,4 +1,4 @@
-.TH "rgb2pct" 1 "Fri Apr 22 2016" "GDAL" \" -*- nroff -*-
+.TH "rgb2pct" 1 "Mon Apr 25 2016" "GDAL" \" -*- nroff -*-
.ad l
.nh
.SH NAME
diff --git a/ogr/ogrfeaturequery.cpp b/ogr/ogrfeaturequery.cpp
index d90fe85..7f0997a 100644
--- a/ogr/ogrfeaturequery.cpp
+++ b/ogr/ogrfeaturequery.cpp
@@ -1,5 +1,5 @@
/******************************************************************************
- * $Id: ogrfeaturequery.cpp 33631 2016-03-04 06:28:09Z goatbar $
+ * $Id: ogrfeaturequery.cpp 34092 2016-04-25 09:09:46Z rouault $
*
* Project: OpenGIS Simple Features Reference Implementation
* Purpose: Implementation of simple SQL WHERE style attributes queries
@@ -35,7 +35,7 @@
#include "ogr_p.h"
#include "ogr_attrind.h"
-CPL_CVSID("$Id: ogrfeaturequery.cpp 33631 2016-03-04 06:28:09Z goatbar $");
+CPL_CVSID("$Id: ogrfeaturequery.cpp 34092 2016-04-25 09:09:46Z rouault $");
/************************************************************************/
/* Support for special attributes (feature query and selection) */
@@ -150,7 +150,7 @@ OGRErr OGRFeatureQuery::Compile( OGRFeatureDefn *poDefn,
while (iField < SPECIAL_FIELD_COUNT)
{
papszFieldNames[poDefn->GetFieldCount() + iField] = (char *) SpecialFieldNames[iField];
- paeFieldTypes[poDefn->GetFieldCount() + iField] = SpecialFieldTypes[iField];
+ paeFieldTypes[poDefn->GetFieldCount() + iField] = (iField == SPF_FID) ? SWQ_INTEGER64 : SpecialFieldTypes[iField];
++iField;
}
diff --git a/ogr/ogrsf_frmts/generic/ogr_gensql.cpp b/ogr/ogrsf_frmts/generic/ogr_gensql.cpp
index a97e333..0fc9f14 100644
--- a/ogr/ogrsf_frmts/generic/ogr_gensql.cpp
+++ b/ogr/ogrsf_frmts/generic/ogr_gensql.cpp
@@ -1,5 +1,5 @@
/******************************************************************************
- * $Id: ogr_gensql.cpp 33714 2016-03-13 05:42:13Z goatbar $
+ * $Id: ogr_gensql.cpp 34092 2016-04-25 09:09:46Z rouault $
*
* Project: OpenGIS Simple Features Reference Implementation
* Purpose: Implements OGRGenSQLResultsLayer.
@@ -36,7 +36,7 @@
#include "cpl_time.h"
#include <vector>
-CPL_CVSID("$Id: ogr_gensql.cpp 33714 2016-03-13 05:42:13Z goatbar $");
+CPL_CVSID("$Id: ogr_gensql.cpp 34092 2016-04-25 09:09:46Z rouault $");
class OGRGenSQLGeomFieldDefn: public OGRGeomFieldDefn
@@ -304,6 +304,12 @@ OGRGenSQLResultsLayer::OGRGenSQLResultsLayer( GDALDataset *poSrcDSIn,
oFDefn.SetType( OFTString );
break;
}
+ if( psColDef->field_index-iFIDFieldIndex == SPF_FID &&
+ poSrcLayer->GetMetadataItem(OLMD_FID64) != NULL &&
+ EQUAL(poSrcLayer->GetMetadataItem(OLMD_FID64), "YES") )
+ {
+ oFDefn.SetType( OFTInteger64 );
+ }
}
else
{
@@ -1448,8 +1454,6 @@ OGRFeature *OGRGenSQLResultsLayer::TranslateFeature( OGRFeature *poSrcFeat )
switch (SpecialFieldTypes[psColDef->field_index - iFIDFieldIndex])
{
case SWQ_INTEGER:
- poDstFeat->SetField( iRegularField, poSrcFeat->GetFieldAsInteger(psColDef->field_index) );
- break;
case SWQ_INTEGER64:
poDstFeat->SetField( iRegularField, poSrcFeat->GetFieldAsInteger64(psColDef->field_index) );
break;
@@ -1816,9 +1820,6 @@ void OGRGenSQLResultsLayer::CreateOrderByIndex()
switch (SpecialFieldTypes[psKeyDef->field_index - iFIDFieldIndex])
{
case SWQ_INTEGER:
- psDstField->Integer = poSrcFeat->GetFieldAsInteger(psKeyDef->field_index);
- break;
-
case SWQ_INTEGER64:
psDstField->Integer64 = poSrcFeat->GetFieldAsInteger64(psKeyDef->field_index);
break;
@@ -2074,11 +2075,6 @@ int OGRGenSQLResultsLayer::Compare( OGRField *pasFirstTuple,
switch (SpecialFieldTypes[psKeyDef->field_index - iFIDFieldIndex])
{
case SWQ_INTEGER:
- if( pasFirstTuple[iKey].Integer < pasSecondTuple[iKey].Integer )
- nResult = -1;
- else if( pasFirstTuple[iKey].Integer > pasSecondTuple[iKey].Integer )
- nResult = 1;
- break;
case SWQ_INTEGER64:
if( pasFirstTuple[iKey].Integer64 < pasSecondTuple[iKey].Integer64 )
nResult = -1;
diff --git a/ogr/ogrsf_frmts/kml/kml.cpp b/ogr/ogrsf_frmts/kml/kml.cpp
index 7226a8b..fa46070 100644
--- a/ogr/ogrsf_frmts/kml/kml.cpp
+++ b/ogr/ogrsf_frmts/kml/kml.cpp
@@ -1,5 +1,5 @@
/******************************************************************************
- * $Id: kml.cpp 33713 2016-03-12 17:41:57Z goatbar $
+ * $Id: kml.cpp 34104 2016-04-25 17:17:20Z rouault $
*
* Project: KML Driver
* Purpose: Class for reading, parsing and handling a kmlfile.
@@ -622,3 +622,21 @@ Feature* KML::getFeature(std::size_t nNum, int& nLastAsked, int &nLastCount)
return poCurrent_->getFeature(nNum, nLastAsked, nLastCount);
}
+
+void KML::unregisterLayerIfMatchingThisNode(KMLNode* poNode)
+{
+ for(int i=0;i<nNumLayers_;)
+ {
+ if( papoLayers_[i] == poNode )
+ {
+ if( i < nNumLayers_ - 1 )
+ {
+ memcpy( papoLayers_ + i, papoLayers_ + i + 1,
+ (nNumLayers_ - 1 - i) * sizeof(KMLNode*) );
+ }
+ nNumLayers_ --;
+ continue;
+ }
+ i++;
+ }
+}
diff --git a/ogr/ogrsf_frmts/kml/kml.h b/ogr/ogrsf_frmts/kml/kml.h
index ec4ec42..7bcebbf 100644
--- a/ogr/ogrsf_frmts/kml/kml.h
+++ b/ogr/ogrsf_frmts/kml/kml.h
@@ -1,5 +1,5 @@
/******************************************************************************
- * $Id: kml.h 32177 2015-12-14 07:25:30Z goatbar $
+ * $Id: kml.h 34104 2016-04-25 17:17:20Z rouault $
*
* Project: KML Driver
* Purpose: Class for reading, parsing and handling a kmlfile.
@@ -89,6 +89,8 @@ public:
int getNumFeatures();
Feature* getFeature(std::size_t nNum, int& nLastAsked, int &nLastCount);
+ void unregisterLayerIfMatchingThisNode(KMLNode* poNode);
+
protected:
void checkValidity();
diff --git a/ogr/ogrsf_frmts/kml/kmlnode.cpp b/ogr/ogrsf_frmts/kml/kmlnode.cpp
index d810013..b0d63f3 100644
--- a/ogr/ogrsf_frmts/kml/kmlnode.cpp
+++ b/ogr/ogrsf_frmts/kml/kmlnode.cpp
@@ -1,5 +1,5 @@
/******************************************************************************
- * $Id: kmlnode.cpp 33713 2016-03-12 17:41:57Z goatbar $
+ * $Id: kmlnode.cpp 34104 2016-04-25 17:17:20Z rouault $
*
* Project: KML Driver
* Purpose: Class for building up the node structure of the kml file.
@@ -337,6 +337,7 @@ void KMLNode::eliminateEmpty(KML* poKML)
&& (poKML->isContainer((*pvpoChildren_)[z]->sName_)
|| poKML->isFeatureContainer((*pvpoChildren_)[z]->sName_)))
{
+ poKML->unregisterLayerIfMatchingThisNode((*pvpoChildren_)[z]);
delete (*pvpoChildren_)[z];
pvpoChildren_->erase(pvpoChildren_->begin() + z);
z--;
diff --git a/ogr/ogrsf_frmts/openfilegdb/filegdbtable.cpp b/ogr/ogrsf_frmts/openfilegdb/filegdbtable.cpp
index 0287a50..f306e44 100644
--- a/ogr/ogrsf_frmts/openfilegdb/filegdbtable.cpp
+++ b/ogr/ogrsf_frmts/openfilegdb/filegdbtable.cpp
@@ -1,5 +1,5 @@
/******************************************************************************
- * $Id: filegdbtable.cpp 33713 2016-03-12 17:41:57Z goatbar $
+ * $Id: filegdbtable.cpp 34072 2016-04-24 13:09:01Z rouault $
*
* Project: OpenGIS Simple Features Reference Implementation
* Purpose: Implements reading of FileGDB tables
@@ -1807,6 +1807,7 @@ int FileGDBTable::GetFeatureExtent(const OGRField* psField,
case SHPT_POINTZM:
case SHPT_POINT:
case SHPT_POINTM:
+ case SHPT_GENERALPOINT:
{
GUIntBig x, y;
ReadVarUInt64NoCheck(pabyCur, x);
@@ -1904,6 +1905,7 @@ int FileGDBTable::DoesGeometryIntersectsFilterEnvelope(const OGRField* psField)
case SHPT_POINTZM:
case SHPT_POINT:
case SHPT_POINTM:
+ case SHPT_GENERALPOINT:
{
GUIntBig x, y;
ReadVarUInt64NoCheck(pabyCur, x);
@@ -2407,6 +2409,7 @@ OGRGeometry* FileGDBOGRGeometryConverterImpl::GetAsGeometry(const OGRField* psFi
// CPL_FALLTHROUGH
case SHPT_POINT:
case SHPT_POINTM:
+ case SHPT_GENERALPOINT:
{
if( nGeomType == SHPT_POINTM || nGeomType == SHPT_POINTZM )
bHasM = true;
@@ -2875,7 +2878,6 @@ OGRGeometry* FileGDBOGRGeometryConverterImpl::GetAsGeometry(const OGRField* psFi
CPLDebug("OpenFileGDB", "Unhandled geometry type = %d", (int)nGeomType);
break;
/*
-#define SHPT_GENERALPOINT 52
#define SHPT_GENERALMULTIPOINT 53
*/
}
diff --git a/ogr/ogrsf_frmts/osm/ogr_osm.h b/ogr/ogrsf_frmts/osm/ogr_osm.h
index 9d03d2e..95588c9 100644
--- a/ogr/ogrsf_frmts/osm/ogr_osm.h
+++ b/ogr/ogrsf_frmts/osm/ogr_osm.h
@@ -1,5 +1,5 @@
/******************************************************************************
- * $Id: ogr_osm.h 33714 2016-03-13 05:42:13Z goatbar $
+ * $Id: ogr_osm.h 34096 2016-04-25 10:10:12Z rouault $
*
* Project: OpenGIS Simple Features Reference Implementation
* Purpose: Private definitions for OGR/OpenStreeMap driver.
@@ -395,12 +395,12 @@ class OGROSMDataSource : public OGRDataSource
bool bNeedsToSaveWayInfo;
- int CompressWay (unsigned int nTags, IndexedKVP* pasTags,
+ int CompressWay (bool bIsArea, unsigned int nTags, IndexedKVP* pasTags,
int nPoints, LonLat* pasLonLatPairs,
OSMInfo* psInfo,
GByte* pabyCompressedWay);
int UncompressWay( int nBytes, GByte* pabyCompressedWay,
- LonLat* pasCoords,
+ bool *pbIsArea, LonLat* pasCoords,
unsigned int* pnTags, OSMTag* pasTags,
OSMInfo* psInfo );
@@ -418,7 +418,7 @@ class OGROSMDataSource : public OGRDataSource
bool FlushCurrentSectorNonCompressedCase();
bool IndexPointCustom(OSMNode* psNode);
- void IndexWay(GIntBig nWayID,
+ void IndexWay(GIntBig nWayID, bool bIsArea,
unsigned int nTags, IndexedKVP* pasTags,
LonLat* pasLonLatPairs, int nPairs,
OSMInfo* psInfo);
@@ -453,6 +453,7 @@ class OGROSMDataSource : public OGRDataSource
void AddComputedAttributes(int iCurLayer,
const std::vector<OGROSMComputedAttribute>& oAttributes);
+ bool IsClosedWayTaggedAsPolygon( unsigned int nTags, const OSMTag* pasTags );
public:
OGROSMDataSource();
diff --git a/ogr/ogrsf_frmts/osm/ogrosmdatasource.cpp b/ogr/ogrsf_frmts/osm/ogrosmdatasource.cpp
index 50bbd6c..827c13b 100644
--- a/ogr/ogrsf_frmts/osm/ogrosmdatasource.cpp
+++ b/ogr/ogrsf_frmts/osm/ogrosmdatasource.cpp
@@ -1,5 +1,5 @@
/******************************************************************************
- * $Id: ogrosmdatasource.cpp 33199 2016-01-29 15:48:41Z rouault $
+ * $Id: ogrosmdatasource.cpp 34098 2016-04-25 10:11:11Z rouault $
*
* Project: OpenGIS Simple Features Reference Implementation
* Purpose: Implements OGROSMDataSource class.
@@ -62,7 +62,7 @@ static const int LIMIT_IDS_PER_REQUEST = 200;
#define MAX_SIZE_FOR_TAGS_IN_WAY 1024
/* 5 bytes for encoding a int : really the worst case scenario ! */
-#define WAY_BUFFER_SIZE (1 + MAX_NODES_PER_WAY * 2 * 5 + MAX_SIZE_FOR_TAGS_IN_WAY)
+#define WAY_BUFFER_SIZE (1 /*is_area*/ + 1 + MAX_NODES_PER_WAY * 2 * 5 + MAX_SIZE_FOR_TAGS_IN_WAY)
#define NODE_PER_BUCKET 65536
@@ -126,7 +126,7 @@ size_t GetMaxTotalAllocs();
static void WriteVarInt64(GUIntBig nSVal, GByte** ppabyData);
static void WriteVarSInt64(GIntBig nSVal, GByte** ppabyData);
-CPL_CVSID("$Id: ogrosmdatasource.cpp 33199 2016-01-29 15:48:41Z rouault $");
+CPL_CVSID("$Id: ogrosmdatasource.cpp 34098 2016-04-25 10:11:11Z rouault $");
class DSToBeOpened
{
@@ -1396,13 +1396,15 @@ static void WriteVarSInt64(GIntBig nSVal, GByte** ppabyData)
/* CompressWay() */
/************************************************************************/
-int OGROSMDataSource::CompressWay ( unsigned int nTags, IndexedKVP* pasTags,
+int OGROSMDataSource::CompressWay ( bool bIsArea, unsigned int nTags, IndexedKVP* pasTags,
int nPoints, LonLat* pasLonLatPairs,
OSMInfo* psInfo,
GByte* pabyCompressedWay )
{
GByte* pabyPtr = pabyCompressedWay;
+ *pabyPtr = (bIsArea) ? 1 : 0;
pabyPtr ++;
+ pabyPtr ++; // skip tagCount
int nTagCount = 0;
CPLAssert(nTags < MAX_COUNT_FOR_TAGS_IN_WAY);
@@ -1445,7 +1447,7 @@ int OGROSMDataSource::CompressWay ( unsigned int nTags, IndexedKVP* pasTags,
nTagCount ++;
}
- pabyCompressedWay[0] = (GByte) nTagCount;
+ pabyCompressedWay[1] = (GByte) nTagCount;
if( bNeedsToSaveWayInfo )
{
@@ -1488,11 +1490,15 @@ int OGROSMDataSource::CompressWay ( unsigned int nTags, IndexedKVP* pasTags,
/************************************************************************/
int OGROSMDataSource::UncompressWay( int nBytes, GByte* pabyCompressedWay,
+ bool* pbIsArea,
LonLat* pasCoords,
unsigned int* pnTags, OSMTag* pasTags,
OSMInfo* psInfo )
{
GByte* pabyPtr = pabyCompressedWay;
+ if( pbIsArea )
+ *pbIsArea = (*pabyPtr == 1) ? true : false;
+ pabyPtr ++;
unsigned int nTags = *pabyPtr;
pabyPtr ++;
@@ -1563,7 +1569,7 @@ int OGROSMDataSource::UncompressWay( int nBytes, GByte* pabyCompressedWay,
/* IndexWay() */
/************************************************************************/
-void OGROSMDataSource::IndexWay(GIntBig nWayID,
+void OGROSMDataSource::IndexWay(GIntBig nWayID, bool bIsArea,
unsigned int nTags, IndexedKVP* pasTags,
LonLat* pasLonLatPairs, int nPairs,
OSMInfo* psInfo)
@@ -1573,7 +1579,7 @@ void OGROSMDataSource::IndexWay(GIntBig nWayID,
sqlite3_bind_int64( hInsertWayStmt, 1, nWayID );
- int nBufferSize = CompressWay (nTags, pasTags, nPairs, pasLonLatPairs, psInfo, pabyWayBuffer);
+ int nBufferSize = CompressWay (bIsArea, nTags, pasTags, nPairs, pasLonLatPairs, psInfo, pabyWayBuffer);
CPLAssert(nBufferSize <= WAY_BUFFER_SIZE);
sqlite3_bind_blob( hInsertWayStmt, 2, pabyWayBuffer,
nBufferSize, SQLITE_STATIC );
@@ -1712,13 +1718,14 @@ void OGROSMDataSource::ProcessWaysBatch()
if( bIsArea && papoLayers[IDX_LYR_MULTIPOLYGONS]->IsUserInterested() )
{
IndexWay(psWayFeaturePairs->nWayID,
+ bIsArea != 0,
psWayFeaturePairs->nTags,
psWayFeaturePairs->pasTags,
pasLonLatCache, (int)nFound,
&psWayFeaturePairs->sInfo);
}
else
- IndexWay(psWayFeaturePairs->nWayID, 0, NULL,
+ IndexWay(psWayFeaturePairs->nWayID, bIsArea != 0, 0, NULL,
pasLonLatCache, (int)nFound, NULL);
if( psWayFeaturePairs->poFeature == NULL )
@@ -1785,6 +1792,37 @@ void OGROSMDataSource::ProcessWaysBatch()
}
/************************************************************************/
+/* IsClosedWayTaggedAsPolygon() */
+/************************************************************************/
+
+bool OGROSMDataSource::IsClosedWayTaggedAsPolygon( unsigned int nTags, const OSMTag* pasTags )
+{
+ bool bIsArea = false;
+ for( unsigned int i=0;i<nTags;i++)
+ {
+ const char* pszK = pasTags[i].pszK;
+ if( strcmp(pszK, "area") == 0 )
+ {
+ if( strcmp(pasTags[i].pszV, "yes") == 0 )
+ {
+ bIsArea = true;
+ }
+ else if( strcmp(pasTags[i].pszV, "no") == 0 )
+ {
+ bIsArea = false;
+ break;
+ }
+ }
+ else if( aoSetClosedWaysArePolygons.find(pszK) !=
+ aoSetClosedWaysArePolygons.end() )
+ {
+ bIsArea = true;
+ }
+ }
+ return bIsArea;
+}
+
+/************************************************************************/
/* NotifyWay() */
/************************************************************************/
@@ -1822,27 +1860,7 @@ void OGROSMDataSource::NotifyWay (OSMWay* psWay)
bool bIsArea = false;
if( psWay->panNodeRefs[0] == psWay->panNodeRefs[psWay->nRefs - 1] )
{
- for( unsigned int i=0;i<psWay->nTags;i++)
- {
- const char* pszK = psWay->pasTags[i].pszK;
- if( strcmp(pszK, "area") == 0 )
- {
- if( strcmp(psWay->pasTags[i].pszV, "yes") == 0 )
- {
- bIsArea = true;
- }
- else if( strcmp(psWay->pasTags[i].pszV, "no") == 0 )
- {
- bIsArea = false;
- break;
- }
- }
- else if( aoSetClosedWaysArePolygons.find(pszK) !=
- aoSetClosedWaysArePolygons.end() )
- {
- bIsArea = true;
- }
- }
+ bIsArea = IsClosedWayTaggedAsPolygon(psWay->nTags, psWay->pasTags);
}
bool bInterestingTag = bReportAllWays;
@@ -2208,12 +2226,12 @@ OGRGeometry* OGROSMDataSource::BuildMultiPolygon(OSMRelation* psRelation,
memcpy(pabyWayBuffer, pabyCompressedWay, nCompressedWaySize);
nPoints = UncompressWay (nCompressedWaySize, pabyWayBuffer,
- pasCoords,
+ NULL, pasCoords,
pnTags, pasTags, NULL );
}
else
{
- nPoints = UncompressWay (oGeom.first, (GByte*) oGeom.second, pasCoords,
+ nPoints = UncompressWay (oGeom.first, (GByte*) oGeom.second, NULL, pasCoords,
NULL, NULL, NULL);
}
@@ -2358,13 +2376,25 @@ OGRGeometry* OGROSMDataSource::BuildGeometryCollection(OSMRelation* psRelation,
const std::pair<int, void*>& oGeom = aoMapWays[ psRelation->pasMembers[i].nID ];
LonLat* pasCoords = reinterpret_cast<LonLat *>(pasLonLatCache);
+ bool bIsArea = false;
const int nPoints = UncompressWay(
oGeom.first,
reinterpret_cast<GByte *>(oGeom.second),
- pasCoords, NULL, NULL, NULL );
-
- OGRLineString* poLS = new OGRLineString();
- poColl->addGeometryDirectly(poLS);
+ &bIsArea, pasCoords, NULL, NULL, NULL );
+ OGRLineString* poLS;
+ if( bIsArea )
+ {
+ OGRLinearRing* poLR = new OGRLinearRing();
+ OGRPolygon* poPoly = new OGRPolygon();
+ poPoly->addRingDirectly(poLR);
+ poColl->addGeometryDirectly(poPoly);
+ poLS = poLR;
+ }
+ else
+ {
+ poLS = new OGRLineString();
+ poColl->addGeometryDirectly(poLS);
+ }
poLS->setNumPoints(nPoints);
for(int j=0;j<nPoints;j++)
@@ -2577,7 +2607,7 @@ void OGROSMDataSource::ProcessPolygonsStandalone()
const int nPoints = UncompressWay(
nBlobSize, reinterpret_cast<GByte *>(const_cast<void *>(blob)),
- pasCoords, &nTags, pasTags, &sInfo );
+ NULL, pasCoords, &nTags, pasTags, &sInfo );
CPLAssert(nTags <= MAX_COUNT_FOR_TAGS_IN_WAY);
@@ -4350,3 +4380,4 @@ int OGROSMDataSource::IsInterleavedReading()
}
return bInterleavedReading;
}
+
diff --git a/ogr/ogrsf_frmts/shape/ogrshapedatasource.cpp b/ogr/ogrsf_frmts/shape/ogrshapedatasource.cpp
index 74b7cf6..4cb71b4 100644
--- a/ogr/ogrsf_frmts/shape/ogrshapedatasource.cpp
+++ b/ogr/ogrsf_frmts/shape/ogrshapedatasource.cpp
@@ -1,5 +1,5 @@
/******************************************************************************
- * $Id: ogrshapedatasource.cpp 33889 2016-04-04 09:16:07Z rouault $
+ * $Id: ogrshapedatasource.cpp 34069 2016-04-23 17:59:00Z rouault $
*
* Project: OpenGIS Simple Features Reference Implementation
* Purpose: Implements OGRShapeDataSource class.
@@ -35,7 +35,7 @@
//#define IMMEDIATE_OPENING 1
-CPL_CVSID("$Id: ogrshapedatasource.cpp 33889 2016-04-04 09:16:07Z rouault $");
+CPL_CVSID("$Id: ogrshapedatasource.cpp 34069 2016-04-23 17:59:00Z rouault $");
/************************************************************************/
/* DS_SHPOpen() */
@@ -471,7 +471,7 @@ OGRShapeDataSource::ICreateLayer( const char * pszLayerName,
/* -------------------------------------------------------------------- */
/* Figure out what type of layer we need. */
/* -------------------------------------------------------------------- */
- if( eType == wkbUnknown || eType == wkbLineString )
+ if( wkbFlatten(eType) == wkbUnknown || eType == wkbLineString )
nShapeType = SHPT_ARC;
else if( eType == wkbPoint )
nShapeType = SHPT_POINT;
diff --git a/ogr/ogrsf_frmts/shape/ogrshapelayer.cpp b/ogr/ogrsf_frmts/shape/ogrshapelayer.cpp
index 4b61cae..b05c258 100644
--- a/ogr/ogrsf_frmts/shape/ogrshapelayer.cpp
+++ b/ogr/ogrsf_frmts/shape/ogrshapelayer.cpp
@@ -1,5 +1,5 @@
/******************************************************************************
- * $Id: ogrshapelayer.cpp 33714 2016-03-13 05:42:13Z goatbar $
+ * $Id: ogrshapelayer.cpp 34069 2016-04-23 17:59:00Z rouault $
*
* Project: OpenGIS Simple Features Reference Implementation
* Purpose: Implements OGRShapeLayer class.
@@ -40,7 +40,7 @@
#define UNSUPPORTED_OP_READ_ONLY "%s : unsupported operation on a read-only datasource."
-CPL_CVSID("$Id: ogrshapelayer.cpp 33714 2016-03-13 05:42:13Z goatbar $");
+CPL_CVSID("$Id: ogrshapelayer.cpp 34069 2016-04-23 17:59:00Z rouault $");
/************************************************************************/
/* OGRShapeLayer() */
@@ -1014,7 +1014,7 @@ OGRErr OGRShapeLayer::ICreateFeature( OGRFeature *poFeature )
poFeature->SetFID( OGRNullFID );
if( nTotalShapeCount == 0
- && eRequestedGeomType == wkbUnknown
+ && wkbFlatten(eRequestedGeomType) == wkbUnknown
&& poFeature->GetGeometryRef() != NULL )
{
OGRGeometry *poGeom = poFeature->GetGeometryRef();
diff --git a/ogr/ogrsf_frmts/sqlite/ogrsqliteexecutesql.cpp b/ogr/ogrsf_frmts/sqlite/ogrsqliteexecutesql.cpp
index 647148f..045c871 100644
--- a/ogr/ogrsf_frmts/sqlite/ogrsqliteexecutesql.cpp
+++ b/ogr/ogrsf_frmts/sqlite/ogrsqliteexecutesql.cpp
@@ -1,5 +1,5 @@
/******************************************************************************
- * $Id: ogrsqliteexecutesql.cpp 33714 2016-03-13 05:42:13Z goatbar $
+ * $Id: ogrsqliteexecutesql.cpp 34082 2016-04-24 22:10:13Z rouault $
*
* Project: OpenGIS Simple Features Reference Implementation
* Purpose: Run SQL requests with SQLite SQL engine
@@ -599,7 +599,7 @@ int OGR2SQLITEDealWithSpatialColumn(OGRLayer* poLayer,
osSQL.Printf("INSERT INTO geometry_columns (f_table_name, "
"f_geometry_column, geometry_type, coord_dimension, "
"srid, spatial_index_enabled) "
- "VALUES ('%s',Lower('%s'),%d ,%d ,%d, %d)",
+ "VALUES (Lower('%s'),Lower('%s'),%d ,%d ,%d, %d)",
pszLayerNameEscaped,
pszGeomColEscaped, nGeomType,
nCoordDimension,
@@ -622,7 +622,13 @@ int OGR2SQLITEDealWithSpatialColumn(OGRLayer* poLayer,
}
}
#endif // HAVE_SPATIALITE
- int rc = sqlite3_exec( hDB, osSQL.c_str(), NULL, NULL, NULL );
+ char* pszErrMsg = NULL;
+ int rc = sqlite3_exec( hDB, osSQL.c_str(), NULL, NULL, &pszErrMsg );
+ if( pszErrMsg != NULL )
+ {
+ CPLDebug("SQLITE", "%s -> %s", osSQL.c_str(), pszErrMsg);
+ sqlite3_free(pszErrMsg);
+ }
#ifdef HAVE_SPATIALITE
/* -------------------------------------------------------------------- */
diff --git a/ogr/ogrsf_frmts/vrt/ogrvrtlayer.cpp b/ogr/ogrsf_frmts/vrt/ogrvrtlayer.cpp
index a249ba5..734b005 100644
--- a/ogr/ogrsf_frmts/vrt/ogrvrtlayer.cpp
+++ b/ogr/ogrsf_frmts/vrt/ogrvrtlayer.cpp
@@ -1,5 +1,5 @@
/******************************************************************************
- * $Id: ogrvrtlayer.cpp 33714 2016-03-13 05:42:13Z goatbar $
+ * $Id: ogrvrtlayer.cpp 34079 2016-04-24 18:44:29Z rouault $
*
* Project: OpenGIS Simple Features Reference Implementation
* Purpose: Implements OGRVRTLayer class.
@@ -34,7 +34,7 @@
#include "ogrpgeogeometry.h"
#include <string>
-CPL_CVSID("$Id: ogrvrtlayer.cpp 33714 2016-03-13 05:42:13Z goatbar $");
+CPL_CVSID("$Id: ogrvrtlayer.cpp 34079 2016-04-24 18:44:29Z rouault $");
#define UNSUPPORTED_OP_READ_ONLY "%s : unsupported operation on a read-only datasource."
@@ -809,6 +809,7 @@ try_again:
/* -------------------------------------------------------------------- */
/* Figure out what should be used as an FID. */
/* -------------------------------------------------------------------- */
+ bAttrFilterPassThrough = TRUE;
pszSrcFIDFieldName = CPLGetXMLValue( psLTree, "FID", NULL );
if( pszSrcFIDFieldName != NULL )
@@ -826,6 +827,9 @@ try_again:
// User facing FID column name. If not defined we will report the
// source FID column name only if it is exposed as a field too (#4637)
osFIDFieldName = CPLGetXMLValue( psLTree, "FID.name", "" );
+
+ if( !EQUAL(pszSrcFIDFieldName, poSrcLayer->GetFIDColumn()) )
+ bAttrFilterPassThrough = FALSE;
}
/* -------------------------------------------------------------------- */
@@ -844,12 +848,14 @@ try_again:
pszStyleFieldName );
goto error;
}
+
+ if( !EQUAL(pszStyleFieldName, "OGR_STYLE") )
+ bAttrFilterPassThrough = FALSE;
}
/* ==================================================================== */
/* Search for schema definitions in the VRT. */
/* ==================================================================== */
- bAttrFilterPassThrough = TRUE;
for( psChild = psLTree->psChild; psChild != NULL; psChild=psChild->psNext )
{
if( psChild->eType == CXT_Element && EQUAL(psChild->pszValue,"Field") )
diff --git a/ogr/swq_op_general.cpp b/ogr/swq_op_general.cpp
index 4e809da..5f0606b 100644
--- a/ogr/swq_op_general.cpp
+++ b/ogr/swq_op_general.cpp
@@ -1212,6 +1212,7 @@ swq_expr_node *SWQCastEvaluator( swq_expr_node *node,
{
poRetNode = new swq_expr_node( 0 );
poRetNode->is_null = poSrcNode->is_null;
+ poRetNode->field_type = SWQ_INTEGER64;
switch( poSrcNode->field_type )
{
@@ -1367,7 +1368,17 @@ swq_field_type SWQCastChecker( swq_expr_node *poNode,
else if( EQUAL(pszTypeName,"integer") )
eType = SWQ_INTEGER;
else if( EQUAL(pszTypeName,"bigint") )
+ {
+ // Handle CAST(fid AS bigint) by changing the field_type of fid to Integer64
+ // A bit of a hack
+ if( poNode->papoSubExpr[0]->eNodeType == SNT_COLUMN &&
+ poNode->papoSubExpr[0]->field_type == SWQ_INTEGER &&
+ strcmp(poNode->papoSubExpr[0]->string_value, "fid") == 0 )
+ {
+ poNode->papoSubExpr[0]->field_type = SWQ_INTEGER64;
+ }
eType = SWQ_INTEGER64;
+ }
else if( EQUAL(pszTypeName,"smallint") )
eType = SWQ_INTEGER;
else if( EQUAL(pszTypeName,"float") )
diff --git a/port/cpl_error.cpp b/port/cpl_error.cpp
index ae28958..0ae5ab2 100644
--- a/port/cpl_error.cpp
+++ b/port/cpl_error.cpp
@@ -1,5 +1,5 @@
/**********************************************************************
- * $Id: cpl_error.cpp 33844 2016-04-01 08:42:13Z rouault $
+ * $Id: cpl_error.cpp 34109 2016-04-25 17:28:36Z rouault $
*
* Name: cpl_error.cpp
* Project: CPL - Common Portability Library
@@ -38,12 +38,12 @@
#define TIMESTAMP_DEBUG
//#define MEMORY_DEBUG
-CPL_CVSID("$Id: cpl_error.cpp 33844 2016-04-01 08:42:13Z rouault $");
+CPL_CVSID("$Id: cpl_error.cpp 34109 2016-04-25 17:28:36Z rouault $");
static CPLMutex *hErrorMutex = NULL;
static void *pErrorHandlerUserData = NULL;
static CPLErrorHandler pfnErrorHandler = CPLDefaultErrorHandler;
-static bool gbCatchDebug = false;
+static bool gbCatchDebug = true;
static const int DEFAULT_LAST_ERR_MSG_SIZE =
#if !defined(HAVE_VSNPRINTF)
--
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