Skip to main content

GEOS wrapped in numpy ufuncs

Project description

Documentation Status Github Actions status Github Actions status Appveyor CI status Travis CI status PyPI Anaconda Zenodo

PyGEOS is a C/Python library with vectorized geometry functions. The geometry operations are done in the open-source geometry library GEOS. PyGEOS wraps these operations in NumPy ufuncs providing a performance improvement when operating on arrays of geometries.

Note: PyGEOS is a very young package. While the available functionality should be stable and working correctly, it’s still possible that APIs change in upcoming releases. But we would love for you to try it out, give feedback or contribute!

What is a ufunc?

A universal function (or ufunc for short) is a function that operates on n-dimensional arrays in an element-by-element fashion, supporting array broadcasting. The for-loops that are involved are fully implemented in C diminishing the overhead of the Python interpreter.

Multithreading

PyGEOS functions support multithreading. More specifically, the Global Interpreter Lock (GIL) is released during function execution. Normally in Python, the GIL prevents multiple threads from computing at the same time. PyGEOS functions internally releases this constraint so that the heavy lifting done by GEOS can be done in parallel, from a single Python process.

Examples

Compare an grid of points with a polygon:

>>> geoms = points(*np.indices((4, 4)))
>>> polygon = box(0, 0, 2, 2)

>>> contains(polygon, geoms)

  array([[False, False, False, False],
         [False,  True, False, False],
         [False, False, False, False],
         [False, False, False, False]])

Compute the area of all possible intersections of two lists of polygons:

>>> from pygeos import box, area, intersection

>>> polygons_x = box(range(5), 0, range(10, 15), 10)
>>> polygons_y = box(0, range(5), 10, range(10, 15))

>>> area(intersection(polygons_x[:, np.newaxis], polygons_y[np.newaxis, :]))

array([[100.,  90.,  80.,  70.,  60.],
     [ 90.,  81.,  72.,  63.,  54.],
     [ 80.,  72.,  64.,  56.,  48.],
     [ 70.,  63.,  56.,  49.,  42.],
     [ 60.,  54.,  48.,  42.,  36.]])

See the documentation for more: https://pygeos.readthedocs.io

Relationship to Shapely

Both Shapely and PyGEOS are exposing the functionality of the GEOS C++ library to Python. While Shapely only deals with single geometries, PyGEOS provides vectorized functions to work with arrays of geometries, giving better performance and convenience for such usecases.

There is active discussion and work toward integrating PyGEOS into Shapely:

For now PyGEOS is developed as a separate project.

References

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygeos-0.10.1.tar.gz (106.9 kB view details)

Uploaded Source

Built Distributions

pygeos-0.10.1-cp39-cp39-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.9 Windows x86-64

pygeos-0.10.1-cp39-cp39-win32.whl (953.9 kB view details)

Uploaded CPython 3.9 Windows x86

pygeos-0.10.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.5+ x86-64

pygeos-0.10.1-cp39-cp39-macosx_10_9_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pygeos-0.10.1-cp38-cp38-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.8 Windows x86-64

pygeos-0.10.1-cp38-cp38-win32.whl (963.3 kB view details)

Uploaded CPython 3.8 Windows x86

pygeos-0.10.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.5+ x86-64

pygeos-0.10.1-cp38-cp38-macosx_10_9_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

pygeos-0.10.1-cp37-cp37m-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.7m Windows x86-64

pygeos-0.10.1-cp37-cp37m-win32.whl (960.6 kB view details)

Uploaded CPython 3.7m Windows x86

pygeos-0.10.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.5+ x86-64

pygeos-0.10.1-cp37-cp37m-macosx_10_9_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

pygeos-0.10.1-cp36-cp36m-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.6m Windows x86-64

pygeos-0.10.1-cp36-cp36m-win32.whl (960.8 kB view details)

Uploaded CPython 3.6m Windows x86

pygeos-0.10.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.6m manylinux: glibc 2.5+ x86-64

pygeos-0.10.1-cp36-cp36m-macosx_10_9_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.6m macOS 10.9+ x86-64

File details

Details for the file pygeos-0.10.1.tar.gz.

File metadata

  • Download URL: pygeos-0.10.1.tar.gz
  • Upload date:
  • Size: 106.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200325 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

File hashes

Hashes for pygeos-0.10.1.tar.gz
Algorithm Hash digest
SHA256 c14e6dd03c49a3cd64e4badefcdf229b7b06ff75e15b35ba59974a2c16fa30d9
MD5 a17530c9049070069ac7a1ebeed40584
BLAKE2b-256 aa9b01799a839e5894afd15490b511efb2c990d3cbcc35eed80fe8e183276ee5

See more details on using hashes here.

File details

Details for the file pygeos-0.10.1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pygeos-0.10.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.1

File hashes

Hashes for pygeos-0.10.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 3d19f60852ff0d95e8ccdffdbff446ec108d1e9656328d04e3c6a061daea25d9
MD5 23565b19b2313e764cd29481ec1dc3b6
BLAKE2b-256 2ca3277d7781d05f1c657d7250bf2b49a5b1921fad4460e2b3c074b931c7fc4d

See more details on using hashes here.

File details

Details for the file pygeos-0.10.1-cp39-cp39-win32.whl.

File metadata

  • Download URL: pygeos-0.10.1-cp39-cp39-win32.whl
  • Upload date:
  • Size: 953.9 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.1

File hashes

Hashes for pygeos-0.10.1-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 7ed8456278bc139795c0acacc24ae7aceb1ceb5aa6492abded4ac0872e45d0c7
MD5 8ab0c7ddc05f405ed8579607837929fb
BLAKE2b-256 f3d380dab4eaa058d0eb17e8a2e7b1a5124410cd43b8a9a41cf90796bce6304f

See more details on using hashes here.

File details

Details for the file pygeos-0.10.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pygeos-0.10.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 97cedc25e2e8dccaab97f096ad7535ebf0c19dd03986cec01ffa227897221366
MD5 afb09c5a4c388c7f397245ff0fbebd1d
BLAKE2b-256 9421abb86050ffbf7c75e20eb6ebeecbae101c3488b405e997caf2249d38787e

See more details on using hashes here.

File details

Details for the file pygeos-0.10.1-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: pygeos-0.10.1-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.9, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.1

File hashes

Hashes for pygeos-0.10.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6abd3ab3c0eb438e074d851a5f9d6c68aac0ce7dcb9cb8a57a56b057b1a15f60
MD5 cb217cd9553025d2ce44b2e279200ab6
BLAKE2b-256 d0efc405e73758ff97923944f9e2180e4a0a673429a5e8a3cb61eef63533d46f

See more details on using hashes here.

File details

Details for the file pygeos-0.10.1-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: pygeos-0.10.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.7

File hashes

Hashes for pygeos-0.10.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 af8ab0b75fbf042024f3417189f877ae69e0b467c4c4447c51ca5ceaa2eafb70
MD5 fb918c7e360da86e70a186905c93c6ee
BLAKE2b-256 96452afbcf3f623b7b4bb076b516ab2a4d3edb0bf30c005eaea3948356cdd2fa

See more details on using hashes here.

File details

Details for the file pygeos-0.10.1-cp38-cp38-win32.whl.

File metadata

  • Download URL: pygeos-0.10.1-cp38-cp38-win32.whl
  • Upload date:
  • Size: 963.3 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.7

File hashes

Hashes for pygeos-0.10.1-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 0fd25072b522e9bc11e4e4446d1ef8da4b3a8039e1ece39944f863833b1ad01c
MD5 b7ab183e05a05c038209fe0504421c58
BLAKE2b-256 0b6536deb4ea90881730fa557d9dcbb3863875642ca5dfc4b899d0eb6347ffc8

See more details on using hashes here.

File details

Details for the file pygeos-0.10.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pygeos-0.10.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1a1fd085f97e7876204af801138459c52630270fed4b679092e619a6f3053e54
MD5 4fe7098a9847cde6981c286749ac6de9
BLAKE2b-256 76b5efa275ee69680cd79a7cb1fed51fa15a2149b0fa645048412b3833e490e3

See more details on using hashes here.

File details

Details for the file pygeos-0.10.1-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: pygeos-0.10.1-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.7

File hashes

Hashes for pygeos-0.10.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3dff1c4ace6d20273dae913cd43156242fdee8a6947674ca556d20e8a5fed0a3
MD5 9fb815e5da11bcde4e6d137053f347c9
BLAKE2b-256 b249d0e2234efadd1044901a6022642754199ca68d55b6d81231802db05f0106

See more details on using hashes here.

File details

Details for the file pygeos-0.10.1-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: pygeos-0.10.1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.9

File hashes

Hashes for pygeos-0.10.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 c71035d423cd73ef0ca794787ca292bae56fc03e4e291e223972383ebc3a778a
MD5 83b40593257c6aa3330aa24759cbbe43
BLAKE2b-256 290e706b27f9d75d7b8cc8f1bf69c3430616882918d6e21aeb766ec714b935dc

See more details on using hashes here.

File details

Details for the file pygeos-0.10.1-cp37-cp37m-win32.whl.

File metadata

  • Download URL: pygeos-0.10.1-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 960.6 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.9

File hashes

Hashes for pygeos-0.10.1-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 a23d6f1c4a8ee2185c0da1aef606ecd955dadb7ab1571f62bad6b30cb50965b3
MD5 2ea3256c6bb1ca35db54eb96f86817a5
BLAKE2b-256 8f470d4db090c129845bd3789c8efabef93d9839d240fee0d167f4ea67e7451f

See more details on using hashes here.

File details

Details for the file pygeos-0.10.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pygeos-0.10.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c0105bf77fc5cc5fc721541b1ffe67304abc80a17f96b0953a77804ca036324b
MD5 145df693fa42951955dddebae06d3ff8
BLAKE2b-256 8c1b8e40e7cf2e854eeb7dfed99071fa62ea26190b891292b5a596be58ef1f04

See more details on using hashes here.

File details

Details for the file pygeos-0.10.1-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: pygeos-0.10.1-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.9

File hashes

Hashes for pygeos-0.10.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e963272f19f1c898743393a9ff943395295af975f326839a50e5e90a9443b9ac
MD5 44c39409f973784e84843196d592886e
BLAKE2b-256 f72e3f4284d1563b7cd2199b85a8b79ed46f16777dde58b7511da2f6ccd31261

See more details on using hashes here.

File details

Details for the file pygeos-0.10.1-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: pygeos-0.10.1-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.6.8

File hashes

Hashes for pygeos-0.10.1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 6456c8de69e24395cf27f9107535ff7e33170d92af925097fd9acb23b950418c
MD5 2419a53371c683b9e893c4ab41a9ebbc
BLAKE2b-256 eaf77c17d72bf7ac9ae2bec3c5c1bce9e4b15c46f289fe1002c9f3bc47cd1429

See more details on using hashes here.

File details

Details for the file pygeos-0.10.1-cp36-cp36m-win32.whl.

File metadata

  • Download URL: pygeos-0.10.1-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 960.8 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.6.8

File hashes

Hashes for pygeos-0.10.1-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 5a485f9080189fd6211f662418540fdd4bfb9fccdd31bac0e45a46b4cf0bf8bd
MD5 01c862517d6f38f89c44c8ad8ba928ad
BLAKE2b-256 8532f49c64d81689f3ce7f625f21b691a3f1f56624baf692e51860f234c36694

See more details on using hashes here.

File details

Details for the file pygeos-0.10.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for pygeos-0.10.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5c4ae0dbbd724d4e26862c324b9056084fa23d66caf1806d87c454f3c8e8ec3c
MD5 ba43c4f368f3bc098ce0d9bee499ec15
BLAKE2b-256 6eb5044c249f50f371f067be1a4bd11cdc8372b58f411eba530864f53c2bbc88

See more details on using hashes here.

File details

Details for the file pygeos-0.10.1-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: pygeos-0.10.1-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 1.8 MB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.6.8

File hashes

Hashes for pygeos-0.10.1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 273d08d2d9d4118b96bc5422c29eaaca0130d2276a69864ae1e977ce87c44735
MD5 e696e9898702c20a15b44a550d43bde9
BLAKE2b-256 f1842313e5aab968960f01c78be7c73975f8909268de5f62d3850e99cf60440c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page