diff -Nru gdal-2.4.0+9/core/port/cpl_json.cpp gdal-2.4.0+10/core/port/cpl_json.cpp --- gdal-2.4.0+9/core/port/cpl_json.cpp 2018-12-21 15:49:10.000000000 +0000 +++ gdal-2.4.0+10/core/port/cpl_json.cpp 2019-02-03 20:55:33.000000000 +0000 @@ -336,7 +336,7 @@ #endif // HAVE_CURL { #ifdef HAVE_CURL - int nDepth = atoi( CSLFetchNameValueDef( papszOptions, "JSON_DEPTH", "10") ); + int nDepth = atoi( CSLFetchNameValueDef( papszOptions, "JSON_DEPTH", "32") ); // Same as JSON_TOKENER_DEFAULT_DEPTH JsonContext ctx = { nullptr, json_tokener_new_ex(nDepth), 0 }; CPLHTTPFetchWriteFunc pWriteFunc = CPLJSONWriteFunction; @@ -1165,7 +1165,7 @@ int CPLJSONArray::Size() const { if( m_poJsonObject ) - return json_object_array_length( TO_JSONOBJ(m_poJsonObject) ); + return static_cast(json_object_array_length( TO_JSONOBJ(m_poJsonObject) )); return 0; } diff -Nru gdal-2.4.0+9/core/port/cpl_minizip_zip.cpp gdal-2.4.0+10/core/port/cpl_minizip_zip.cpp --- gdal-2.4.0+9/core/port/cpl_minizip_zip.cpp 2019-02-02 16:55:33.000000000 +0000 +++ gdal-2.4.0+10/core/port/cpl_minizip_zip.cpp 2019-02-03 20:55:33.000000000 +0000 @@ -1151,8 +1151,10 @@ zi->ci.totalUncompressedData = 0; zi->ci.pos_zip64extrainfo = 0; - // For now always generate zip64 extra fields - err = Write_LocalFileHeader(zi, filename, size_extrafield_local, extrafield_local, /* zip64 */ 0); + // For now default is to generate zip64 extra fields + const bool bZip64 = CPLTestBool(CPLGetConfigOption("CPL_CREATE_ZIP64", "ON")); + err = Write_LocalFileHeader(zi, filename, size_extrafield_local, + extrafield_local, bZip64 ? 1 : 0); zi->ci.stream.avail_in = 0; zi->ci.stream.avail_out = Z_BUFSIZE; diff -Nru gdal-2.4.0+9/debian/changelog gdal-2.4.0+10/debian/changelog --- gdal-2.4.0+9/debian/changelog 2019-02-02 16:56:24.000000000 +0000 +++ gdal-2.4.0+10/debian/changelog 2019-02-03 20:56:42.000000000 +0000 @@ -1,8 +1,14 @@ -gdal (2.4.0+9-0trusty1) trusty; urgency=medium +gdal (2.4.0+10-0trusty1) trusty; urgency=medium + + * 7b8527d - Dmitry Baryshnikov : Add create zip64 option, increase json depth, fix ngw create layer (unique fields, patch in batch mode, etc.) + + -- Dmitry Baryshnikov Sun, 03 Feb 2019 20:56:42 +0000 + +gdal (2.4.0+9-0unstable1) unstable; urgency=medium * 34f2eed - Mikhail Gusev : Temp fix for generating ZIP 2.0, not ZIP 4.5 - -- Dmitry Baryshnikov Sat, 02 Feb 2019 16:56:24 +0000 + -- Dmitry Baryshnikov Sat, 02 Feb 2019 16:58:37 +0000 gdal (2.4.0+8-0unstable1) unstable; urgency=medium diff -Nru gdal-2.4.0+9/drivers/common/cad/vsilfileio.cpp gdal-2.4.0+10/drivers/common/cad/vsilfileio.cpp --- gdal-2.4.0+9/drivers/common/cad/vsilfileio.cpp 2018-05-13 00:00:30.000000000 +0000 +++ gdal-2.4.0+10/drivers/common/cad/vsilfileio.cpp 2019-02-03 20:55:33.000000000 +0000 @@ -57,7 +57,7 @@ bool VSILFileIO::Open(int mode) { // NOTE: now support only read mode - if( mode & OpenMode::write ) + if( mode & OpenMode::out ) return false; std::string sOpenMode = "r"; diff -Nru gdal-2.4.0+9/drivers/common/ngw/gdalngwdataset.cpp gdal-2.4.0+10/drivers/common/ngw/gdalngwdataset.cpp --- gdal-2.4.0+9/drivers/common/ngw/gdalngwdataset.cpp 2019-01-22 07:38:27.000000000 +0000 +++ gdal-2.4.0+10/drivers/common/ngw/gdalngwdataset.cpp 2019-02-03 20:55:33.000000000 +0000 @@ -65,7 +65,8 @@ poRasterDS(nullptr), nRasters(0), nCacheExpires(604800), // 7 days - nCacheMaxSize(67108864) // 64 MB + nCacheMaxSize(67108864),// 64 MB + osJsonDepth("32") {} /* @@ -198,6 +199,9 @@ bExtInNativeData = CPLFetchBool( papszOpenOptionsIn, "NATIVE_DATA", CPLTestBool( CPLGetConfigOption("NGW_NATIVE_DATA", "NO") ) ); + osJsonDepth = CSLFetchNameValueDef( papszOpenOptionsIn, "JSON_DEPTH", + CPLGetConfigOption("NGW_JSON_DEPTH", "32")); + return Init( nOpenFlagsIn ); } @@ -790,6 +794,7 @@ { char **papszOptions = nullptr; papszOptions = CSLAddString(papszOptions, "HEADERS=Accept: */*"); + papszOptions = CSLAddNameValue(papszOptions, "JSON_DEPTH", osJsonDepth.c_str()); if( !osUserPwd.empty() ) { papszOptions = CSLAddString(papszOptions, "HTTPAUTH=BASIC"); diff -Nru gdal-2.4.0+9/drivers/common/ngw/ngw_api.cpp gdal-2.4.0+10/drivers/common/ngw/ngw_api.cpp --- gdal-2.4.0+9/drivers/common/ngw/ngw_api.cpp 2019-01-07 23:28:54.000000000 +0000 +++ gdal-2.4.0+10/drivers/common/ngw/ngw_api.cpp 2019-02-03 20:55:33.000000000 +0000 @@ -621,9 +621,10 @@ return bResult; } -bool PatchFeatures(const std::string &osUrl, const std::string &osResourceId, +std::vector PatchFeatures(const std::string &osUrl, const std::string &osResourceId, const std::string &osFeaturesJson, char **papszHTTPOptions) { + std::vector aoFIDs; CPLErrorReset(); std::string osPayloadInt = "POSTFIELDS=" + osFeaturesJson; @@ -635,21 +636,37 @@ CPLDebug("NGW", "PatchFeatures request payload: %s", osFeaturesJson.c_str()); std::string osUrlInt = GetFeature(osUrl, osResourceId); - CPLHTTPResult *psResult = CPLHTTPFetch( osUrlInt.c_str(), papszHTTPOptions ); + CPLJSONDocument oPatchFeatureReq; + bool bResult = oPatchFeatureReq.LoadUrl( osUrlInt, papszHTTPOptions ); CSLDestroy( papszHTTPOptions ); - bool bResult = false; - if( psResult ) - { - bResult = psResult->nStatus == 0 && psResult->pszErrBuf == nullptr; - // Get error message. - if( !bResult ) + CPLJSONObject oRoot = oPatchFeatureReq.GetRoot(); + if( oRoot.IsValid() ) + { + if( bResult ) { - ReportError(psResult->pabyData, psResult->nDataLen); + CPLJSONArray aoJSONIDs = oRoot.ToArray(); + for( int i = 0; i < aoJSONIDs.Size(); ++i) + { + GIntBig nOutFID = aoJSONIDs[i].GetLong( "id", OGRNullFID ); + aoFIDs.push_back(nOutFID); } - CPLHTTPDestroyResult(psResult); } - return bResult; + else + { + std::string osErrorMessage = oRoot.GetString("message"); + if( osErrorMessage.empty() ) + { + osErrorMessage = "Patch features failed"; + } + CPLError(CE_Failure, CPLE_AppDefined, "%s", osErrorMessage.c_str()); + } + } + else + { + CPLError(CE_Failure, CPLE_AppDefined, "Patch features failed"); + } + return aoFIDs; } bool GetExtent(const std::string &osUrl, const std::string &osResourceId, diff -Nru gdal-2.4.0+9/drivers/common/ngw/ogrngwdriver.cpp gdal-2.4.0+10/drivers/common/ngw/ogrngwdriver.cpp --- gdal-2.4.0+9/drivers/common/ngw/ogrngwdriver.cpp 2018-12-21 15:49:10.000000000 +0000 +++ gdal-2.4.0+10/drivers/common/ngw/ogrngwdriver.cpp 2019-02-03 20:55:33.000000000 +0000 @@ -433,6 +433,7 @@ "