Fast file-based format for geometries with Geopandas
Project description
geofeather
A faster file-based format for geometries with geopandas
.
This project capitalizes on the very fast feather
file format to store geometry (points, lines, polygons) data for interoperability with geopandas
.
Why does this exist?
This project exists because reading and writing standard spatial formats (e.g., shapefile) in geopandas
is slow. I was working with millions of geometries in multiple processing steps, and needed a fast way to read and write intermediate files.
In our benchmarks, we see about 5-6x faster file writes than writing from geopandas to shapefile via .to_file()
on a GeoDataFrame
.
We see about 2x faster reads compared to geopandas read_file()
function.
How does it work?
The feather
format works brilliantly for standard pandas
data frames. In order to leverage the feather
format, we simply convert the geometry data from shapely
objects into Well Known Binary (WKB) format, and then store that column as raw bytes.
We store the coordinate reference system using JSON format in a sidecar file .crs
.
Installation
pip install geofeather
Usage
Write
Given an existing GeoDataFrame
my_gdf
, pass this into to_geofeather
:
to_geofeather(my_gdf, 'test.feather')
Read
my_gdf = from_feather('test.feather')
Indexes
Right now, indexes are not supported in feather
files. In order to get around this, simply reset your index before calling to_geofeather
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file geofeather-0.1.0.tar.gz
.
File metadata
- Download URL: geofeather-0.1.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14c1e1bed9c4525263bbaec54c1c0954bc988ef0bd4922c3c261cbfdc0abe902 |
|
MD5 | e3e484098e9ebbf8ebbe5fb0272d0b0f |
|
BLAKE2b-256 | 69dff646da3e97ccd122bed9a65710d32b490a968d9cadb2d05a47e3688aacb5 |
File details
Details for the file geofeather-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: geofeather-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 345a62ce5524cc6775046eb563ebb8455d55f19a838dc07ab40ed51bd93e6bb8 |
|
MD5 | 70832e39c255aa2c9c0cc50fd95b0ae1 |
|
BLAKE2b-256 | e22bc6d58995d6bb12e0c22d3d3f03a57d5d4c7dcfe162c5586f4174a5395896 |