Skip to content

Commit d6ed200

Browse files
authored
DOC: Update versions in readme/docs + small improvements (#604)
1 parent d7919d3 commit d6ed200

File tree

7 files changed

+70
-43
lines changed

7 files changed

+70
-43
lines changed

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,10 @@ Read the documentation for more information:
3131

3232
## Requirements
3333

34-
Supports Python 3.10 - 3.14 and GDAL 3.6.x - 3.11.x.
35-
36-
Reading to GeoDataFrames requires `geopandas>=0.12` with `shapely>=2`.
37-
38-
Additionally, installing `pyarrow` in combination with GDAL 3.6+ enables
39-
a further speed-up when specifying `use_arrow=True`.
34+
- Python >= 3.10
35+
- GDAL >= 3.6
36+
- Reading to GeoDataFrames requires `geopandas>=0.12` and `shapely>=2`. Additionally,
37+
installing `pyarrow` enables a further speed-up when specifying `use_arrow=True`.
4038

4139
## Installation
4240

docs/environment.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ name: pyogrio
22
channels:
33
- conda-forge
44
dependencies:
5-
- python==3.10.*
6-
- gdal
7-
- numpy==1.24.*
8-
- numpydoc==1.1.*
9-
- Cython==0.29.*
10-
- docutils==0.16.*
5+
- python=3.13
6+
- libgdal-core
7+
- numpy
8+
- numpydoc=1.9
9+
- docutils
1110
- myst-parser
1211
- pip
1312
- pip:

docs/source/api.rst

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,34 @@
1+
.. py:currentmodule:: pyogrio
2+
13
API reference
24
=============
35

46
Core
57
----
68

79
.. automodule:: pyogrio
8-
:members: list_drivers, detect_write_driver, list_layers, read_bounds, read_info, set_gdal_config_options, get_gdal_config_option, vsi_listtree, vsi_rmtree, vsi_unlink, __gdal_version__, __gdal_version_string__
10+
:members: list_drivers, detect_write_driver, list_layers, read_bounds, read_info, set_gdal_config_options, get_gdal_config_option, vsi_listtree, vsi_rmtree, vsi_unlink
11+
12+
..
13+
For the special attributes/dunder attributes, the inline docstrings weren't
14+
picked up by autodoc, so they are documented explicitly here.
15+
16+
.. py:attribute:: __version__
17+
18+
The pyogrio version (`str`).
19+
20+
.. py:attribute:: __gdal_version__
21+
22+
The GDAL version used by pyogrio (`tuple` of `int`).
23+
24+
.. py:attribute:: __gdal_version_string__
25+
26+
The GDAL version used by pyogrio (`str`).
27+
28+
.. py:attribute:: __gdal_geos_version__
29+
30+
The version of GEOS used by GDAL (`tuple` of `int`).
31+
932

1033
GeoPandas integration
1134
---------------------

docs/source/install.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22

33
## Requirements
44

5-
Supports Python 3.10 - 3.14 and GDAL 3.6.x - 3.11.x
6-
7-
Reading to GeoDataFrames requires `geopandas>=0.12` with `shapely>=2`.
8-
9-
Additionally, installing `pyarrow` in combination with GDAL 3.6+ enables
10-
a further speed-up when specifying `use_arrow=True`.
5+
- Python >= 3.10
6+
- GDAL >= 3.6
7+
- Reading to GeoDataFrames requires `geopandas>=0.12` and `shapely>=2`. Additionally,
8+
installing `pyarrow` enables a further speed-up when specifying `use_arrow=True`.
119

1210
## Installation
1311

@@ -48,10 +46,16 @@ most likely due to the installation process falling back to installing from the
4846
source distribution because the available wheels are not compatible with your
4947
platform.
5048

51-
The binary wheels available on PyPI include the core GDAL drivers (GeoJSON,
52-
ESRI Shapefile, GPKG, FGB, OpenFileGDB, etc) but do not include more advanced
53-
drivers such as LIBKML and Spatialite. If you need such drivers, we recommend
54-
that you use conda-forge to install pyogrio as explained above.
49+
Note that the GDAL version included in the binary wheels is not always the latest
50+
version and is likely to be a different version than the system GDAL. Please use
51+
{attr}`pyogrio.__gdal_version_string__` to get the GDAL version being used by
52+
pyogrio. Also note that the wheels include the most common GDAL vector drivers
53+
(GeoJSON, ESRI Shapefile, GPKG, FGB, OpenFileGDB, etc), but not all drivers. Use
54+
{func}`pyogrio.list_drivers` to list the drivers available in pyogrio.
55+
56+
If you need drivers that are not included in the wheels, or if you need pyogrio
57+
to use a newer version of GDAL, consider using `conda-forge` to install pyogrio as
58+
explained above.
5559

5660
### Troubleshooting installation errors
5761

docs/source/introduction.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ You can display the GDAL version that Pyogrio was compiled against by
1010

1111
## List available drivers
1212

13-
Use `pyogrio.list_drivers()` to list all available drivers in your installation
13+
Use {func}`~pyogrio.list_drivers` to list all available drivers in your installation
1414
of GDAL. However, just because a driver is listed does not mean that it is
1515
currently compatible with Pyogrio.
1616

@@ -53,7 +53,7 @@ The following drivers are known to be well-supported and tested in Pyogrio:
5353

5454
## List available layers
5555

56-
To list layers available in a data source:
56+
To list layers available in a data source, use {func}`~pyogrio.list_layers`:
5757

5858
```python
5959
>>> from pyogrio import list_layers
@@ -68,9 +68,9 @@ be nonspatial. In this case, the geometry type will be `None`.
6868

6969
## Read basic information about a data layer
7070

71-
To list information about a data layer in a data source, use the name of the layer
72-
or its index (0-based) within the data source. By default, this reads from the
73-
first layer.
71+
To list information about a data layer in a data source, use
72+
{func}`~pyogrio.read_info`. You can specify the name of the layer or its index
73+
(0-based) within the data source. By default, this reads from the first layer.
7474

7575
```python
7676
>>> from pyogrio import read_info
@@ -102,8 +102,9 @@ To read from a layer using name or index (the following are equivalent):
102102

103103
## Read a data layer into a GeoPandas GeoDataFrame
104104

105-
To read all features from a spatial data layer. By default, this operates on
106-
the first layer unless `layer` is specified using layer name or index.
105+
To read all features from a spatial data layer, use {func}`~pyogrio.read_dataframe`.
106+
By default, this operates on the first layer unless `layer` is specified using layer
107+
name or index.
107108

108109
```python
109110
>>> from pyogrio import read_dataframe
@@ -212,7 +213,7 @@ Note: the `bbox` values must be in the same CRS as the dataset.
212213
Note: if GEOS is present and used by GDAL, only geometries that intersect `bbox`
213214
will be returned; if GEOS is not available or not used by GDAL, all geometries
214215
with bounding boxes that intersect this bbox will be returned.
215-
`pyogrio.__gdal_geos_version__` will be `None` if GEOS is not detected.
216+
{attr}`pyogrio.__gdal_geos_version__` will be `None` if GEOS is not detected.
216217

217218
## Filter records by a geometry
218219

@@ -238,7 +239,7 @@ need to convert it to a Shapely geometry before using `mask`.
238239
Note: if GEOS is present and used by GDAL, only geometries that intersect `mask`
239240
will be returned; if GEOS is not available or not used by GDAL, all geometries
240241
with bounding boxes that intersect the bounding box of `mask` will be returned.
241-
`pyogrio.__gdal_geos_version__` will be `None` if GEOS is not detected.
242+
{attr}`pyogrio.__gdal_geos_version__` will be `None` if GEOS is not detected.
242243

243244
## Execute a sql query
244245

@@ -345,7 +346,8 @@ or a DBF file, directly into a Pandas `DataFrame`.
345346
## Read feature bounds
346347

347348
You can read the bounds of all or a subset of features in the dataset in order
348-
to create a spatial index of features without reading all underlying geometries.
349+
to create a spatial index of features without reading all underlying geometries
350+
with {func}`~pyogrio.read_bounds`.
349351
This is typically 2-3x faster than reading full feature data, but the main
350352
benefit is to avoid reading all feature data into memory for very large datasets.
351353

@@ -368,7 +370,7 @@ This function supports options to subset features from the dataset:
368370

369371
## Write a GeoPandas GeoDataFrame
370372

371-
You can write a `GeoDataFrame` `df` to a file as follows:
373+
You can write a `GeoDataFrame` `df` to a file with {func}`~pyogrio.write_dataframe`:
372374

373375
```python
374376
>>> from pyogrio import write_dataframe
@@ -472,7 +474,7 @@ You can also read from a URL with this syntax:
472474

473475
GDAL only supports datetimes at a millisecond resolution. Reading data will thus
474476
give at most millisecond resolution (`datetime64[ms]` data type). With pandas 2.0
475-
`pyogrio.read_dataframe()` will return datetime data as `datetime64[ms]`
477+
{func}`~pyogrio.read_dataframe` will return datetime data as `datetime64[ms]`
476478
correspondingly. For previous versions of pandas, `datetime64[ns]` is used as
477479
ms precision was not supported. When writing, only precision up to
478480
ms is retained.
@@ -489,7 +491,7 @@ in mixed time zone offsets being written for time zones where daylight saving
489491
time is used (e.g. +01:00 and +02:00 offsets for time zone Europe/Brussels).
490492
When roundtripping through GDAL, the information about the original time zone
491493
is lost, only the offsets can be preserved. By default,
492-
{func}`pyogrio.read_dataframe()` will convert columns with mixed offsets to UTC
494+
{func}`pyogrio.read_dataframe` will convert columns with mixed offsets to UTC
493495
to return a datetime64 column. If you want to preserve the original offsets,
494496
you can use `datetime_as_string=True` or `mixed_offsets_as_utc=False`.
495497

@@ -498,7 +500,7 @@ you can use `datetime_as_string=True` or `mixed_offsets_as_utc=False`.
498500
It is possible to use dataset and layer creation options available for a given
499501
driver in GDAL (see the relevant
500502
[GDAL driver page](https://gdal.org/drivers/vector/index.html)). These
501-
can be passed in as additional `kwargs` to `write_dataframe` or using
503+
can be passed in as additional `kwargs` to {func}`~pyogrio.write_dataframe` or using
502504
dictionaries for dataset or layer-level options.
503505

504506
Where possible, Pyogrio uses the metadata of the driver to determine if a

docs/source/known_issues.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ encountered, the following occurs:
1515
Note: detection of NULL or otherwise unset field values is limited to the subset
1616
of records that are read from the data layer, which means that reading different
1717
subsets of records may yield different data types for the same columns. You
18-
can use `read_info()` to determine the original data types of each column.
18+
can use {func}`~pyogrio.read_info` to determine the original data types of each
19+
column.
1920

2021
## No support for measured geometries
2122

@@ -105,9 +106,9 @@ We recommend the following to sidestep performance issues:
105106
## Incorrect results when using a spatial filter and Arrow interface
106107

107108
Due to [a bug in GDAL](https://github.com/OSGeo/gdal/issues/8347), when using
108-
the Arrow interface (e.g., via `use_arrow` on `read_dataframe`) certain drivers
109-
(e.g., GPKG, FlatGeobuf, Arrow, Parquet) returned features whose bounding boxes
110-
intersected the bounding box specified by `bbox` or `mask` geometry instead of
111-
those whose geometry intersected the `bbox` or `mask`.
109+
the Arrow interface (e.g., via `use_arrow` on {func}`~pyogrio.read_dataframe`)
110+
certain drivers (e.g., GPKG, FlatGeobuf, Arrow, Parquet) returned features whose
111+
bounding boxes intersected the bounding box specified by `bbox` or `mask` geometry
112+
instead of those whose geometry intersected the `bbox` or `mask`.
112113

113114
A fix is expected in GDAL 3.8.0.

pyogrio/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Vectorized vector I/O using OGR."""
1+
"""Bulk-oriented vector I/O using OGR."""
22

33
try:
44
# we try importing shapely, to ensure it is imported (and it can load its

0 commit comments

Comments
 (0)