pyogrio 0.7.2__cp310-cp310-manylinux_2_28_aarch64.whl → 0.9.0__cp310-cp310-manylinux_2_28_aarch64.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.
- pyogrio/__init__.py +4 -0
- pyogrio/_compat.py +6 -1
- pyogrio/_err.cpython-310-aarch64-linux-gnu.so +0 -0
- pyogrio/_err.pyx +7 -3
- pyogrio/_geometry.cpython-310-aarch64-linux-gnu.so +0 -0
- pyogrio/_io.cpython-310-aarch64-linux-gnu.so +0 -0
- pyogrio/_io.pyx +904 -242
- pyogrio/_ogr.cpython-310-aarch64-linux-gnu.so +0 -0
- pyogrio/_ogr.pxd +69 -13
- pyogrio/_ogr.pyx +8 -24
- pyogrio/_version.py +3 -3
- pyogrio/_vsi.cpython-310-aarch64-linux-gnu.so +0 -0
- pyogrio/_vsi.pxd +4 -0
- pyogrio/_vsi.pyx +140 -0
- pyogrio/core.py +43 -44
- pyogrio/gdal_data/GDAL-targets-release.cmake +3 -3
- pyogrio/gdal_data/GDAL-targets.cmake +10 -6
- pyogrio/gdal_data/GDALConfigVersion.cmake +3 -3
- pyogrio/gdal_data/gdalinfo_output.schema.json +2 -0
- pyogrio/gdal_data/gdalvrt.xsd +163 -0
- pyogrio/gdal_data/ogrinfo_output.schema.json +12 -1
- pyogrio/gdal_data/vcpkg.spdx.json +26 -26
- pyogrio/gdal_data/vcpkg_abi_info.txt +27 -26
- pyogrio/geopandas.py +140 -34
- pyogrio/proj_data/ITRF2008 +2 -2
- pyogrio/proj_data/proj-config-version.cmake +2 -2
- pyogrio/proj_data/proj-config.cmake +2 -1
- pyogrio/proj_data/proj-targets.cmake +13 -13
- pyogrio/proj_data/proj.db +0 -0
- pyogrio/proj_data/proj4-targets.cmake +13 -13
- pyogrio/proj_data/vcpkg.spdx.json +20 -42
- pyogrio/proj_data/vcpkg_abi_info.txt +14 -15
- pyogrio/raw.py +438 -116
- pyogrio/tests/conftest.py +75 -6
- pyogrio/tests/fixtures/poly_not_enough_points.shp.zip +0 -0
- pyogrio/tests/test_arrow.py +841 -7
- pyogrio/tests/test_core.py +99 -7
- pyogrio/tests/test_geopandas_io.py +827 -121
- pyogrio/tests/test_path.py +23 -3
- pyogrio/tests/test_raw_io.py +276 -50
- pyogrio/util.py +39 -19
- {pyogrio-0.7.2.dist-info → pyogrio-0.9.0.dist-info}/METADATA +2 -2
- {pyogrio-0.7.2.dist-info → pyogrio-0.9.0.dist-info}/RECORD +210 -207
- {pyogrio-0.7.2.dist-info → pyogrio-0.9.0.dist-info}/WHEEL +1 -1
- pyogrio.libs/{libgdal-cb554135.so.33.3.7.2 → libgdal-6ff0914e.so.34.3.8.5} +0 -0
- pyogrio/tests/win32.py +0 -86
- {pyogrio-0.7.2.dist-info → pyogrio-0.9.0.dist-info}/LICENSE +0 -0
- {pyogrio-0.7.2.dist-info → pyogrio-0.9.0.dist-info}/top_level.txt +0 -0
pyogrio/tests/conftest.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
|
-
from zipfile import
|
|
2
|
+
from zipfile import ZIP_DEFLATED, ZipFile
|
|
3
3
|
|
|
4
4
|
import pytest
|
|
5
5
|
|
|
@@ -8,10 +8,15 @@ from pyogrio import (
|
|
|
8
8
|
__version__,
|
|
9
9
|
list_drivers,
|
|
10
10
|
)
|
|
11
|
-
from pyogrio._compat import
|
|
11
|
+
from pyogrio._compat import (
|
|
12
|
+
HAS_ARROW_API,
|
|
13
|
+
HAS_ARROW_WRITE_API,
|
|
14
|
+
HAS_GDAL_GEOS,
|
|
15
|
+
HAS_PYARROW,
|
|
16
|
+
HAS_SHAPELY,
|
|
17
|
+
)
|
|
12
18
|
from pyogrio.raw import read, write
|
|
13
19
|
|
|
14
|
-
|
|
15
20
|
_data_dir = Path(__file__).parent.resolve() / "fixtures"
|
|
16
21
|
|
|
17
22
|
# mapping of driver extension to driver name for well-supported drivers
|
|
@@ -43,8 +48,14 @@ def pytest_report_header(config):
|
|
|
43
48
|
|
|
44
49
|
|
|
45
50
|
# marks to skip tests if optional dependecies are not present
|
|
46
|
-
requires_arrow_api = pytest.mark.skipif(
|
|
47
|
-
|
|
51
|
+
requires_arrow_api = pytest.mark.skipif(not HAS_ARROW_API, reason="GDAL>=3.6 required")
|
|
52
|
+
requires_pyarrow_api = pytest.mark.skipif(
|
|
53
|
+
not HAS_ARROW_API or not HAS_PYARROW, reason="GDAL>=3.6 and pyarrow required"
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
requires_arrow_write_api = pytest.mark.skipif(
|
|
57
|
+
not HAS_ARROW_WRITE_API or not HAS_PYARROW,
|
|
58
|
+
reason="GDAL>=3.8 required for Arrow write API",
|
|
48
59
|
)
|
|
49
60
|
|
|
50
61
|
requires_gdal_geos = pytest.mark.skipif(
|
|
@@ -103,7 +114,7 @@ def naturalearth_lowres_vsi(tmp_path, naturalearth_lowres):
|
|
|
103
114
|
|
|
104
115
|
path = tmp_path / f"{naturalearth_lowres.name}.zip"
|
|
105
116
|
with ZipFile(path, mode="w", compression=ZIP_DEFLATED, compresslevel=5) as out:
|
|
106
|
-
for ext in ["dbf", "prj", "shp", "shx"]:
|
|
117
|
+
for ext in ["dbf", "prj", "shp", "shx", "cpg"]:
|
|
107
118
|
filename = f"{naturalearth_lowres.stem}.{ext}"
|
|
108
119
|
out.write(naturalearth_lowres.parent / filename, filename)
|
|
109
120
|
|
|
@@ -133,3 +144,61 @@ def test_datetime():
|
|
|
133
144
|
@pytest.fixture(scope="session")
|
|
134
145
|
def test_datetime_tz():
|
|
135
146
|
return _data_dir / "test_datetime_tz.geojson"
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
@pytest.fixture(scope="function")
|
|
150
|
+
def geojson_bytes(tmp_path):
|
|
151
|
+
"""Extracts first 3 records from naturalearth_lowres and writes to GeoJSON,
|
|
152
|
+
returning bytes"""
|
|
153
|
+
meta, _, geometry, field_data = read(
|
|
154
|
+
_data_dir / Path("naturalearth_lowres/naturalearth_lowres.shp"), max_features=3
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
filename = tmp_path / "test.geojson"
|
|
158
|
+
write(filename, geometry, field_data, **meta)
|
|
159
|
+
|
|
160
|
+
with open(filename, "rb") as f:
|
|
161
|
+
bytes_buffer = f.read()
|
|
162
|
+
|
|
163
|
+
return bytes_buffer
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
@pytest.fixture(scope="function")
|
|
167
|
+
def geojson_filelike(tmp_path):
|
|
168
|
+
"""Extracts first 3 records from naturalearth_lowres and writes to GeoJSON,
|
|
169
|
+
returning open file handle"""
|
|
170
|
+
meta, _, geometry, field_data = read(
|
|
171
|
+
_data_dir / Path("naturalearth_lowres/naturalearth_lowres.shp"), max_features=3
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
filename = tmp_path / "test.geojson"
|
|
175
|
+
write(filename, geometry, field_data, layer="test", **meta)
|
|
176
|
+
|
|
177
|
+
with open(filename, "rb") as f:
|
|
178
|
+
yield f
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
@pytest.fixture(
|
|
182
|
+
scope="session",
|
|
183
|
+
params=[
|
|
184
|
+
# Japanese
|
|
185
|
+
("CP932", "ホ"),
|
|
186
|
+
# Chinese
|
|
187
|
+
("CP936", "中文"),
|
|
188
|
+
# Central European
|
|
189
|
+
("CP1250", "Đ"),
|
|
190
|
+
# Latin 1 / Western European
|
|
191
|
+
("CP1252", "ÿ"),
|
|
192
|
+
# Greek
|
|
193
|
+
("CP1253", "Φ"),
|
|
194
|
+
# Arabic
|
|
195
|
+
("CP1256", "ش"),
|
|
196
|
+
],
|
|
197
|
+
)
|
|
198
|
+
def encoded_text(request):
|
|
199
|
+
"""Return tuple with encoding name and very short sample text in that encoding
|
|
200
|
+
NOTE: it was determined through testing that code pages for MS-DOS do not
|
|
201
|
+
consistently work across all Python installations (in particular, fail with conda),
|
|
202
|
+
but ANSI code pages appear to work properly.
|
|
203
|
+
"""
|
|
204
|
+
return request.param
|
|
Binary file
|