Skip to content
Commits on Source (4)
MIGRATION GUIDE FROM GDAL 2.4 to GDAL 2.5
MIGRATION GUIDE FROM GDAL 2.4 to GDAL 3.0
-----------------------------------------
- Unix Build: ./configure arguments --without-bsb, --without-grib,
......
= GDAL/OGR 2.5.0 Release Notes =
= GDAL/OGR 3.0.0 Release Notes =
 
== In a nutshell... ==
 
......@@ -30,7 +30,7 @@
 
See MIGRATION_GUIDE.txt
 
== GDAL/OGR 2.5.0 - General Changes ==
== GDAL/OGR 3.0.0 - General Changes ==
 
Build(Unix):
* Allow internal drivers to be disabled (#1250)
......@@ -51,7 +51,7 @@ All:
* Poppler: drop support for Poppler older than 0.23.0
* Poppler: add support for 0.72.0, 0.73.0, 0.75.0, 0.76.0
 
== GDAL X.Y.Z - Overview of Changes ==
== GDAL 3.0.0 - Overview of Changes ==
 
Port:
* Add capability to define external VSI virtual file systems from C API (#1289)
......@@ -91,6 +91,7 @@ Algorithms:
 
Utilities:
* gdal_translate: add "-nogcp" option (#1469)
* gdal_contour: remove explicit width/precision=12/3 of the elev field (#1487)
* gdaldem hillshade: add -igor option (#1330)
* gdalwarp -crop_to_cutline: do not round computed target extent to be aligned on the grid of the source raster if -tr is set (restore partially pre 2.4 behaviour) (#1173)
* gdalwarp: assume -tap when using -crop_to_cutline, -tr and -wo CUTLINE_ALL_TOUCHED=TRUE, so as to avoid issues with polygons smaller than 1x1 pixels (#1360)
......@@ -106,6 +107,9 @@ Utilities:
* validate_cloud_optimized_geotiff.py: check if file is only greater than 512px (#1403)
* validate_cloud_optimized_geotiff.py: report headers size
 
Multidriver fixes:
* GTiff, GPKG, MBTiles, PostgisRaster drivers: ensure that main dataset and overviews share the same lock, so as to avoid crashing concurrent access (#1488)
ADRG driver:
* modified to ensure that there is no confliction between ADRG and SRP when opening a .gen file (#953)
 
......@@ -132,6 +136,7 @@ GTiff diver:
* TIFF Lerc: properly initialize state after Create() so that BuildOverviews() succeed (#1257)
* emit merged consecutive multi-range reads (#1297)
* add warnings when using unsupported combination of internal mask+external overview, and fix COPY_SRC_OVERVIEWS=YES so that it does not copy ALL_VALID masks (#1455)
* do not generate a TIFFTAG_GDAL_METADATA with color interpretation information for JPEG YCbCr compression
* Internal libtiff and libgeotiff: resync with upstream
 
FITS driver:
......@@ -215,7 +220,7 @@ XYZ driver:
* add creation options DECIMAL_PRECISION and SIGNIFICANT_DIGITS like with AAIGrid
* fix regression regarding header lines that are not X,Y,Z (#1472)
 
== OGR X.Y.Z - Overview of Changes ==
== OGR 3.0.0 - Overview of Changes ==
 
Core:
* Add OGR_G_MakeValid() (requires GEOS 3.8)
......@@ -266,6 +271,7 @@ Elasticsearch driver:
 
GeoJSON driver:
* speed-up random reading with GetFeature() by storing a map FID->(start,size) to retrieve performance similar to GDAL 2.2 or before (https://issues.qgis.org/issues/21085)
* report 3D layer geometry types (#1495)
 
GeoJSONSeq driver:
* be more robust to invalid objects, and fixes performance issue on corrupted files. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13770.
......
......@@ -37,7 +37,7 @@
#include "ogr_srs_api.h"
#include "commonutils.h"
CPL_CVSID("$Id: gdal_contour.cpp b3fca85d7b40d553cecad899f78f26eb8628ee66 2019-04-01 14:33:27 +0200 Even Rouault $")
CPL_CVSID("$Id: gdal_contour.cpp 15d54f60967d9c0d7d63fe22caa6600c50a533a8 2019-04-30 13:00:55 +0200 Even Rouault $")
/************************************************************************/
/* ArgIsNumeric() */
......@@ -73,8 +73,6 @@ static void Usage(const char* pszErrorMsg = nullptr)
static void CreateElevAttrib(const char* pszElevAttrib, OGRLayerH hLayer)
{
OGRFieldDefnH hFld = OGR_Fld_Create( pszElevAttrib, OFTReal );
OGR_Fld_SetWidth( hFld, 12 );
OGR_Fld_SetPrecision( hFld, 3 );
OGRErr eErr = OGR_L_CreateField( hLayer, hFld, FALSE );
OGR_Fld_Destroy( hFld );
if( eErr == OGRERR_FAILURE )
......
#ifndef DOXYGEN_SKIP
/* $Id: gdal_utilities.dox 743d0ce0d7ea6bdc710b6b2950d1e8c34243797f 2019-04-23 08:10:30 -0400 fechen123 $ */
/* $Id: gdal_utilities.dox 40c401fbce5f562c8910a4c6a268ede769c04a9d 2019-05-02 10:43:09 +0200 Even Rouault $ */
#endif /* DOXYGEN_SKIP */
/*!
......@@ -176,7 +176,7 @@ and exit.
\htmlonly
<p>
$Id: gdal_utilities.dox 743d0ce0d7ea6bdc710b6b2950d1e8c34243797f 2019-04-23 08:10:30 -0400 fechen123 $
$Id: gdal_utilities.dox 40c401fbce5f562c8910a4c6a268ede769c04a9d 2019-05-02 10:43:09 +0200 Even Rouault $
</p>
\endhtmlonly
*/
......@@ -227,7 +227,7 @@ of metadata strings.</dd>
"all" can be used to report metadata in all domains</dd>
<dt> <b>-nofl</b></dt><dd> (GDAL >= 1.9.0) Only display the first file of the
file list.</dd>
<dt> <b>-wkt_format</b> <em>WKT1/WKT2/...</em></dt><dd> (GDAL >= 2.5.0) WKT format
<dt> <b>-wkt_format</b> <em>WKT1/WKT2/...</em></dt><dd> (GDAL >= 3.0.0) WKT format
used to display the SRS. Currently supported values are: WKT1,
WKT2 (latest WKT version, currently WKT2_2018), WKT2_2015, WKT2_2018 </dd>
<dt> <b>-sd</b> <i>subdataset</i></dt><dd> (GDAL >= 1.9.0) If the input
......@@ -1417,7 +1417,7 @@ The coordinate systems that can be passed are anything supported by the
OGRSpatialReference.SetFromUserInput() call, which includes EPSG PCS and GCSes
(i.e. EPSG:4296), PROJ.4 declarations (as above), or the name of a .prj file
containing well known text.</dd>
<dt> <b>-ct</b> <em>string</em>:</dt><dd> (GDAL &gt;= 2.5)
<dt> <b>-ct</b> <em>string</em>:</dt><dd> (GDAL &gt;= 3.0)
A PROJ string (single step operation or multiple step string
starting with +proj=pipeline), a WKT2 string describing a CoordinateOperation,
or a urn:ogc:def:coordinateOperation:EPSG::XXXX URN overriding the default
......@@ -1440,7 +1440,7 @@ available GCPs.</dd>
<dt> <em>dstfile</em>:</dt><dd> File with destination projection definition. </dd>
</dl>
Coordinates are read as pairs, triples for 3D or, since GDAL 2.5.0, quadruplets
Coordinates are read as pairs, triples for 3D or, since GDAL 3.0.0, quadruplets
for X,Y,Z,time of numbers per line from standard
input, transformed, and written out to standard output in the same way. All
transformations offered by gdalwarp are handled, including gcp-based ones.
......@@ -2474,7 +2474,7 @@ The following specific options are available :
<dt> <b>-alt</b> <i>altitude</i>:</dt><dd>altitude of the light, in degrees. 90 if the light comes from above the DEM, 0 if it is raking light.</dd>
<dt> <b>-combined</b>:</dt><dd>(starting with GDAL 1.10) combined shading, a combination of slope and oblique shading.</dd>
<dt> <b>-multidirectional</b>:</dt><dd>(starting with GDAL 2.2) multidirectional shading, a combination of hillshading illuminated from 225 deg, 270 deg, 315 deg, and 360 deg azimuth.</dd>
<dt> <b>-igor</b>:</dt><dd>(starting with GDAL 2.5) shading which tries to minimize effects on other map features beneath. Can't be used with -alt option.</dd>
<dt> <b>-igor</b>:</dt><dd>(starting with GDAL 3.0) shading which tries to minimize effects on other map features beneath. Can't be used with -alt option.</dd>
</dl>
Multidirectional hillshading applies the formula of http://pubs.usgs.gov/of/1992/of92-422/of92-422.pdf.
......
......@@ -36,7 +36,7 @@
#include <vector>
CPL_CVSID("$Id: gdalwarp_bin.cpp 2bfb2825ccf7bff1ab4ed0c6bc069cafab1598c3 2019-04-12 19:27:30 +0200 Even Rouault $")
CPL_CVSID("$Id: gdalwarp_bin.cpp 40c401fbce5f562c8910a4c6a268ede769c04a9d 2019-05-02 10:43:09 +0200 Even Rouault $")
/******************************************************************************/
/*! \page gdalwarp gdalwarp
......@@ -94,7 +94,7 @@ containing well known text. Starting with GDAL 2.2, if the SRS has an explicit
vertical datum that points to a PROJ.4 geoidgrids, and the input dataset is a
single band dataset, a vertical correction will be applied to the values of the
dataset.</dd>
<dt> <b>-ct</b> <em>string</em>:</dt><dd> (GDAL &gt;= 2.5)
<dt> <b>-ct</b> <em>string</em>:</dt><dd> (GDAL &gt;= 3.0)
A PROJ string (single step operation or multiple step string
starting with +proj=pipeline), a WKT2 string describing a CoordinateOperation,
or a urn:ogc:def:coordinateOperation:EPSG::XXXX URN overriding the default
......
......@@ -147,7 +147,7 @@ of metadata strings.</dd>
<dt> <b>-noextent</b></dt><dd>(starting with GDAL 2.0) Suppress spatial extent printing.</dd>
<dt> <b>\-\-formats</b>:</dt><dd> List the format drivers that are
enabled.</dd>
<dt> <b>-wkt_format</b> <em>WKT1/WKT2/...</em></dt><dd> (GDAL >= 2.5.0) WKT format
<dt> <b>-wkt_format</b> <em>WKT1/WKT2/...</em></dt><dd> (GDAL >= 3.0) WKT format
used to display the SRS. Currently supported values are: WKT1,
WKT2 (latest WKT version, currently WKT2_2018), WKT2_2015, WKT2_2018 </dd>
<dt> <i>datasource_name</i>:</dt><dd> The data source to open. May be a filename,
......@@ -375,7 +375,7 @@ GDAL 2.1</dd>
<dt> <b>-a_srs</b><em> srs_def</em>:</dt><dd> Assign an output SRS</dd>
<dt> <b>-t_srs</b><em> srs_def</em>:</dt><dd> Reproject/transform to this SRS on output</dd>
<dt> <b>-s_srs</b><em> srs_def</em>:</dt><dd> Override source SRS</dd>
<dt> <b>-ct</b> <em>string</em>:</dt><dd> (GDAL &gt;= 2.5)
<dt> <b>-ct</b> <em>string</em>:</dt><dd> (GDAL &gt;= 3.0)
A PROJ string (single step operation or multiple step string
starting with +proj=pipeline), a WKT2 string describing a CoordinateOperation,
or a urn:ogc:def:coordinateOperation:EPSG::XXXX URN overriding the default
......
gdal (2.5.0~rc1+dfsg-1~exp2) UNRELEASED; urgency=medium
gdal (3.0.0~rc1+dfsg-1~exp1) experimental; urgency=medium
* New upstream release candidate.
* Update watch file to check version directories.
-- Bas Couwenberg <sebastic@debian.org> Thu, 02 May 2019 09:53:30 +0200
-- Bas Couwenberg <sebastic@debian.org> Thu, 02 May 2019 19:21:30 +0200
gdal (2.5.0~rc1+dfsg-1~exp1) experimental; urgency=medium
......
......@@ -7,7 +7,7 @@
<h1>DAAS (Airbus DS Intelligence Data As A Service driver)</h1>
(GDAL/OGR &gt;= 2.5)<p>
(GDAL/OGR &gt;= 3.0)<p>
This driver can connect to the Airbus DS Intelligence Data As A Service API.
GDAL/OGR must be built with Curl support in order for the
......
......@@ -460,7 +460,7 @@ string as the value of PCSCitationGeoKey.</p></li>
<p>Multi-page TIFF files are exposed as subdatasets. A subdataset name is
GTIFF_DIR:{index}:filename.tif, where {index} starts at 1.</p>
<p>Starting with GDAL 2.5.0, subdataset creation is possible by using the
<p>Starting with GDAL 3.0, subdataset creation is possible by using the
APPEND_SUBDATASET=YES creation option. Creating overviews on a multi-page
TIFF is not supported.</p>
......
......@@ -103,7 +103,7 @@
#include "tifvsi.h"
#include "xtiffio.h"
 
CPL_CVSID("$Id: geotiff.cpp 0e555ef8d5bdf8c8020fed298030a8d1598354b2 2019-04-18 19:27:29 +0200 Even Rouault $")
CPL_CVSID("$Id: geotiff.cpp f01a85918e973b637f49cc8d0394fd3c18b22b1f 2019-04-30 18:25:03 +0200 Even Rouault $")
 
static bool bGlobalInExternalOvr = false;
static std::mutex gMutexThreadPool;
......@@ -680,6 +680,8 @@ GTiffJPEGOverviewDS::GTiffJPEGOverviewDS( GTiffDataset* poParentDSIn,
poJPEGDS(nullptr),
nBlockId(-1)
{
ShareLockWithParentDataset(poParentDSIn);
osTmpFilenameJPEGTable.Printf("/vsimem/jpegtable_%p", this);
 
const GByte abyAdobeAPP14RGB[] = {
......@@ -10061,6 +10063,7 @@ CPLErr GTiffDataset::RegisterNewOverviewDataset(toff_t nOverviewOffset,
int l_nJpegQuality)
{
GTiffDataset* poODS = new GTiffDataset();
poODS->ShareLockWithParentDataset(this);
poODS->osFilename = osFilename;
poODS->nJpegQuality = l_nJpegQuality;
poODS->nZLevel = nZLevel;
......@@ -10344,6 +10347,7 @@ CPLErr GTiffDataset::CreateInternalMaskOverviews(int nOvrBlockXSize,
}
 
GTiffDataset *poODS = new GTiffDataset();
poODS->ShareLockWithParentDataset(this);
poODS->osFilename = osFilename;
if( poODS->OpenOffset( hTIFF, ppoActiveDSRef,
nOverviewOffset, false,
......@@ -11522,6 +11526,11 @@ static bool IsStandardColorInterpretation(GDALDataset* poSrcDS,
}
}
}
else if( nPhotometric == PHOTOMETRIC_YCBCR &&
poSrcDS->GetRasterCount() == 3 )
{
// do nothing
}
else
{
bStardardColorInterp = false;
......@@ -14913,6 +14922,7 @@ void GTiffDataset::ScanDirectories()
nOverviewCount < 30 /* to avoid DoS */ )
{
GTiffDataset *poODS = new GTiffDataset();
poODS->ShareLockWithParentDataset(this);
poODS->osFilename = osFilename;
if( poODS->OpenOffset( hTIFF, ppoActiveDSRef, nThisDir, false,
eAccess ) != CE_None
......@@ -14940,6 +14950,7 @@ void GTiffDataset::ScanDirectories()
poMaskDS == nullptr )
{
poMaskDS = new GTiffDataset();
poMaskDS->ShareLockWithParentDataset(this);
poMaskDS->osFilename = osFilename;
 
// The TIFF6 specification - page 37 - only allows 1
......@@ -14983,6 +14994,7 @@ void GTiffDataset::ScanDirectories()
iDirIndex != 1 )
{
GTiffDataset* poDS = new GTiffDataset();
poDS->ShareLockWithParentDataset(this);
poDS->osFilename = osFilename;
if( poDS->OpenOffset( hTIFF, ppoActiveDSRef, nThisDir, FALSE,
eAccess ) != CE_None
......@@ -18812,6 +18824,7 @@ CPLErr GTiffDataset::CreateMaskBand(int nFlagsIn)
return CE_Failure;
 
poMaskDS = new GTiffDataset();
poMaskDS->ShareLockWithParentDataset(this);
poMaskDS->bPromoteTo8Bits =
CPLTestBool(
CPLGetConfigOption("GDAL_TIFF_INTERNAL_MASK_TO_8BIT", "YES"));
......
......@@ -53,7 +53,7 @@ of the underlying HDF5 format.</p>
<h2>VSI Virtual File System API support</h2>
Since GDAL 2.5.0, read-only operations on /vsi file systems are supported.
Since GDAL 3.0, read-only operations on /vsi file systems are supported.
<h2>See Also:</h2>
......
......@@ -48,7 +48,7 @@
#include <memory>
#include <vector>
CPL_CVSID("$Id: mbtilesdataset.cpp 3189229c71a9620126f6b349f4f80399baeaf528 2019-04-20 20:33:36 +0200 Even Rouault $")
CPL_CVSID("$Id: mbtilesdataset.cpp 2bd6bbffd0448037745dc5c7acdff09f4109ca3e 2019-05-02 11:32:48 +0200 Even Rouault $")
static const char * const apszAllowedDrivers[] = {"JPEG", "PNG", nullptr};
......@@ -1162,6 +1162,7 @@ CPLErr MBTilesDataset::FinalizeRasterRegistration()
for(int i=0; i<m_nOverviewCount; i++)
{
MBTilesDataset* poOvrDS = new MBTilesDataset();
poOvrDS->ShareLockWithParentDataset(this);
int nBlockSize;
GetRasterBand(1)->GetBlockSize(&nBlockSize, &nBlockSize);
poOvrDS->InitRaster ( this, i, nBands,
......@@ -2832,6 +2833,7 @@ GDALDataset* MBTilesDataset::Open(GDALOpenInfo* poOpenInfo)
for( int iLevel = nMaxLevel - 1; iLevel >= nMinLevel; iLevel-- )
{
MBTilesDataset* poOvrDS = new MBTilesDataset();
poOvrDS->ShareLockWithParentDataset(poDS);
poOvrDS->InitRaster ( poDS, iLevel, nBands, nTileSize,
dfMinX, dfMinY, dfMaxX, dfMaxY );
......
......@@ -343,9 +343,9 @@ The driver has undergone significant changes in GDAL 1.9.0, see NEWS file and <a
Since GDAL 2.4, and with Linux kernel &gt;=4.3 and libnetcdf &gt;=4.5,
read operations on /vsi file systems are supported.<p>
<h2>NetCDF-4 groups support on reading (GDAL >= 2.5.0)</h2>
<h2>NetCDF-4 groups support on reading (GDAL >= 3.0)</h2>
The driver has undergone significant changes in GDAL 2.5.0 to support NetCDF-4 groups on reading:
The driver has undergone significant changes in GDAL 3.0 to support NetCDF-4 groups on reading:
<ul>
<li><p>Explore recursively all nested groups to create the subdatasets list</p></li>
<li><p>Subdatasets in nested groups use the /group1/group2/.../groupn/var standard NetCDF-4 convention, except for variables in the root group which do not have a leading slash for backward compatibility with the NetCDF-3 driver</p></li>
......
......@@ -39,7 +39,7 @@ interface in the "xml:PDS4" metadata domain.</p>
<h2>Open options (vector only)</h2>
(Starting with GDAL 2.5.0)
(Starting with GDAL 3.0)
<p>When opening a PDS4 vector dataset, the following open options are available:</p>
......@@ -93,8 +93,8 @@ Array_2D_Spectrum/Array_3D/Array_3D_Image/Array_3D_Movie/Array_3D_Spectrum.
To set the XML element that defines the type of array. Defaults to Array_3D_Image.
Using a Array_2D* for a multiband image is not supported. When using a
Array_2D* value, INTERLEAVE will be ignored.</li>
<li> <b>ARRAY_IDENTIFIER</b>=string. (GDAL &gt;= 2.5.0) Identifier to put in the Array element.</li>
<li> <b>UNIT</b>=string. (GDAL &gt;= 2.5.0) Content of the Element_Array.unit.
<li> <b>ARRAY_IDENTIFIER</b>=string. (GDAL &gt;= 3.0) Identifier to put in the Array element.</li>
<li> <b>UNIT</b>=string. (GDAL &gt;= 3.0) Content of the Element_Array.unit.
If not provided, the unit of the source band in case of copying from another
raster will be used (if present on the source band).</li>
</ul>
......@@ -131,7 +131,7 @@ bounding box</li>
<h2>Layer creation options (vector/table datasets)</h2>
(Starting with GDAL 2.5.0)
(Starting with GDAL 3.0)
When creating a PDS4 vector dataset, or appending a new table to an existing
table, the following layer creation options are available:
......@@ -175,7 +175,7 @@ If several Array objects are present in the label, they will be reported as
separate subdatasets (typically the main subdataset is an Array3D, and
backplanes are represented as Array2D).</p>
<p>Since GDAL 2.5.0, creation of new datasets with
<p>Since GDAL 3.0, creation of new datasets with
subdatasets is supported (through the APPEND_SUBDATASET=YES creation option).
One important restriction is that, given that the georeferencing information in
the PDS4 XML label is global for the whole dataset, all subdatasets must share
......
......@@ -7,7 +7,7 @@
*
* Author: David Zwarg, dzwarg@azavea.com
*
* Last changes: $Id: postgisrasterdataset.cpp 3189229c71a9620126f6b349f4f80399baeaf528 2019-04-20 20:33:36 +0200 Even Rouault $
* Last changes: $Id: postgisrasterdataset.cpp 2bd6bbffd0448037745dc5c7acdff09f4109ca3e 2019-05-02 11:32:48 +0200 Even Rouault $
*
***********************************************************************
* Copyright (c) 2009 - 2013, Jorge Arevalo, David Zwarg
......@@ -41,7 +41,7 @@
#include <algorithm>
#include <memory>
CPL_CVSID("$Id: postgisrasterdataset.cpp 3189229c71a9620126f6b349f4f80399baeaf528 2019-04-20 20:33:36 +0200 Even Rouault $")
CPL_CVSID("$Id: postgisrasterdataset.cpp 2bd6bbffd0448037745dc5c7acdff09f4109ca3e 2019-05-02 11:32:48 +0200 Even Rouault $")
#ifdef _WIN32
#define rint(x) floor((x) + 0.5)
......@@ -698,6 +698,7 @@ void PostGISRasterDataset::BuildOverviews()
for(iOV = 0; iOV < nOV; iOV++)
{
PostGISRasterDataset* poOvrDS = new PostGISRasterDataset();
poOvrDS->ShareLockWithParentDataset(this);
poOvrDS->nOverviewFactor = poOV[iOV].nFactor;
poOvrDS->poConn = poConn;
poOvrDS->eAccess = eAccess;
......@@ -1760,6 +1761,7 @@ PostGISRasterTileDataset* PostGISRasterDataset::BuildRasterTileDataset(const cha
PostGISRasterTileDataset* poRTDS =
new PostGISRasterTileDataset(this, l_nTileWidth, l_nTileHeight);
poRTDS->ShareLockWithParentDataset(this);
if (GetPrimaryKeyRef() != nullptr)
{
......
......@@ -9,7 +9,7 @@
<h1>TileDB - TileDB</h1>
<p>Starting with GDAL 2.5.0, GDAL can read and write TileDB arrays through the TileDB library.</p>
<p>Starting with GDAL 3.0, GDAL can read and write TileDB arrays through the TileDB library.</p>
<p>The driver relies on the Open Source TileDB <a href="https://github.com/TileDB-Inc/TileDB">library</a> (MIT licensed).</p>
......
......@@ -32,7 +32,7 @@
#include "tiledb_headers.h"
CPL_CVSID("$Id: tiledbdataset.cpp 7601a637dfd204948d00f4691c08f02eb7584de5 2019-04-12 04:29:21 -0500 Norman Barker $")
CPL_CVSID("$Id: tiledbdataset.cpp abb043f224398c49bf0468ff50e5082892cea901 2019-05-01 18:13:18 -0500 Norman Barker $")
const CPLString TILEDB_VALUES( "TDB_VALUES" );
......@@ -61,6 +61,7 @@ class TileDBDataset : public GDALPamDataset
char **papszSubDatasets = nullptr;
CPLStringList m_osSubdatasetMD{};
CPLXMLNode* psSubDatasetsTree = nullptr;
CPLString osMetaDoc;
std::unique_ptr<tiledb::Context> m_ctx;
std::unique_ptr<tiledb::Array> m_array;
......@@ -74,10 +75,10 @@ class TileDBDataset : public GDALPamDataset
public:
virtual ~TileDBDataset();
CPLErr TryLoadCachedXML(char **papszSiblingFiles = nullptr, bool bReload=true);
CPLErr TryLoadXML(char **papszSiblingFiles = nullptr) override;
CPLErr TrySaveXML() override;
char** GetMetadata(const char *pszDomain) override;
static GDALDataset *Open( GDALOpenInfo * );
static int Identify( GDALOpenInfo * );
static CPLErr Delete( const char * pszFilename );
......@@ -114,7 +115,6 @@ class TileDBRasterBand : public GDALPamRasterBand
protected:
TileDBDataset *poGDS;
bool bStats;
bool bAdviseRead = false;
CPLString osAttrName;
std::unique_ptr<tiledb::Query> m_query;
void Finalize( );
......@@ -123,15 +123,7 @@ class TileDBRasterBand : public GDALPamRasterBand
virtual CPLErr IReadBlock( int, int, void * ) override;
virtual CPLErr IWriteBlock( int, int, void * ) override;
virtual GDALColorInterp GetColorInterpretation() override;
virtual CPLErr AdviseRead(
int nXOff,
int nYOff,
int nXSize,
int nYSize,
int nBufXSize,
int nBufYSize,
GDALDataType eBufType,
char ** papszOptions ) override;
};
/************************************************************************/
......@@ -220,12 +212,13 @@ TileDBRasterBand::TileDBRasterBand(
m_query->set_layout( TILEDB_ROW_MAJOR );
// initialize to complete image block layout
std::vector<size_t> oaSubarray = { 0,
std::vector<size_t> oaSubarray = { size_t( nBand ),
size_t( nBand ),
0,
size_t( poDSIn->nBlocksY * nBlockYSize ) - 1,
0,
size_t( poDSIn->nBlocksX * nBlockXSize ) - 1,
size_t( nBand ),
size_t( nBand ) };
};
if ( EQUAL( TILEDB_VALUES, osAttrName ) )
{
......@@ -235,7 +228,8 @@ TileDBRasterBand::TileDBRasterBand(
{
m_query->set_subarray( std::vector<size_t> (
oaSubarray.cbegin(), oaSubarray.cbegin() + 4 ) );
oaSubarray.cbegin() + 2,
oaSubarray.cend() ) );
}
}
......@@ -252,51 +246,6 @@ void TileDBRasterBand::Finalize()
}
}
/************************************************************************/
/* AdviseRead() */
/************************************************************************/
CPLErr TileDBRasterBand::AdviseRead(
int nXOff,
int nYOff,
int nXSize,
int nYSize,
CPL_UNUSED int nBufXSize,
CPL_UNUSED int nBufYSize,
CPL_UNUSED GDALDataType eBufType,
CPL_UNUSED char ** papszOptions
)
{
bAdviseRead = true;
// find min and max blockss
size_t nStartX = (size_t) ( nXOff / nBlockXSize ) * nBlockXSize;
size_t nStartY = (size_t) ( nYOff / nBlockYSize ) * nBlockYSize;
size_t nEndX = (size_t) DIV_ROUND_UP( nXOff + nXSize, nBlockXSize ) * nBlockXSize;
size_t nEndY = (size_t) DIV_ROUND_UP( nYOff + nYSize, nBlockYSize ) * nBlockYSize;
std::vector<size_t> oaSubarray = {
(size_t) nStartY,
(size_t) nEndY - 1,
(size_t) nStartX,
(size_t) nEndX - 1,
size_t( nBand ),
size_t( nBand ) };
if ( EQUAL( TILEDB_VALUES, osAttrName ) )
{
m_query->set_subarray( oaSubarray );
}
else
{
m_query->set_subarray( std::vector<size_t> (
oaSubarray.cbegin(), oaSubarray.cbegin() + 4 ) );
}
return CE_None;
}
/************************************************************************/
/* IReadBlock() */
/************************************************************************/
......@@ -304,8 +253,6 @@ CPLErr TileDBRasterBand::AdviseRead(
CPLErr TileDBRasterBand::IReadBlock( int nBlockXOff,
int nBlockYOff,
void * pImage )
{
if ( !bAdviseRead )
{
int nStartX = nBlockXSize * nBlockXOff;
int nStartY = nBlockYSize * nBlockYOff;
......@@ -313,12 +260,12 @@ CPLErr TileDBRasterBand::IReadBlock( int nBlockXOff,
size_t nEndY = nStartY + nBlockYSize;
std::vector<size_t> oaSubarray = {
size_t( nBand ),
size_t( nBand ),
(size_t) nStartY,
(size_t) nEndY - 1,
(size_t) nStartX,
(size_t) nEndX - 1,
size_t( nBand ),
size_t( nBand ) };
(size_t) nEndX - 1 };
if ( EQUAL( TILEDB_VALUES, osAttrName ) )
{
......@@ -327,8 +274,8 @@ CPLErr TileDBRasterBand::IReadBlock( int nBlockXOff,
else
{
m_query->set_subarray( std::vector<size_t> (
oaSubarray.cbegin(), oaSubarray.cbegin() + 4 ) );
}
oaSubarray.cbegin() + 2,
oaSubarray.cend() ) );
}
SetBuffer(m_query.get(), eDataType, osAttrName,
......@@ -617,7 +564,17 @@ CPLErr TileDBDataset::TrySaveXML()
/* TryLoadXML() */
/************************************************************************/
CPLErr TileDBDataset::TryLoadXML( char ** /*papszSiblingFiles*/ )
CPLErr TileDBDataset::TryLoadXML( char ** papszSiblingFiles )
{
return TryLoadCachedXML( papszSiblingFiles, true );
}
/************************************************************************/
/* TryLoadCachedXML() */
/************************************************************************/
CPLErr TileDBDataset::TryLoadCachedXML( char ** /*papszSiblingFiles*/, bool bReload )
{
CPLXMLNode *psTree = nullptr;
......@@ -657,16 +614,23 @@ CPLErr TileDBDataset::TryLoadXML( char ** /*papszSiblingFiles*/ )
CPLErrorHandlerPusher oQuietError( CPLQuietErrorHandler );
if ( vfs.is_file( psPam->pszPamFilename ) )
{
if ( bReload )
{
auto nBytes = vfs.file_size( psPam->pszPamFilename );
tiledb::VFS::filebuf fbuf( vfs );
fbuf.open( psPam->pszPamFilename, std::ios::in );
std::istream is ( &fbuf );
CPLString osDoc;
osDoc.resize(nBytes);
is.read( ( char* ) osDoc.data(), nBytes );
osMetaDoc.resize(nBytes);
is.read( ( char* ) osMetaDoc.data(), nBytes );
fbuf.close();
psTree = CPLParseXMLString( osDoc );
psTree = CPLParseXMLString( osMetaDoc );
}
else
{
psTree = CPLParseXMLString( osMetaDoc );
}
}
}
CPLErrorReset();
......@@ -965,8 +929,10 @@ GDALDataset *TileDBDataset::Open( GDALOpenInfo * poOpenInfo )
{
if ( dims.size() == 3 )
{
poDS->nBands = dims[2].domain<size_t>().second
- dims[2].domain<size_t>().first + 1;
poDS->nBands = dims[0].domain<size_t>().second
- dims[0].domain<size_t>().first + 1;
poDS->nBlockYSize = dims[1].tile_extent<size_t>();
poDS->nBlockXSize = dims[2].tile_extent<size_t>();
}
else
{
......@@ -975,11 +941,10 @@ GDALDataset *TileDBDataset::Open( GDALOpenInfo * poOpenInfo )
if ( pszBands )
{
poDS->nBands = atoi( pszBands );
poDS->nBlockYSize = dims[0].tile_extent<size_t>();
poDS->nBlockXSize = dims[1].tile_extent<size_t>();
}
}
poDS->nBlockXSize = dims[0].tile_extent<size_t>();
poDS->nBlockYSize = dims[1].tile_extent<size_t>();
}
else
{
......@@ -1092,6 +1057,9 @@ GDALDataset *TileDBDataset::Open( GDALOpenInfo * poOpenInfo )
}
}
// reload metadata now that bands are created to populate band metadata
poDS->TryLoadCachedXML( nullptr, false );
tiledb::VFS vfs( *poDS->m_ctx, poDS->m_ctx->config() );
if ( vfs.is_dir( osArrayPath ) )
......@@ -1408,6 +1376,7 @@ TileDBDataset* TileDBDataset::CreateLL( const char *pszFilename,
// Note the dimension bounds are inclusive and are expanded to the match the block size
poDS->nBlocksX = DIV_ROUND_UP( nXSize, poDS->nBlockXSize );
poDS->nBlocksY = DIV_ROUND_UP( nYSize, poDS->nBlockYSize );
size_t w = poDS->nBlocksX * poDS->nBlockXSize - 1;
size_t h = poDS->nBlocksY * poDS->nBlockYSize - 1;
......@@ -1415,11 +1384,12 @@ TileDBDataset* TileDBDataset::CreateLL( const char *pszFilename,
*poDS->m_ctx, "X", {0, w},
size_t( poDS->nBlockXSize ) );
auto d2 = tiledb::Dimension::create<size_t>( *poDS->m_ctx, "Y", {0, h}, size_t( poDS->nBlockYSize ) );
if ( nBands > 0 )
{
auto d3 = tiledb::Dimension::create<size_t>( *poDS->m_ctx, "BANDS", {1, size_t( nBands )}, 1);
// row-major
domain.add_dimensions( d2, d1, d3 );
domain.add_dimensions( d3, d2, d1 );
}
else
{
......@@ -1427,7 +1397,7 @@ TileDBDataset* TileDBDataset::CreateLL( const char *pszFilename,
domain.add_dimensions( d2, d1 );
}
poDS->m_schema->set_domain( domain );
poDS->m_schema->set_domain( domain ).set_order({{TILEDB_ROW_MAJOR, TILEDB_ROW_MAJOR}});;
return poDS.release();
}
......
#ifndef DOXYGEN_SKIP
/* $Id: vrt_tutorial.dox 8e5eeb35bf76390e3134a4ea7076dab7d478ea0e 2018-11-14 22:55:13 +0100 Even Rouault $ */
/* $Id: vrt_tutorial.dox 40c401fbce5f562c8910a4c6a268ede769c04a9d 2019-05-02 10:43:09 +0200 Even Rouault $ */
#endif /* DOXYGEN_SKIP */
/*!
......@@ -97,7 +97,7 @@ known GEOGCS names, and PROJ.4 format) is also allowed in the SRS element.
<SRS dataAxisToSRSAxisMapping="1,2">PROJCS[&quot;NAD27 / UTM zone 11N&quot;,GEOGCS[&quot;NAD27&quot;,DATUM[&quot;North_American_Datum_1927&quot;,SPHEROID[&quot;Clarke 1866&quot;,6378206.4,294.9786982139006,AUTHORITY[&quot;EPSG&quot;,&quot;7008&quot;]],AUTHORITY[&quot;EPSG&quot;,&quot;6267&quot;]],PRIMEM[&quot;Greenwich&quot;,0],UNIT[&quot;degree&quot;,0.0174532925199433],AUTHORITY[&quot;EPSG&quot;,&quot;4267&quot;]],PROJECTION[&quot;Transverse_Mercator&quot;],PARAMETER[&quot;latitude_of_origin&quot;,0],PARAMETER[&quot;central_meridian&quot;,-117],PARAMETER[&quot;scale_factor&quot;,0.9996],PARAMETER[&quot;false_easting&quot;,500000],PARAMETER[&quot;false_northing&quot;,0],UNIT[&quot;metre&quot;,1,AUTHORITY[&quot;EPSG&quot;,&quot;9001&quot;]],AUTHORITY[&quot;EPSG&quot;,&quot;26711&quot;]]</SRS>
\endcode
The <i>dataAxisToSRSAxisMapping</i> attribute is allowed since GDAL 2.5 to
The <i>dataAxisToSRSAxisMapping</i> attribute is allowed since GDAL 3.0 to
describe the relationship between the axis indicated in the CRS definition and
the axis of the GeoTransform or GCP metadata. The value of the attribute is a comma
separated list of integers. The number of elements of this list must be the
......
/******************************************************************************
* $Id: gdal_priv.h 7d34df879ac151e8cc377ecd5d0107c579b0c0a2 2019-04-25 12:22:24 +0200 Even Rouault $
* $Id: gdal_priv.h f01a85918e973b637f49cc8d0394fd3c18b22b1f 2019-04-30 18:25:03 +0200 Even Rouault $
*
* Name: gdal_priv.h
* Project: GDAL Core
......@@ -424,6 +424,8 @@ class CPL_DLL GDALDataset : public GDALMajorObject
GDALRasterIOExtraArg* psExtraArg,
int* pbTried);
void ShareLockWithParentDataset(GDALDataset* poParentDataset);
//! @endcond
virtual int CloseDependentDatasets();
//! @cond Doxygen_Suppress
......