Skip to main content

GEOS wrapped in numpy ufuncs

Project description

Documentation Status Github Actions status Appveyor 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.9.tar.gz (89.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pygeos-0.9-cp39-cp39-win_amd64.whl (977.9 kB view details)

Uploaded CPython 3.9Windows x86-64

pygeos-0.9-cp39-cp39-win32.whl (884.0 kB view details)

Uploaded CPython 3.9Windows x86

pygeos-0.9-cp39-cp39-manylinux1_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.9

pygeos-0.9-cp39-cp39-macosx_10_9_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

pygeos-0.9-cp38-cp38-win_amd64.whl (977.7 kB view details)

Uploaded CPython 3.8Windows x86-64

pygeos-0.9-cp38-cp38-win32.whl (883.9 kB view details)

Uploaded CPython 3.8Windows x86

pygeos-0.9-cp38-cp38-manylinux1_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.8

pygeos-0.9-cp38-cp38-macosx_10_9_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

pygeos-0.9-cp37-cp37m-win_amd64.whl (976.4 kB view details)

Uploaded CPython 3.7mWindows x86-64

pygeos-0.9-cp37-cp37m-win32.whl (882.5 kB view details)

Uploaded CPython 3.7mWindows x86

pygeos-0.9-cp37-cp37m-manylinux1_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.7m

pygeos-0.9-cp37-cp37m-macosx_10_9_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

pygeos-0.9-cp36-cp36m-win_amd64.whl (976.6 kB view details)

Uploaded CPython 3.6mWindows x86-64

pygeos-0.9-cp36-cp36m-win32.whl (882.6 kB view details)

Uploaded CPython 3.6mWindows x86

pygeos-0.9-cp36-cp36m-manylinux1_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.6m

pygeos-0.9-cp36-cp36m-macosx_10_9_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.6mmacOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: pygeos-0.9.tar.gz
  • Upload date:
  • Size: 89.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.18

File hashes

Hashes for pygeos-0.9.tar.gz
Algorithm Hash digest
SHA256 c0584b20e95f80ee57277a6eb1e5d7f86600f8b1ef3c627d238e243afdcc0cc7
MD5 e3d4e04cba540ceba80ce376f1f20192
BLAKE2b-256 1e4b83d7b3b32caeee02bd921c38394526eba9d3d928ef3e99cd4e57453932c0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pygeos-0.9-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 977.9 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for pygeos-0.9-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 aaa10b3a29a6fce9036f80ccfdf96ddb75575ecef8f0dbdbb0a8c456a3793084
MD5 894ac3c592a9044684b36b6e119350fa
BLAKE2b-256 6277a892e33915d1cb53e11dbb4baca45f15cb33be82357dc80d565e2588b125

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pygeos-0.9-cp39-cp39-win32.whl
  • Upload date:
  • Size: 884.0 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for pygeos-0.9-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 b55e9bb4e03a30b809bdda102574d7e09e79907fe4f09c5b53be8c47585e1185
MD5 4886d667b46d019809064fafe1386b26
BLAKE2b-256 779c0eeb5f45c64b02a0fad676f478f390d44ca9d01a4ebf4726bf3fee131524

See more details on using hashes here.

File details

Details for the file pygeos-0.9-cp39-cp39-manylinux1_x86_64.whl.

File metadata

  • Download URL: pygeos-0.9-cp39-cp39-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/2.7.12

File hashes

Hashes for pygeos-0.9-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 8e5b246dd7f1c5c554245a545424cac226443babfd7d6ef71a02b5635da9e8da
MD5 c0e2ba896820e2eea6fe5072da122f30
BLAKE2b-256 dd4ca7dc69d345d8cfcd8f4cd6bcfe806c99c43a627121de5ea0e7f543154c09

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pygeos-0.9-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: CPython 3.9, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for pygeos-0.9-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c3d127091b18d98cd460cc5b20e2acabcf74668e8170146f40a158c01bbad055
MD5 2971b3b96b04b59d9df6242678234f56
BLAKE2b-256 ad9f3dc676f11b4b19f52bd7e4114a7b25e1e5756807b40391f8c285456f6d58

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pygeos-0.9-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 977.7 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for pygeos-0.9-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 fae860732c532697f3708e8da669e057ce6692ed88740f493a522c5ed2f87aac
MD5 272e413cde15514861c2e8f9b7de9b48
BLAKE2b-256 3174a4dd13525ffc758613e54ed4601838f66342e1f7a9277bcdb9e77a39ba94

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pygeos-0.9-cp38-cp38-win32.whl
  • Upload date:
  • Size: 883.9 kB
  • Tags: CPython 3.8, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for pygeos-0.9-cp38-cp38-win32.whl
Algorithm Hash digest
SHA256 bc017fe4521577f8a4f62baf6c4f0882b8c8a0b0fbf65befe5060b1921dfa80e
MD5 711b6a6522cb15515287430444ed79b8
BLAKE2b-256 c64467f75e8645babe3ab272437ec6685f7eb5798db746907bc4b1d8a5c9da14

See more details on using hashes here.

File details

Details for the file pygeos-0.9-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: pygeos-0.9-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/2.7.12

File hashes

Hashes for pygeos-0.9-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 006aee5215d305afa96ce3e930a5fc00cfe9cc5e7c79f194922cd2eeb5547e2a
MD5 55d49344ebcab2959d980aaf2668b1bc
BLAKE2b-256 12bcac39a820715886a8d94f67f9c99560a52cb0dd2a902f8c58f053c52a5d93

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pygeos-0.9-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for pygeos-0.9-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b17fe2ed942e3b83c4afb4d0bb5870ac21a26f8353b137444f49a6b6beb71d2f
MD5 52e54ddde3e5137b09ea11c8742b23fe
BLAKE2b-256 0c16faaf1d1dbadd173cd2ecac5ff6ad6478f06d21afece2a00d6afaf25df04d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pygeos-0.9-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 976.4 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

File hashes

Hashes for pygeos-0.9-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 3eaee0e9f9fcc7b6370bcfe839b15fcaa93dab3c894681df3e3437692decc4f1
MD5 f8192aee2c2da2f831b2cc7c12890f61
BLAKE2b-256 f3236c755dea0c3238d9df945c18ee196eb530b6f8c04d8ce4f8957b72e2b58b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pygeos-0.9-cp37-cp37m-win32.whl
  • Upload date:
  • Size: 882.5 kB
  • Tags: CPython 3.7m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

File hashes

Hashes for pygeos-0.9-cp37-cp37m-win32.whl
Algorithm Hash digest
SHA256 845567e866dbd8821675dce32d63bc9e6aa3a0384e8d5a7f259baf3bafbfd0c9
MD5 8e65d2fea84e63f6cadb44d8c2680705
BLAKE2b-256 5c760fec99a32c668befcb0677f99b8a0aaf47c19a39246765036c4ff1d2d752

See more details on using hashes here.

File details

Details for the file pygeos-0.9-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: pygeos-0.9-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/2.7.12

File hashes

Hashes for pygeos-0.9-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 531661dc547b0a9e03cf3cd8166a11d6a0e8cb3ecb71b8e6b240f6f28314023e
MD5 ef1f5a6e60539a2325dcbbf54f1eee0b
BLAKE2b-256 f52c071f928a67d8a7e754a99ba3281ec685c8dfa4d64f9b83fc53ca2c325b82

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pygeos-0.9-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

File hashes

Hashes for pygeos-0.9-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4341501c725c8945319970f1e572a514719a17ddec6571d319561bb4ae6edf17
MD5 09715df0b6aab287f71d3b550af17e87
BLAKE2b-256 879bbee02491032c9baaa109ed806c43a35b02a9180fa078f463348d64917f0f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pygeos-0.9-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 976.6 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.8

File hashes

Hashes for pygeos-0.9-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 3f9126534e9bc88e872eae267032d0fab35f351d469caf6ffef4e1002bad4550
MD5 7e0b92f03188b4026bd0bfe791f57941
BLAKE2b-256 c9217cf7b1bc07e9a22e62c9592704c18a90e06aee2d599d8b7ad5fee137b015

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pygeos-0.9-cp36-cp36m-win32.whl
  • Upload date:
  • Size: 882.6 kB
  • Tags: CPython 3.6m, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.8

File hashes

Hashes for pygeos-0.9-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 bbf661e2d2aa1fcbe10b4f6d739384a4f58e1006d51ef8d0e577fc62618aec16
MD5 84f160546643b43eb4f31f045344f735
BLAKE2b-256 45a78a553fb3303c2eff8fc773b16633f3e4b24456c113843c68dd2119304b0e

See more details on using hashes here.

File details

Details for the file pygeos-0.9-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: pygeos-0.9-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/2.7.12

File hashes

Hashes for pygeos-0.9-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 82ddf8a6f4ea93d952678e9523f08debea5361d908490b25ac5fd46ed712a652
MD5 5c77881fdcd5d05d7a054e81d91de87e
BLAKE2b-256 f504ea3b71a73070a9a600d6db00d6d50d4ccde05becadbb9d2e7b845e7c6730

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pygeos-0.9-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.8

File hashes

Hashes for pygeos-0.9-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 425221deda0e355166fcf7ce69613de4a52d6cff6ca667ccd1dc446fbad097c4
MD5 27b02af418ed40d5ec1573e57128a296
BLAKE2b-256 eb8715082b0767025e808e13f3187fb902260c43ac8ef9870ed6d90203b9db02

See more details on using hashes here.

Supported by

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