pyogrio 0.7.2__cp310-cp310-win_amd64.whl → 0.9.0__cp310-cp310-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pyogrio might be problematic. Click here for more details.

Files changed (83) hide show
  1. pyogrio/__init__.py +7 -3
  2. pyogrio/_compat.py +6 -1
  3. pyogrio/_err.c +855 -321
  4. pyogrio/_err.cp310-win_amd64.pyd +0 -0
  5. pyogrio/_err.pyx +7 -3
  6. pyogrio/_geometry.c +134 -75
  7. pyogrio/_geometry.cp310-win_amd64.pyd +0 -0
  8. pyogrio/_io.c +28462 -22659
  9. pyogrio/_io.cp310-win_amd64.pyd +0 -0
  10. pyogrio/_io.pyx +904 -242
  11. pyogrio/_ogr.c +1317 -1640
  12. pyogrio/_ogr.cp310-win_amd64.pyd +0 -0
  13. pyogrio/_ogr.pxd +69 -13
  14. pyogrio/_ogr.pyx +8 -24
  15. pyogrio/_version.py +3 -3
  16. pyogrio/_vsi.c +6815 -0
  17. pyogrio/_vsi.cp310-win_amd64.pyd +0 -0
  18. pyogrio/_vsi.pxd +4 -0
  19. pyogrio/_vsi.pyx +140 -0
  20. pyogrio/core.py +43 -44
  21. pyogrio/gdal_data/GDAL-targets-release.cmake +1 -1
  22. pyogrio/gdal_data/GDAL-targets.cmake +10 -6
  23. pyogrio/gdal_data/GDALConfigVersion.cmake +3 -3
  24. pyogrio/gdal_data/gdalinfo_output.schema.json +2 -0
  25. pyogrio/gdal_data/gdalvrt.xsd +163 -0
  26. pyogrio/gdal_data/ogrinfo_output.schema.json +12 -1
  27. pyogrio/gdal_data/vcpkg.spdx.json +23 -23
  28. pyogrio/gdal_data/vcpkg_abi_info.txt +29 -28
  29. pyogrio/geopandas.py +140 -34
  30. pyogrio/proj_data/ITRF2008 +2 -2
  31. pyogrio/proj_data/proj-config-version.cmake +2 -2
  32. pyogrio/proj_data/proj-config.cmake +2 -1
  33. pyogrio/proj_data/proj-targets-release.cmake +0 -1
  34. pyogrio/proj_data/proj-targets.cmake +10 -6
  35. pyogrio/proj_data/proj.db +0 -0
  36. pyogrio/proj_data/proj4-targets-release.cmake +0 -1
  37. pyogrio/proj_data/proj4-targets.cmake +10 -6
  38. pyogrio/proj_data/vcpkg.spdx.json +21 -43
  39. pyogrio/proj_data/vcpkg_abi_info.txt +16 -17
  40. pyogrio/raw.py +438 -116
  41. pyogrio/tests/conftest.py +75 -6
  42. pyogrio/tests/fixtures/poly_not_enough_points.shp.zip +0 -0
  43. pyogrio/tests/test_arrow.py +841 -7
  44. pyogrio/tests/test_core.py +99 -7
  45. pyogrio/tests/test_geopandas_io.py +827 -121
  46. pyogrio/tests/test_path.py +23 -3
  47. pyogrio/tests/test_raw_io.py +276 -50
  48. pyogrio/util.py +39 -19
  49. pyogrio-0.9.0.dist-info/DELVEWHEEL +2 -0
  50. {pyogrio-0.7.2.dist-info → pyogrio-0.9.0.dist-info}/METADATA +2 -2
  51. {pyogrio-0.7.2.dist-info → pyogrio-0.9.0.dist-info}/RECORD +72 -67
  52. {pyogrio-0.7.2.dist-info → pyogrio-0.9.0.dist-info}/WHEEL +1 -1
  53. pyogrio.libs/Lerc-5e4d8cbeeabca06f95e2270792304dc3.dll +0 -0
  54. pyogrio.libs/{gdal-c3b1d8f66682071d0cd26d86e4182013.dll → gdal-b434963605a006e01c486c0df6dea4e0.dll} +0 -0
  55. pyogrio.libs/geos-f0622d0794b81c937a851b2e6fa9b712.dll +0 -0
  56. pyogrio.libs/geos_c-0e16bf70612fc3301d077b9d863a3fdb.dll +0 -0
  57. pyogrio.libs/{geotiff-e43cdab688866b59f8800cfcde836d16.dll → geotiff-772e7c705fb15ddf91b432adb4eb1f6c.dll} +0 -0
  58. pyogrio.libs/iconv-2-8fcc23ddc6f096c45871011b6e008b44.dll +0 -0
  59. pyogrio.libs/{jpeg62-567ab743ac805dfb57fe3867ba5788a4.dll → jpeg62-2f9b7af22d78338e8f0be0058503dc35.dll} +0 -0
  60. pyogrio.libs/json-c-e52a077545e4057de42beb4948289b41.dll +0 -0
  61. pyogrio.libs/libcurl-bc81cd8afe15b10c0821b181b6af8bd0.dll +0 -0
  62. pyogrio.libs/libexpat-fbe03ca8917dfda776562d4338b289b8.dll +0 -0
  63. pyogrio.libs/{liblzma-de7f4770d4e3715acd031ca93883f10c.dll → liblzma-6b36f24d54d3dd45f274a2aebef81085.dll} +0 -0
  64. pyogrio.libs/libpng16-13928571ad910705eae8d7dd8eef8b11.dll +0 -0
  65. pyogrio.libs/{msvcp140-83b6a1a2fa8b1735a358b2fe13cabe4e.dll → msvcp140-46db46e967c8db2cb7a20fc75872a57e.dll} +0 -0
  66. pyogrio.libs/proj-8a30239ef2dfc3b9dd2bb48e8abb330f.dll +0 -0
  67. pyogrio.libs/{qhull_r-99ae8a526357acc44b162cb4df2c3bb6.dll → qhull_r-c45abde5d0c92faf723cc2942138af77.dll} +0 -0
  68. pyogrio.libs/sqlite3-df30c3cf230727e23c43c40126a530f7.dll +0 -0
  69. pyogrio.libs/{tiff-7c2d4b204ec2db46c81f6a597895c2f7.dll → tiff-43630f30487a9015213475ae86ed3fa3.dll} +0 -0
  70. pyogrio.libs/{zlib1-824de9299616f0908aeeb9441a084848.dll → zlib1-e1272810861a13dd8d6cff3beac47f17.dll} +0 -0
  71. pyogrio/tests/win32.py +0 -86
  72. pyogrio-0.7.2.dist-info/DELVEWHEEL +0 -2
  73. pyogrio.libs/Lerc-d5afc4101deffe7de21241ccd4d562f6.dll +0 -0
  74. pyogrio.libs/geos-1c764a1384537a0ad2995e83d23e8642.dll +0 -0
  75. pyogrio.libs/geos_c-0d7dfdcee49efa8df585e2fb993157aa.dll +0 -0
  76. pyogrio.libs/json-c-36c91e30c4410d41c22b2010c31183e3.dll +0 -0
  77. pyogrio.libs/libcurl-ebcc8c18195071a90e59f818902e10c6.dll +0 -0
  78. pyogrio.libs/libexpat-345379c9c11632130d8c383cbacde1a6.dll +0 -0
  79. pyogrio.libs/libpng16-2c30e6846653c47ef2ff9d7dec3338ba.dll +0 -0
  80. pyogrio.libs/proj-98758c96a6cb682b5cec7e8dc5e29a50.dll +0 -0
  81. pyogrio.libs/sqlite3-327ed7b38bfd91fb4a17544960e055e9.dll +0 -0
  82. {pyogrio-0.7.2.dist-info → pyogrio-0.9.0.dist-info}/LICENSE +0 -0
  83. {pyogrio-0.7.2.dist-info → pyogrio-0.9.0.dist-info}/top_level.txt +0 -0
Binary file
pyogrio/_vsi.pxd ADDED
@@ -0,0 +1,4 @@
1
+ cdef str get_ogr_vsimem_write_path(object path_or_fp, str driver)
2
+ cdef str read_buffer_to_vsimem(bytes bytes_buffer)
3
+ cdef read_vsimem_to_buffer(str path, object out_buffer)
4
+ cdef delete_vsimem_file(str path)
pyogrio/_vsi.pyx ADDED
@@ -0,0 +1,140 @@
1
+ from io import BytesIO
2
+ from uuid import uuid4
3
+
4
+ from libc.stdlib cimport malloc, free
5
+ from libc.string cimport memcpy
6
+
7
+ from pyogrio._ogr cimport *
8
+ from pyogrio._ogr import _get_driver_metadata_item
9
+
10
+
11
+ cdef str get_ogr_vsimem_write_path(object path_or_fp, str driver):
12
+ """ Return the original path or a /vsimem/ path
13
+
14
+ If passed a io.BytesIO object, this will return a /vsimem/ path that can be
15
+ used to create a new in-memory file with an extension inferred from the driver
16
+ if possible. Path will be contained in an in-memory directory to contain
17
+ sibling files (though drivers that create sibling files are not supported for
18
+ in-memory files).
19
+
20
+ Caller is responsible for deleting the directory via delete_vsimem_file()
21
+
22
+ Parameters
23
+ ----------
24
+ path_or_fp : str or io.BytesIO object
25
+ driver : str
26
+ """
27
+
28
+ if not isinstance(path_or_fp, BytesIO):
29
+ return path_or_fp
30
+
31
+ # Create in-memory directory to contain auxiliary files
32
+ memfilename = uuid4().hex
33
+ VSIMkdir(f"/vsimem/{memfilename}".encode("UTF-8"), 0666)
34
+
35
+ # file extension is required for some drivers, set it based on driver metadata
36
+ ext = ""
37
+ recommended_ext = _get_driver_metadata_item(driver, "DMD_EXTENSIONS")
38
+ if recommended_ext is not None:
39
+ ext = "." + recommended_ext.split(" ")[0]
40
+
41
+ path = f"/vsimem/{memfilename}/{memfilename}{ext}"
42
+
43
+ # check for existing bytes
44
+ if path_or_fp.getbuffer().nbytes > 0:
45
+ raise NotImplementedError("writing to existing in-memory object is not supported")
46
+
47
+ return path
48
+
49
+
50
+ cdef str read_buffer_to_vsimem(bytes bytes_buffer):
51
+ """ Wrap the bytes (zero-copy) into an in-memory dataset
52
+
53
+ If the first 4 bytes indicate the bytes are a zip file, the returned path
54
+ will be prefixed with /vsizip/ and suffixed with .zip to enable proper
55
+ reading by GDAL.
56
+
57
+ Caller is responsible for deleting the in-memory file via delete_vsimem_file().
58
+
59
+ Parameters
60
+ ----------
61
+ bytes_buffer : bytes
62
+ """
63
+ cdef int num_bytes = len(bytes_buffer)
64
+
65
+ is_zipped = len(bytes_buffer) > 4 and bytes_buffer[:4].startswith(b"PK\x03\x04")
66
+ ext = ".zip" if is_zipped else ""
67
+
68
+ path = f"/vsimem/{uuid4().hex}{ext}"
69
+
70
+ # Create an in-memory object that references bytes_buffer
71
+ # NOTE: GDAL does not copy the contents of bytes_buffer; it must remain
72
+ # in scope through the duration of using this file
73
+ vsi_handle = VSIFileFromMemBuffer(path.encode("UTF-8"), <unsigned char *>bytes_buffer, num_bytes, 0)
74
+
75
+ if vsi_handle == NULL:
76
+ raise OSError("failed to read buffer into in-memory file")
77
+
78
+ if VSIFCloseL(vsi_handle) != 0:
79
+ raise OSError("failed to close in-memory file")
80
+
81
+ if is_zipped:
82
+ path = f"/vsizip/{path}"
83
+
84
+ return path
85
+
86
+
87
+ cdef read_vsimem_to_buffer(str path, object out_buffer):
88
+ """Copy bytes from in-memory file to buffer
89
+
90
+ This will automatically unlink the in-memory file pointed to by path; caller
91
+ is still responsible for calling delete_vsimem_file() to cleanup any other
92
+ files contained in the in-memory directory.
93
+
94
+ Parameters:
95
+ -----------
96
+ path : str
97
+ path to in-memory file
98
+ buffer : BytesIO object
99
+ """
100
+
101
+ cdef unsigned char *vsi_buffer = NULL
102
+ cdef vsi_l_offset vsi_buffer_size = 0
103
+
104
+ try:
105
+ # Take ownership of the buffer to avoid a copy; GDAL will automatically
106
+ # unlink the memory file
107
+ vsi_buffer = VSIGetMemFileBuffer(path.encode("UTF-8"), &vsi_buffer_size, 1)
108
+ if vsi_buffer == NULL:
109
+ raise RuntimeError("could not read bytes from in-memory file")
110
+
111
+ # write bytes to buffer
112
+ out_buffer.write(<bytes>vsi_buffer[:vsi_buffer_size])
113
+ # rewind to beginning to allow caller to read
114
+ out_buffer.seek(0)
115
+
116
+ finally:
117
+ if vsi_buffer != NULL:
118
+ CPLFree(vsi_buffer)
119
+
120
+
121
+ cdef delete_vsimem_file(str path):
122
+ """ Recursively delete in-memory path or directory containing path
123
+
124
+ This is used for final cleanup of an in-memory dataset, which may have been
125
+ created within a directory to contain sibling files.
126
+
127
+ Additional VSI handlers may be chained to the left of /vsimem/ in path and
128
+ will be ignored.
129
+
130
+ Parameters:
131
+ -----------
132
+ path : str
133
+ path to in-memory file
134
+ """
135
+
136
+ if "/vsimem/" not in path:
137
+ return
138
+
139
+ root = "/vsimem/" + path.split("/vsimem/")[1].split("/")[0]
140
+ VSIRmdirRecursive(root.encode("UTF-8"))
pyogrio/core.py CHANGED
@@ -1,5 +1,9 @@
1
1
  from pyogrio._env import GDALEnv
2
- from pyogrio.util import get_vsi_path, _preprocess_options_key_value, _mask_to_wkb
2
+ from pyogrio.util import (
3
+ get_vsi_path_or_buffer,
4
+ _preprocess_options_key_value,
5
+ _mask_to_wkb,
6
+ )
3
7
 
4
8
 
5
9
  with GDALEnv():
@@ -13,7 +17,6 @@ with GDALEnv():
13
17
  get_gdal_data_path as _get_gdal_data_path,
14
18
  init_gdal_data as _init_gdal_data,
15
19
  init_proj_data as _init_proj_data,
16
- remove_virtual_file,
17
20
  _register_drivers,
18
21
  _get_drivers_for_path,
19
22
  )
@@ -102,7 +105,7 @@ def list_layers(path_or_buffer, /):
102
105
 
103
106
  Parameters
104
107
  ----------
105
- path : str or pathlib.Path
108
+ path_or_buffer : str, pathlib.Path, bytes, or file-like
106
109
 
107
110
  Returns
108
111
  -------
@@ -110,14 +113,8 @@ def list_layers(path_or_buffer, /):
110
113
  array of pairs of [<layer name>, <layer geometry type>]
111
114
  Note: geometry is `None` for nonspatial layers.
112
115
  """
113
- path, buffer = get_vsi_path(path_or_buffer)
114
116
 
115
- try:
116
- result = ogr_list_layers(path)
117
- finally:
118
- if buffer is not None:
119
- remove_virtual_file(path)
120
- return result
117
+ return ogr_list_layers(get_vsi_path_or_buffer(path_or_buffer))
121
118
 
122
119
 
123
120
  def read_bounds(
@@ -138,8 +135,7 @@ def read_bounds(
138
135
 
139
136
  Parameters
140
137
  ----------
141
- path : pathlib.Path or str
142
- data source path
138
+ path_or_buffer : str, pathlib.Path, bytes, or file-like
143
139
  layer : int or str, optional (default: first layer)
144
140
  If an integer is provided, it corresponds to the index of the layer
145
141
  with the data source. If a string is provided, it must match the name
@@ -177,22 +173,16 @@ def read_bounds(
177
173
  bounds are ndarray of shape(4, n) containing ``xmin``, ``ymin``, ``xmax``,
178
174
  ``ymax``
179
175
  """
180
- path, buffer = get_vsi_path(path_or_buffer)
181
-
182
- try:
183
- result = ogr_read_bounds(
184
- path,
185
- layer=layer,
186
- skip_features=skip_features,
187
- max_features=max_features or 0,
188
- where=where,
189
- bbox=bbox,
190
- mask=_mask_to_wkb(mask),
191
- )
192
- finally:
193
- if buffer is not None:
194
- remove_virtual_file(path)
195
- return result
176
+
177
+ return ogr_read_bounds(
178
+ get_vsi_path_or_buffer(path_or_buffer),
179
+ layer=layer,
180
+ skip_features=skip_features,
181
+ max_features=max_features or 0,
182
+ where=where,
183
+ bbox=bbox,
184
+ mask=_mask_to_wkb(mask),
185
+ )
196
186
 
197
187
 
198
188
  def read_info(
@@ -217,9 +207,21 @@ def read_info(
217
207
  driver or if the data source is nonspatial. You can force it to be calculated using
218
208
  the ``force_total_bounds`` parameter.
219
209
 
210
+ ``fid_column`` is the name of the FID field in the data source, if the FID is
211
+ physically stored (e.g. in GPKG). If the FID is just a sequence, ``fid_column``
212
+ will be "" (e.g. ESRI Shapefile).
213
+
214
+ ``geometry_name`` is the name of the field where the main geometry is stored in the
215
+ data data source, if the field name can by customized (e.g. in GPKG). If no custom
216
+ name is supported, ``geometry_name`` will be "" (e.g. ESRI Shapefile).
217
+
218
+ ``encoding`` will be ``UTF-8`` if either the native encoding is likely to be
219
+ ``UTF-8`` or GDAL can automatically convert from the detected native encoding
220
+ to ``UTF-8``.
221
+
220
222
  Parameters
221
223
  ----------
222
- path : str or pathlib.Path
224
+ path_or_buffer : str, pathlib.Path, bytes, or file-like
223
225
  layer : [type], optional
224
226
  Name or index of layer in data source. Reads the first layer by default.
225
227
  encoding : [type], optional (default: None)
@@ -240,11 +242,14 @@ def read_info(
240
242
  A dictionary with the following keys::
241
243
 
242
244
  {
245
+ "layer_name": "<layer name>",
243
246
  "crs": "<crs>",
244
247
  "fields": <ndarray of field names>,
245
248
  "dtypes": <ndarray of field dtypes>,
246
249
  "encoding": "<encoding>",
247
- "geometry": "<geometry type>",
250
+ "fid_column": "<fid column name or "">",
251
+ "geometry_name": "<geometry column name or "">",
252
+ "geometry_type": "<geometry type>",
248
253
  "features": <feature count or -1>,
249
254
  "total_bounds": <tuple with total bounds or None>,
250
255
  "driver": "<driver>",
@@ -253,23 +258,17 @@ def read_info(
253
258
  "layer_metadata": "<dict of layer metadata or None>"
254
259
  }
255
260
  """
256
- path, buffer = get_vsi_path(path_or_buffer)
257
261
 
258
262
  dataset_kwargs = _preprocess_options_key_value(kwargs) if kwargs else {}
259
263
 
260
- try:
261
- result = ogr_read_info(
262
- path,
263
- layer=layer,
264
- encoding=encoding,
265
- force_feature_count=force_feature_count,
266
- force_total_bounds=force_total_bounds,
267
- dataset_kwargs=dataset_kwargs,
268
- )
269
- finally:
270
- if buffer is not None:
271
- remove_virtual_file(path)
272
- return result
264
+ return ogr_read_info(
265
+ get_vsi_path_or_buffer(path_or_buffer),
266
+ layer=layer,
267
+ encoding=encoding,
268
+ force_feature_count=force_feature_count,
269
+ force_total_bounds=force_total_bounds,
270
+ dataset_kwargs=dataset_kwargs,
271
+ )
273
272
 
274
273
 
275
274
  def set_gdal_config_options(options):
@@ -9,7 +9,7 @@ set(CMAKE_IMPORT_FILE_VERSION 1)
9
9
  set_property(TARGET GDAL::GDAL APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
10
10
  set_target_properties(GDAL::GDAL PROPERTIES
11
11
  IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/gdal.lib"
12
- IMPORTED_LINK_DEPENDENT_LIBRARIES_RELEASE "json-c::json-c;CURL::libcurl;GEOS::geos_c;PROJ::proj;Qhull::qhull_r;expat::expat;geotiff_library"
12
+ IMPORTED_LINK_DEPENDENT_LIBRARIES_RELEASE "json-c::json-c;GEOS::geos_c;PROJ::proj;Qhull::qhull_r;expat::expat;geotiff_library"
13
13
  IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/gdal.dll"
14
14
  )
15
15
 
@@ -7,7 +7,7 @@ if(CMAKE_VERSION VERSION_LESS "2.8.3")
7
7
  message(FATAL_ERROR "CMake >= 2.8.3 required")
8
8
  endif()
9
9
  cmake_policy(PUSH)
10
- cmake_policy(VERSION 2.8.3...3.25)
10
+ cmake_policy(VERSION 2.8.3...3.27)
11
11
  #----------------------------------------------------------------
12
12
  # Generated CMake target import file.
13
13
  #----------------------------------------------------------------
@@ -74,9 +74,12 @@ set(_IMPORT_PREFIX)
74
74
 
75
75
  # Loop over all imported files and verify that they actually exist
76
76
  foreach(_cmake_target IN LISTS _cmake_import_check_targets)
77
- foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}")
78
- if(NOT EXISTS "${_cmake_file}")
79
- message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file
77
+ if(CMAKE_VERSION VERSION_LESS "3.28"
78
+ OR NOT DEFINED _cmake_import_check_xcframework_for_${_cmake_target}
79
+ OR NOT IS_DIRECTORY "${_cmake_import_check_xcframework_for_${_cmake_target}}")
80
+ foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}")
81
+ if(NOT EXISTS "${_cmake_file}")
82
+ message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file
80
83
  \"${_cmake_file}\"
81
84
  but this file does not exist. Possible reasons include:
82
85
  * The file was deleted, renamed, or moved to another location.
@@ -85,8 +88,9 @@ but this file does not exist. Possible reasons include:
85
88
  \"${CMAKE_CURRENT_LIST_FILE}\"
86
89
  but not all the files it references.
87
90
  ")
88
- endif()
89
- endforeach()
91
+ endif()
92
+ endforeach()
93
+ endif()
90
94
  unset(_cmake_file)
91
95
  unset("_cmake_import_check_files_for_${_cmake_target}")
92
96
  endforeach()
@@ -10,13 +10,13 @@
10
10
  # The variable CVF_VERSION must be set before calling configure_file().
11
11
 
12
12
 
13
- set(PACKAGE_VERSION "3.7.2")
13
+ set(PACKAGE_VERSION "3.8.5")
14
14
 
15
15
  if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
16
16
  set(PACKAGE_VERSION_COMPATIBLE FALSE)
17
17
  else()
18
18
 
19
- if("3.7.2" MATCHES "^([0-9]+)\\.([0-9]+)")
19
+ if("3.8.5" MATCHES "^([0-9]+)\\.([0-9]+)")
20
20
  set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
21
21
  set(CVF_VERSION_MINOR "${CMAKE_MATCH_2}")
22
22
 
@@ -27,7 +27,7 @@ else()
27
27
  string(REGEX REPLACE "^0+" "" CVF_VERSION_MINOR "${CVF_VERSION_MINOR}")
28
28
  endif()
29
29
  else()
30
- set(CVF_VERSION_MAJOR "3.7.2")
30
+ set(CVF_VERSION_MAJOR "3.8.5")
31
31
  set(CVF_VERSION_MINOR "")
32
32
  endif()
33
33
 
@@ -176,6 +176,7 @@
176
176
  }
177
177
  },
178
178
  "size": {
179
+ "$comment": "note that the order of items in side is width,height",
179
180
  "$ref": "#/definitions/arrayOfTwoIntegers"
180
181
  },
181
182
  "coordinateSystem": {
@@ -306,6 +307,7 @@
306
307
  },
307
308
 
308
309
  "proj:shape": {
310
+ "$comment": "note that the order of items in proj:shape is height,width starting with GDAL 3.8.5 (previous versions ordered it wrongly as width,height)",
309
311
  "title": "Shape",
310
312
  "type": "array",
311
313
  "minItems": 2,
@@ -138,6 +138,7 @@
138
138
  <xs:complexType name="PanchroBandType">
139
139
  <xs:sequence>
140
140
  <xs:element name="SourceFilename" type="SourceFilenameType"/>
141
+ <xs:element name="OpenOptions" type="OpenOptionsType"/>
141
142
  <xs:element name="SourceBand" type="xs:string"/> <!-- should be refined into xs:nonNegativeInteger or mask,xs:nonNegativeInteger -->
142
143
  </xs:sequence>
143
144
  </xs:complexType>
@@ -145,6 +146,7 @@
145
146
  <xs:complexType name="SpectralBandType">
146
147
  <xs:sequence>
147
148
  <xs:element name="SourceFilename" type="SourceFilenameType"/>
149
+ <xs:element name="OpenOptions" type="OpenOptionsType"/>
148
150
  <xs:element name="SourceBand" type="xs:string"/> <!-- should be refined into xs:nonNegativeInteger or mask,xs:nonNegativeInteger -->
149
151
  </xs:sequence>
150
152
  <xs:attribute name="dstBand" type="xs:nonNegativeInteger"/>
@@ -188,6 +190,7 @@
188
190
  <xs:element name="ComplexSource" type="ComplexSourceType"/>
189
191
  <xs:element name="AveragedSource" type="SimpleSourceType"/>
190
192
  <xs:element name="KernelFilteredSource" type="KernelFilteredSourceType"/>
193
+ <xs:element name="ArraySource" type="ArraySourceType"/>
191
194
 
192
195
  <!-- for a VRTDerivedRasterBand -->
193
196
  <xs:element name="PixelFunctionType" type="xs:string"/>
@@ -435,6 +438,31 @@
435
438
  </xs:restriction>
436
439
  </xs:simpleType>
437
440
 
441
+ <xs:complexType name="ArraySourceType">
442
+ <xs:sequence>
443
+ <xs:element ref="AbstractArray"/>
444
+ <xs:element name="SrcRect" type="RectType" minOccurs="0"/>
445
+ <xs:element name="DstRect" type="RectType" minOccurs="0"/>
446
+ </xs:sequence>
447
+ </xs:complexType>
448
+
449
+ <xs:element name="AbstractArray" type="AbstractArrayType" abstract="true"/>
450
+
451
+ <xs:complexType name="AbstractArrayType"/>
452
+
453
+ <xs:element name="SingleSourceArray" substitutionGroup="AbstractArray" type="SingleSourceArrayType"/>
454
+
455
+ <xs:complexType name="SingleSourceArrayType">
456
+ <xs:complexContent>
457
+ <xs:extension base="AbstractArrayType">
458
+ <xs:sequence>
459
+ <xs:element name="SourceFilename" type="SourceFilenameType"/>
460
+ <xs:element name="SourceArray" type="xs:string"/>
461
+ </xs:sequence>
462
+ </xs:extension>
463
+ </xs:complexContent>
464
+ </xs:complexType>
465
+
438
466
  <xs:complexType name="SourceFilenameType">
439
467
  <xs:simpleContent>
440
468
  <xs:extension base="xs:string">
@@ -606,4 +634,139 @@
606
634
  <xs:attribute name="ref" type="xs:string" use="required"/>
607
635
  </xs:complexType>
608
636
 
637
+ <xs:element name="DerivedArray" substitutionGroup="AbstractArray" type="DerivedArrayType"/>
638
+
639
+ <xs:complexType name="DerivedArrayType">
640
+ <xs:complexContent>
641
+ <xs:extension base="AbstractArrayType">
642
+ <xs:sequence>
643
+ <xs:element ref="AbstractArray"/>
644
+ <xs:element name="Step" type="StepType" minOccurs="0" maxOccurs="unbounded"/>
645
+ </xs:sequence>
646
+ </xs:extension>
647
+ </xs:complexContent>
648
+ </xs:complexType>
649
+
650
+ <xs:complexType name="StepType">
651
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
652
+ <xs:element ref="AbstractStep"/>
653
+ </xs:sequence>
654
+ </xs:complexType>
655
+
656
+ <xs:element name="AbstractStep" type="AbstractStepType" abstract="true"/>
657
+
658
+ <xs:complexType name="AbstractStepType"/>
659
+
660
+ <xs:element name="View" substitutionGroup="AbstractStep" type="ViewType"/>
661
+
662
+ <xs:complexType name="ViewType">
663
+ <xs:complexContent>
664
+ <xs:extension base="AbstractStepType">
665
+ <xs:attribute name="expr" type="xs:string" use="required"/>
666
+ </xs:extension>
667
+ </xs:complexContent>
668
+ </xs:complexType>
669
+
670
+ <xs:element name="Transpose" substitutionGroup="AbstractStep" type="TransposeType"/>
671
+
672
+ <xs:complexType name="TransposeType">
673
+ <xs:complexContent>
674
+ <xs:extension base="AbstractStepType">
675
+ <xs:attribute name="newOrder" type="CommaSeparatedListOfIntegerType" use="required"/>
676
+ </xs:extension>
677
+ </xs:complexContent>
678
+ </xs:complexType>
679
+
680
+ <xs:simpleType name="CommaSeparatedListOfIntegerType">
681
+ <xs:restriction base="xs:string">
682
+ <xs:pattern value="(\d)+(,(\d)+).*"/>
683
+ </xs:restriction>
684
+ </xs:simpleType>
685
+
686
+ <xs:element name="Resample" substitutionGroup="AbstractStep" type="ResampleType"/>
687
+
688
+ <xs:complexType name="ResampleType">
689
+ <xs:complexContent>
690
+ <xs:extension base="AbstractStepType">
691
+ <xs:sequence>
692
+ <xs:element name="Dimension" type="DimensionType" minOccurs="0" maxOccurs="unbounded"/>
693
+ <xs:element name="ResampleAlg" type="ResampleAlgType" minOccurs="0"/>
694
+ <xs:element name="SRS" type="SRSType" minOccurs="0"/>
695
+ <xs:element name="Option" type="OptionType" minOccurs="0" maxOccurs="unbounded"/>
696
+ </xs:sequence>
697
+ </xs:extension>
698
+ </xs:complexContent>
699
+ </xs:complexType>
700
+
701
+ <xs:simpleType name="ResampleAlgType">
702
+ <xs:restriction base="xs:string">
703
+ <xs:enumeration value="NearestNeighbour"/>
704
+ <xs:enumeration value="Bilinear"/>
705
+ <xs:enumeration value="Cubic"/>
706
+ <xs:enumeration value="CubicSpline"/>
707
+ <xs:enumeration value="Lanczos"/>
708
+ <xs:enumeration value="Average"/>
709
+ <xs:enumeration value="RMS"/>
710
+ <xs:enumeration value="Mode"/>
711
+ <xs:enumeration value="Gauss"/>
712
+ </xs:restriction>
713
+ </xs:simpleType>
714
+
715
+ <xs:complexType name="OptionType">
716
+ <xs:simpleContent>
717
+ <xs:extension base="xs:string">
718
+ <xs:attribute name="name" type="xs:string"/>
719
+ </xs:extension>
720
+ </xs:simpleContent>
721
+ </xs:complexType>
722
+
723
+ <xs:element name="Grid" substitutionGroup="AbstractStep" type="GridType"/>
724
+
725
+ <xs:complexType name="GridType">
726
+ <xs:complexContent>
727
+ <xs:extension base="AbstractStepType">
728
+ <xs:sequence>
729
+ <xs:element name="GridOptions" type="xs:string" minOccurs="1"/>
730
+ <xs:element name="XArray" minOccurs="0">
731
+ <xs:complexType>
732
+ <xs:sequence>
733
+ <xs:element ref="AbstractArray"/>
734
+ </xs:sequence>
735
+ </xs:complexType>
736
+ </xs:element>
737
+ <xs:element name="YArray" minOccurs="0">
738
+ <xs:complexType>
739
+ <xs:sequence>
740
+ <xs:element ref="AbstractArray"/>
741
+ </xs:sequence>
742
+ </xs:complexType>
743
+ </xs:element>
744
+ <xs:element name="Option" type="OptionType" minOccurs="0" maxOccurs="unbounded"/>
745
+ </xs:sequence>
746
+ </xs:extension>
747
+ </xs:complexContent>
748
+ </xs:complexType>
749
+
750
+ <xs:element name="GetMask" substitutionGroup="AbstractStep" type="GetMaskType"/>
751
+
752
+ <xs:complexType name="GetMaskType">
753
+ <xs:complexContent>
754
+ <xs:extension base="AbstractStepType">
755
+ <xs:sequence>
756
+ <xs:element name="Option" type="OptionType" minOccurs="0" maxOccurs="unbounded"/>
757
+ </xs:sequence>
758
+ </xs:extension>
759
+ </xs:complexContent>
760
+ </xs:complexType>
761
+
762
+ <xs:element name="GetUnscaled" substitutionGroup="AbstractStep" type="GetUnscaledType"/>
763
+
764
+ <xs:complexType name="GetUnscaledType">
765
+ <xs:complexContent>
766
+ <xs:extension base="AbstractStepType">
767
+ <xs:sequence/>
768
+ </xs:extension>
769
+ </xs:complexContent>
770
+ </xs:complexType>
771
+
609
772
  </xs:schema>
@@ -149,6 +149,10 @@
149
149
  },
150
150
  "comment": {
151
151
  "type": "string"
152
+ },
153
+ "timezone": {
154
+ "type": "string",
155
+ "pattern": "^(localtime|(mixed timezones)|UTC|((\\+|-)[0-9][0-9]:[0-9][0-9]))$"
152
156
  }
153
157
  },
154
158
  "required": [
@@ -209,7 +213,14 @@
209
213
  }
210
214
  },
211
215
  "coordinateSystem": {
212
- "$ref": "#/definitions/coordinateSystem"
216
+ "oneOf": [
217
+ {
218
+ "type": "null"
219
+ },
220
+ {
221
+ "$ref": "#/definitions/coordinateSystem"
222
+ }
223
+ ]
213
224
  },
214
225
  "supportedSRSList": {
215
226
  "type": "array",