METADATA 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. Metadata-Version: 2.4
  2. Name: shapely
  3. Version: 2.1.2
  4. Summary: Manipulation and analysis of geometric objects
  5. Author: Sean Gillies
  6. Maintainer: Shapely contributors
  7. License: BSD 3-Clause
  8. Project-URL: Documentation, https://shapely.readthedocs.io/
  9. Project-URL: Repository, https://github.com/shapely/shapely
  10. Keywords: geometry,topology,gis
  11. Classifier: Development Status :: 5 - Production/Stable
  12. Classifier: Intended Audience :: Developers
  13. Classifier: Intended Audience :: Science/Research
  14. Classifier: License :: OSI Approved :: BSD License
  15. Classifier: Operating System :: Unix
  16. Classifier: Operating System :: MacOS
  17. Classifier: Operating System :: Microsoft :: Windows
  18. Classifier: Programming Language :: Python :: 3
  19. Classifier: Programming Language :: Python :: 3.10
  20. Classifier: Programming Language :: Python :: 3.11
  21. Classifier: Programming Language :: Python :: 3.12
  22. Classifier: Programming Language :: Python :: 3.13
  23. Classifier: Programming Language :: Python :: 3.14
  24. Classifier: Topic :: Scientific/Engineering :: GIS
  25. Requires-Python: >=3.10
  26. Description-Content-Type: text/x-rst
  27. License-File: LICENSE.txt
  28. License-File: LICENSE_GEOS
  29. License-File: LICENSE_win32
  30. Requires-Dist: numpy>=1.21
  31. Provides-Extra: test
  32. Requires-Dist: pytest; extra == "test"
  33. Requires-Dist: pytest-cov; extra == "test"
  34. Requires-Dist: scipy-doctest; extra == "test"
  35. Provides-Extra: docs
  36. Requires-Dist: numpydoc==1.1.*; extra == "docs"
  37. Requires-Dist: matplotlib; extra == "docs"
  38. Requires-Dist: sphinx; extra == "docs"
  39. Requires-Dist: sphinx-book-theme; extra == "docs"
  40. Requires-Dist: sphinx-remove-toctrees; extra == "docs"
  41. Dynamic: license-file
  42. =======
  43. Shapely
  44. =======
  45. .. Documentation at RTD — https://readthedocs.org
  46. .. image:: https://readthedocs.org/projects/shapely/badge/?version=stable
  47. :alt: Documentation Status
  48. :target: https://shapely.readthedocs.io/en/stable/
  49. .. Github Actions status — https://github.com/shapely/shapely/actions
  50. .. |github-actions| image:: https://github.com/shapely/shapely/workflows/Tests/badge.svg?branch=main
  51. :alt: Github Actions status
  52. :target: https://github.com/shapely/shapely/actions?query=branch%3Amain
  53. .. PyPI
  54. .. image:: https://img.shields.io/pypi/v/shapely.svg
  55. :alt: PyPI
  56. :target: https://pypi.org/project/shapely/
  57. .. Anaconda
  58. .. image:: https://img.shields.io/conda/vn/conda-forge/shapely
  59. :alt: Anaconda
  60. :target: https://anaconda.org/conda-forge/shapely
  61. .. Coverage
  62. .. |coveralls| image:: https://coveralls.io/repos/github/shapely/shapely/badge.svg?branch=main
  63. :target: https://coveralls.io/github/shapely/shapely?branch=main
  64. .. Zenodo
  65. .. .. image:: https://zenodo.org/badge/191151963.svg
  66. .. :alt: Zenodo
  67. .. :target: https://zenodo.org/badge/latestdoi/191151963
  68. Manipulation and analysis of geometric objects in the Cartesian plane.
  69. .. image:: https://c2.staticflickr.com/6/5560/31301790086_b3472ea4e9_c.jpg
  70. :width: 800
  71. :height: 378
  72. Shapely is a BSD-licensed Python package for manipulation and analysis of
  73. planar geometric objects. It is using the widely deployed open-source
  74. geometry library `GEOS <https://libgeos.org/>`__ (the engine of `PostGIS
  75. <https://postgis.net/>`__, and a port of `JTS <https://locationtech.github.io/jts/>`__).
  76. Shapely wraps GEOS geometries and operations to provide both a feature rich
  77. `Geometry` interface for singular (scalar) geometries and higher-performance
  78. NumPy ufuncs for operations using arrays of geometries.
  79. Shapely is not primarily focused on data serialization formats or coordinate
  80. systems, but can be readily integrated with packages that are.
  81. What is a ufunc?
  82. ----------------
  83. A universal function (or ufunc for short) is a function that operates on
  84. *n*-dimensional arrays on an element-by-element fashion and supports array
  85. broadcasting. The underlying ``for`` loops are implemented in C to reduce the
  86. overhead of the Python interpreter.
  87. Multithreading
  88. --------------
  89. Shapely functions generally support multithreading by releasing the Global
  90. Interpreter Lock (GIL) during execution. Normally in Python, the GIL prevents
  91. multiple threads from computing at the same time. Shapely functions
  92. internally release this constraint so that the heavy lifting done by GEOS can
  93. be done in parallel, from a single Python process.
  94. Usage
  95. =====
  96. Here is the canonical example of building an approximately circular patch by
  97. buffering a point, using the scalar Geometry interface:
  98. .. code-block:: pycon
  99. >>> from shapely import Point
  100. >>> patch = Point(0.0, 0.0).buffer(10.0)
  101. >>> patch
  102. <POLYGON ((10 0, 9.952 -0.98, 9.808 -1.951, 9.569 -2.903, 9.239 -3.827, 8.81...>
  103. >>> patch.area
  104. 313.6548490545941
  105. Using the vectorized ufunc interface (instead of using a manual for loop),
  106. compare an array of points with a polygon:
  107. .. code:: python
  108. >>> import shapely
  109. >>> import numpy as np
  110. >>> geoms = np.array([Point(0, 0), Point(1, 1), Point(2, 2)])
  111. >>> polygon = shapely.box(0, 0, 2, 2)
  112. >>> shapely.contains(polygon, geoms)
  113. array([False, True, False])
  114. See the documentation for more examples and guidance: https://shapely.readthedocs.io
  115. Requirements
  116. ============
  117. Shapely 2.1 requires
  118. * Python >=3.10
  119. * GEOS >=3.9
  120. * NumPy >=1.21
  121. Installing Shapely
  122. ==================
  123. We recommend installing Shapely using one of the available built
  124. distributions, for example using ``pip`` or ``conda``:
  125. .. code-block:: console
  126. $ pip install shapely
  127. # or using conda
  128. $ conda install shapely --channel conda-forge
  129. See the `installation documentation <https://shapely.readthedocs.io/en/latest/installation.html>`__
  130. for more details and advanced installation instructions.
  131. Integration
  132. ===========
  133. Shapely does not read or write data files, but it can serialize and deserialize
  134. using several well known formats and protocols. The shapely.wkb and shapely.wkt
  135. modules provide dumpers and loaders inspired by Python's pickle module.
  136. .. code-block:: pycon
  137. >>> from shapely.wkt import dumps, loads
  138. >>> dumps(loads('POINT (0 0)'))
  139. 'POINT (0.0000000000000000 0.0000000000000000)'
  140. Shapely can also integrate with other Python GIS packages using GeoJSON-like
  141. dicts.
  142. .. code-block:: pycon
  143. >>> import json
  144. >>> from shapely.geometry import mapping, shape
  145. >>> s = shape(json.loads('{"type": "Point", "coordinates": [0.0, 0.0]}'))
  146. >>> s
  147. <POINT (0 0)>
  148. >>> print(json.dumps(mapping(s)))
  149. {"type": "Point", "coordinates": [0.0, 0.0]}
  150. Support
  151. =======
  152. Questions about using Shapely may be asked on the `GIS StackExchange
  153. <https://gis.stackexchange.com/questions/tagged/shapely>`__ using the "shapely"
  154. tag.
  155. Bugs may be reported at https://github.com/shapely/shapely/issues.
  156. Copyright & License
  157. ===================
  158. Shapely is licensed under BSD 3-Clause license.
  159. GEOS is available under the terms of GNU Lesser General Public License (LGPL) 2.1 at https://libgeos.org.