Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from OSGeo:master #196

Merged
merged 11 commits into from
Feb 19, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,6 @@ Supported Formats: (ro:read-only, rw:read-write, +:write from scratch, u:update,
ENVI -raster- (rw+uv): ENVI .hdr Labelled
EHdr -raster- (rw+uv): ESRI .hdr Labelled (*.bil)
ISCE -raster- (rw+v): ISCE raster
Zarr -raster,multidimensional raster- (rw+uvs): Zarr
Zarr -raster,multidimensional raster- (rw+uvs): Zarr (*.zarr)
RCM -raster- (rovs): Radarsat Constellation Mission XML Product
HTTP -raster,vector- (ro): HTTP Fetching Wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,6 @@ Supported Formats: (ro:read-only, rw:read-write, +:write from scratch, u:update,
ENVI -raster- (rw+uv): ENVI .hdr Labelled
EHdr -raster- (rw+uv): ESRI .hdr Labelled (*.bil)
ISCE -raster- (rw+v): ISCE raster
Zarr -raster,multidimensional raster- (rw+uvs): Zarr
Zarr -raster,multidimensional raster- (rw+uvs): Zarr (*.zarr)
RCM -raster- (rovs): Radarsat Constellation Mission XML Product
HTTP -raster,vector- (ro): HTTP Fetching Wrapper
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ XODR driver:
* Fix typo in handling of Translate widthPct, heightPct
* add relatedFieldNameMatch parameter to gdal.VectorTranslate()

# GDAL/OGR 3.10.2 Release Notes
# GDAL/OGR 3.10.2 "Gulf of Mexico" Release Notes

GDAL 3.10.2 is a bugfix release.

Expand Down
16 changes: 0 additions & 16 deletions alg/gdal_alg.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,6 @@ CPLErr CPL_DLL CPL_STDCALL GDALSieveFilter(
* Warp Related.
*/

/**
* Callback to transforms points.
*
* @param pTransformerArg return value from a GDALCreateXXXXTransformer() function
* @param bDstToSrc TRUE if transformation is from the destination
* (georeferenced) coordinates to pixel/line or FALSE when transforming
* from pixel/line to georeferenced coordinates.
* @param nPointCount the number of values in the x, y and z arrays.
* @param[in,out] x array containing the X values to be transformed. Must not be NULL.
* @param[in,out] y array containing the Y values to be transformed. Must not be NULL.
* @param[in,out] z array containing the Z values to be transformed. Must not be NULL.
* @param[out] panSuccess array in which a flag indicating success (TRUE) or
* failure (FALSE) of the transformation are placed. Must not be NULL.
*
* @return TRUE if all points have been successfully transformed.
*/
typedef int (*GDALTransformerFunc)(void *pTransformerArg, int bDstToSrc,
int nPointCount, double *x, double *y,
double *z, int *panSuccess);
Expand Down
14 changes: 7 additions & 7 deletions alg/gdaltransformer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,17 @@ will be from the source coordinate system to the destination coordinate system.

@param nPointCount number of points in the x, y and z arrays.

@param x input X coordinates. Results returned in same array.
@param[in,out] x input X coordinates. Results returned in same array.

@param y input Y coordinates. Results returned in same array.
@param[in,out] y input Y coordinates. Results returned in same array.

@param z input Z coordinates. Results returned in same array.
@param[in,out] z input Z coordinates. Results returned in same array.

@param panSuccess array of ints in which success (TRUE) or failure (FALSE)
flags are returned for the translation of each point.
@param[out] panSuccess array of ints in which success (TRUE) or failure (FALSE)
flags are returned for the translation of each point. Must not be NULL.

@return TRUE if the overall transformation succeeds (though some individual
points may have failed) or FALSE if the overall transformation fails.
@return TRUE if all points have been successfully transformed (changed in 3.11,
previously was TRUE if some points have been successfully transformed)

*/

Expand Down
3 changes: 3 additions & 0 deletions autotest/ogr/data/csv/unbalanced_double_quotes.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
id,txt
1,"foo""
2,bar
16 changes: 16 additions & 0 deletions autotest/ogr/ogr_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -3482,6 +3482,22 @@ def test_ogr_schema_override_wkt(tmp_vsimem):
assert f.GetGeometryRef().ExportToWkt() == "POINT (1 2)"


###############################################################################
# Test reading CSV with unbalanced double-quotes


@gdaltest.enable_exceptions()
def test_ogr_csv_unbalanced_double_quotes():

with ogr.Open("data/csv/unbalanced_double_quotes.csv") as ds:
lyr = ds.GetLayer(0)
with pytest.raises(
Exception,
match="CSV file has unbalanced number of double-quotes. Corrupted data will likely be returned",
):
lyr.GetNextFeature()


###############################################################################


Expand Down
24 changes: 23 additions & 1 deletion autotest/ogr/ogr_hana.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#
# SPDX-License-Identifier: MIT
###############################################################################
from datetime import datetime, timedelta
from os import environ

import gdaltest
Expand Down Expand Up @@ -48,8 +49,11 @@ def setup_driver():
conn,
"SELECT REPLACE(CURRENT_UTCDATE, '-', '') || '_' || BINTOHEX(SYSUUID) FROM DUMMY;",
)
gdaltest.hana_schema_name = "{}_{}".format("gdal_test", uid)
schema_prefix = "gdal_test"

drop_old_test_schemas(conn, schema_prefix)

gdaltest.hana_schema_name = f"{schema_prefix}_{uid}"
execute_sql(conn, f'CREATE SCHEMA "{gdaltest.hana_schema_name}"')

ds = open_datasource(1)
Expand Down Expand Up @@ -1375,6 +1379,24 @@ def execute_sql_scalar(conn, sql):
return res


def drop_old_test_schemas(conn, schema_prefix):
try:
assert conn
cursor = conn.cursor()
assert cursor
sql = f"""SELECT SCHEMA_NAME FROM SYS.SCHEMAS WHERE SCHEMA_NAME
LIKE '{schema_prefix.replace('_', '__')}__%' ESCAPE '_' AND
LOCALTOUTC(CREATE_TIME) < ?"""
cursor.execute(sql, datetime.now() - timedelta(days=1))
rows = cursor.fetchall()
cursor.close()
for row in rows:
execute_sql(conn, f'DROP SCHEMA "{row["SCHEMA_NAME"]}" CASCADE')
except Exception as ex:
print(f"Unable to drop old test schemas. Error: {ex}")
pass


def open_datasource(update=0, open_opts=None):
conn_str = "HANA:" + get_connection_str() + ";SCHEMA=" + gdaltest.hana_schema_name
if open_opts is None:
Expand Down
84 changes: 46 additions & 38 deletions doc/source/_extensions/driverproperties.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,73 +22,73 @@
def setup(app):
app.add_node(
shortname,
html=(visit_shortname_node, depart_node),
latex=(visit_admonition, depart_node),
text=(visit_admonition, depart_node),
html=(visit_shortname_node_html, depart_node_html),
latex=(visit_admonition_generic, depart_node_generic),
text=(visit_admonition_generic, depart_node_generic),
)
app.add_directive("shortname", ShortName)

app.add_node(
built_in_by_default,
html=(visit_built_in_by_default_node, depart_node),
latex=(visit_admonition, depart_node),
text=(visit_admonition, depart_node),
html=(visit_built_in_by_default_node_html, depart_node_html),
latex=(visit_admonition_generic, depart_node_generic),
text=(visit_admonition_generic, depart_node_generic),
)
app.add_directive("built_in_by_default", BuiltInByDefault)

app.add_node(
build_dependencies,
html=(visit_build_dependencies_node, depart_node),
latex=(visit_admonition, depart_node),
text=(visit_admonition, depart_node),
html=(visit_build_dependencies_node_html, depart_node_html),
latex=(visit_admonition_generic, depart_node_generic),
text=(visit_admonition_generic, depart_node_generic),
)
app.add_directive("build_dependencies", BuildDependencies)

app.add_node(
supports_create,
html=(visit_supports_create_node, depart_node),
latex=(visit_admonition, depart_node),
text=(visit_admonition, depart_node),
html=(visit_supports_create_node_html, depart_node_html),
latex=(visit_admonition_generic, depart_node_generic),
text=(visit_admonition_generic, depart_node_generic),
)
app.add_directive("supports_create", CreateDirective)

app.add_node(
supports_createcopy,
html=(visit_supports_createcopy_node, depart_node),
latex=(visit_admonition, depart_node),
text=(visit_admonition, depart_node),
html=(visit_supports_createcopy_node_html, depart_node_html),
latex=(visit_admonition_generic, depart_node_generic),
text=(visit_admonition_generic, depart_node_generic),
)
app.add_directive("supports_createcopy", CreateCopyDirective)

app.add_node(
supports_georeferencing,
html=(visit_supports_georeferencing_node, depart_node),
latex=(visit_admonition, depart_node),
text=(visit_admonition, depart_node),
html=(visit_supports_georeferencing_node_html, depart_node_html),
latex=(visit_admonition_generic, depart_node_generic),
text=(visit_admonition_generic, depart_node_generic),
)
app.add_directive("supports_georeferencing", GeoreferencingDirective)

app.add_node(
supports_virtualio,
html=(visit_supports_virtualio_node, depart_node),
latex=(visit_admonition, depart_node),
text=(visit_admonition, depart_node),
html=(visit_supports_virtualio_node_html, depart_node_html),
latex=(visit_admonition_generic, depart_node_generic),
text=(visit_admonition_generic, depart_node_generic),
)
app.add_directive("supports_virtualio", VirtualIODirective)

app.add_node(
supports_multidimensional,
html=(visit_supports_multidimensional_node, depart_node),
latex=(visit_admonition, depart_node),
text=(visit_admonition, depart_node),
html=(visit_supports_multidimensional_node_html, depart_node_html),
latex=(visit_admonition_generic, depart_node_generic),
text=(visit_admonition_generic, depart_node_generic),
)
app.add_directive("supports_multidimensional", MultiDimensionalDirective)

app.add_node(
deprecated_driver,
html=(visit_deprecated_driver_node, depart_node),
latex=(visit_admonition, depart_node),
text=(visit_admonition, depart_node),
html=(visit_deprecated_driver_node_html, depart_node_html),
latex=(visit_admonition_generic, depart_node_generic),
text=(visit_admonition_generic, depart_node_generic),
)
app.add_directive("deprecated_driver", DeprecatedDriverDirective)

Expand All @@ -100,27 +100,35 @@ def setup(app):
from docutils import nodes


def visit_admonition(self, node):
def visit_admonition_generic(self, node):
self.visit_admonition(node)


def depart_node(self, node):
def depart_node_generic(self, node):
self.depart_admonition(node)


def visit_admonition_html(self, node, name: str = ""):
self.body.append(self.starttag(node, "div", CLASS=("admonition " + name)))


def depart_node_html(self, node):
self.body.append("</div>\n")


class shortname(nodes.Admonition, nodes.Element):
pass


def visit_shortname_node(self, node):
def visit_shortname_node_html(self, node):
self.body.append(self.starttag(node, "div", CLASS=("admonition shortname")))


class built_in_by_default(nodes.Admonition, nodes.Element):
pass


def visit_built_in_by_default_node(self, node):
def visit_built_in_by_default_node_html(self, node):
self.body.append(
self.starttag(node, "div", CLASS=("admonition built_in_by_default"))
)
Expand All @@ -130,7 +138,7 @@ class build_dependencies(nodes.Admonition, nodes.Element):
pass


def visit_build_dependencies_node(self, node):
def visit_build_dependencies_node_html(self, node):
self.body.append(
self.starttag(node, "div", CLASS=("admonition build_dependencies"))
)
Expand All @@ -140,15 +148,15 @@ class supports_create(nodes.Admonition, nodes.Element):
pass


def visit_supports_create_node(self, node):
def visit_supports_create_node_html(self, node):
self.body.append(self.starttag(node, "div", CLASS=("admonition supports_create")))


class supports_createcopy(nodes.Admonition, nodes.Element):
pass


def visit_supports_createcopy_node(self, node):
def visit_supports_createcopy_node_html(self, node):
self.body.append(
self.starttag(node, "div", CLASS=("admonition supports_createcopy"))
)
Expand All @@ -158,7 +166,7 @@ class supports_georeferencing(nodes.Admonition, nodes.Element):
pass


def visit_supports_georeferencing_node(self, node):
def visit_supports_georeferencing_node_html(self, node):
self.body.append(
self.starttag(node, "div", CLASS=("admonition supports_georeferencing"))
)
Expand All @@ -168,7 +176,7 @@ class supports_virtualio(nodes.Admonition, nodes.Element):
pass


def visit_supports_virtualio_node(self, node):
def visit_supports_virtualio_node_html(self, node):
self.body.append(
self.starttag(node, "div", CLASS=("admonition supports_virtualio"))
)
Expand All @@ -178,7 +186,7 @@ class supports_multidimensional(nodes.Admonition, nodes.Element):
pass


def visit_supports_multidimensional_node(self, node):
def visit_supports_multidimensional_node_html(self, node):
self.body.append(
self.starttag(node, "div", CLASS=("admonition supports_multidimensional"))
)
Expand All @@ -188,7 +196,7 @@ class deprecated_driver(nodes.Admonition, nodes.Element):
pass


def visit_deprecated_driver_node(self, node):
def visit_deprecated_driver_node_html(self, node):
self.body.append(self.starttag(node, "div", CLASS=("danger deprecated_driver")))


Expand Down
2 changes: 1 addition & 1 deletion doc/source/about_no_title.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GDAL is a translator library for raster and vector geospatial data formats that is released under an MIT style Open Source :ref:`license` by the `Open Source Geospatial Foundation`_. As a library, it presents a single raster abstract data model and single vector abstract data model to the calling application for all supported formats. It also comes with a variety of useful command line utilities for data translation and processing. The `NEWS`_ page describes the February 2025 GDAL/OGR 3.10.2 release.
GDAL is a translator library for raster and vector geospatial data formats that is released under an MIT style Open Source :ref:`license` by the `Open Source Geospatial Foundation`_. As a library, it presents a single raster abstract data model and single vector abstract data model to the calling application for all supported formats. It also comes with a variety of useful command line utilities for data translation and processing. The `NEWS`_ page describes the February 2025 GDAL/OGR 3.10.2 "Gulf Of Mexico" release.

.. only:: html

Expand Down
4 changes: 2 additions & 2 deletions doc/source/download.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Source Code
Current Release
...............

* **2025-02-14** `gdal-3.10.2.tar.gz`_ `3.10.2 Release Notes`_ (`3.10.2 md5`_)
* **2025-02-14** `gdal-3.10.2.tar.gz`_ `3.10.2 "Gulf of Mexico" Release Notes`_ (`3.10.2 md5`_)

.. _`3.10.2 Release Notes`: https://github.com/OSGeo/gdal/blob/v3.10.2/NEWS.md
.. _`3.10.2 "Gulf of Mexico" Release Notes`: https://github.com/OSGeo/gdal/blob/v3.10.2/NEWS.md
.. _`gdal-3.10.2.tar.gz`: https://github.com/OSGeo/gdal/releases/download/v3.10.2/gdal-3.10.2.tar.gz
.. _`3.10.2 md5`: https://github.com/OSGeo/gdal/releases/download/v3.10.2/gdal-3.10.2.tar.gz.md5

Expand Down
1 change: 1 addition & 0 deletions frmts/zarr/zarrdrivercore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ void ZARRDriverSetCommonMetadata(GDALDriver *poDriver)
poDriver->SetMetadataItem(GDAL_DCAP_RASTER, "YES");
poDriver->SetMetadataItem(GDAL_DCAP_MULTIDIM_RASTER, "YES");
poDriver->SetMetadataItem(GDAL_DMD_LONGNAME, "Zarr");
poDriver->SetMetadataItem(GDAL_DMD_EXTENSION, "zarr");
poDriver->SetMetadataItem(
GDAL_DMD_CREATIONDATATYPES,
"Int8 Byte Int16 UInt16 Int32 UInt32 Int64 UInt64 "
Expand Down
8 changes: 8 additions & 0 deletions port/cpl_csv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,14 @@ CSVReadParseLineGeneric(void *fp, const char *(*pfnReadLine)(void *, size_t),
{
CPLError(CE_Failure, CPLE_OutOfMemory, "%s", e.what());
}

if (bInString)
{
CPLError(CE_Failure, CPLE_AppDefined,
"CSV file has unbalanced number of double-quotes. Corrupted "
"data will likely be returned");
}

return nullptr;
}

Expand Down
Loading