{"id":13408882,"url":"https://github.com/shapely/shapely","last_synced_at":"2025-05-12T05:15:28.924Z","repository":{"id":2136928,"uuid":"3080613","full_name":"shapely/shapely","owner":"shapely","description":"Manipulation and analysis of geometric objects","archived":false,"fork":false,"pushed_at":"2025-05-06T09:43:18.000Z","size":5708,"stargazers_count":4108,"open_issues_count":241,"forks_count":586,"subscribers_count":89,"default_branch":"main","last_synced_at":"2025-05-12T02:43:16.203Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://shapely.readthedocs.io/en/stable/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shapely.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.txt","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2011-12-31T19:43:11.000Z","updated_at":"2025-05-11T20:32:31.000Z","dependencies_parsed_at":"2023-10-16T06:29:00.559Z","dependency_job_id":"73bfe68d-1450-4581-ba87-b5db90595d77","html_url":"https://github.com/shapely/shapely","commit_stats":{"total_commits":2004,"total_committers":160,"mean_commits":12.525,"dds":0.6387225548902196,"last_synced_commit":"3a5b9dcce6c678c200985186c0fb40c87cfb21f6"},"previous_names":["toblerity/shapely"],"tags_count":113,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shapely%2Fshapely","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shapely%2Fshapely/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shapely%2Fshapely/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shapely%2Fshapely/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shapely","download_url":"https://codeload.github.com/shapely/shapely/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253672640,"owners_count":21945478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T20:00:56.087Z","updated_at":"2025-05-12T05:15:28.887Z","avatar_url":"https://github.com/shapely.png","language":"Python","readme":"=======\nShapely\n=======\n\n.. Documentation at RTD — https://readthedocs.org\n\n.. image:: https://readthedocs.org/projects/shapely/badge/?version=stable\n   :alt: Documentation Status\n   :target: https://shapely.readthedocs.io/en/stable/\n\n.. Github Actions status — https://github.com/shapely/shapely/actions\n\n.. |github-actions| image:: https://github.com/shapely/shapely/workflows/Tests/badge.svg?branch=main\n   :alt: Github Actions status\n   :target: https://github.com/shapely/shapely/actions?query=branch%3Amain\n\n.. PyPI\n\n.. image:: https://img.shields.io/pypi/v/shapely.svg\n   :alt: PyPI\n   :target: https://pypi.org/project/shapely/\n\n.. Anaconda\n\n.. image:: https://img.shields.io/conda/vn/conda-forge/shapely\n   :alt: Anaconda\n   :target: https://anaconda.org/conda-forge/shapely\n\n.. Coverage\n\n.. |coveralls| image:: https://coveralls.io/repos/github/shapely/shapely/badge.svg?branch=main\n   :target: https://coveralls.io/github/shapely/shapely?branch=main\n\n.. Zenodo\n\n.. .. image:: https://zenodo.org/badge/191151963.svg\n..   :alt: Zenodo\n..   :target: https://zenodo.org/badge/latestdoi/191151963\n\nManipulation and analysis of geometric objects in the Cartesian plane.\n\n.. image:: https://c2.staticflickr.com/6/5560/31301790086_b3472ea4e9_c.jpg\n   :width: 800\n   :height: 378\n\nShapely is a BSD-licensed Python package for manipulation and analysis of\nplanar geometric objects. It is using the widely deployed open-source\ngeometry library `GEOS \u003chttps://libgeos.org/\u003e`__ (the engine of `PostGIS\n\u003chttps://postgis.net/\u003e`__, and a port of `JTS \u003chttps://locationtech.github.io/jts/\u003e`__).\nShapely wraps GEOS geometries and operations to provide both a feature rich\n`Geometry` interface for singular (scalar) geometries and higher-performance\nNumPy ufuncs for operations using arrays of geometries.\nShapely is not primarily focused on data serialization formats or coordinate\nsystems, but can be readily integrated with packages that are.\n\nWhat is a ufunc?\n----------------\n\nA universal function (or ufunc for short) is a function that operates on\n*n*-dimensional arrays on an element-by-element fashion and supports array\nbroadcasting. The underlying ``for`` loops are implemented in C to reduce the\noverhead of the Python interpreter.\n\nMultithreading\n--------------\n\nShapely functions generally support multithreading by releasing the Global\nInterpreter Lock (GIL) during execution. Normally in Python, the GIL prevents\nmultiple threads from computing at the same time. Shapely functions\ninternally release this constraint so that the heavy lifting done by GEOS can\nbe done in parallel, from a single Python process.\n\nUsage\n=====\n\nHere is the canonical example of building an approximately circular patch by\nbuffering a point, using the scalar Geometry interface:\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e from shapely import Point\n    \u003e\u003e\u003e patch = Point(0.0, 0.0).buffer(10.0)\n    \u003e\u003e\u003e patch\n    \u003cPOLYGON ((10 0, 9.952 -0.98, 9.808 -1.951, 9.569 -2.903, 9.239 -3.827, 8.81...\u003e\n    \u003e\u003e\u003e patch.area\n    313.6548490545941\n\nUsing the vectorized ufunc interface (instead of using a manual for loop),\ncompare an array of points with a polygon:\n\n.. code:: python\n\n    \u003e\u003e\u003e import shapely\n    \u003e\u003e\u003e import numpy as np\n    \u003e\u003e\u003e geoms = np.array([Point(0, 0), Point(1, 1), Point(2, 2)])\n    \u003e\u003e\u003e polygon = shapely.box(0, 0, 2, 2)\n\n    \u003e\u003e\u003e shapely.contains(polygon, geoms)\n    array([False,  True, False])\n\nSee the documentation for more examples and guidance: https://shapely.readthedocs.io\n\nRequirements\n============\n\nShapely 2.1 requires\n\n* Python \u003e=3.10\n* GEOS \u003e=3.9\n* NumPy \u003e=1.21\n\nInstalling Shapely\n==================\n\nWe recommend installing Shapely using one of the available built\ndistributions, for example using ``pip`` or ``conda``:\n\n.. code-block:: console\n\n    $ pip install shapely\n    # or using conda\n    $ conda install shapely --channel conda-forge\n\nSee the `installation documentation \u003chttps://shapely.readthedocs.io/en/latest/installation.html\u003e`__\nfor more details and advanced installation instructions.\n\nIntegration\n===========\n\nShapely does not read or write data files, but it can serialize and deserialize\nusing several well known formats and protocols. The shapely.wkb and shapely.wkt\nmodules provide dumpers and loaders inspired by Python's pickle module.\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e from shapely.wkt import dumps, loads\n    \u003e\u003e\u003e dumps(loads('POINT (0 0)'))\n    'POINT (0.0000000000000000 0.0000000000000000)'\n\nShapely can also integrate with other Python GIS packages using GeoJSON-like\ndicts.\n\n.. code-block:: pycon\n\n    \u003e\u003e\u003e import json\n    \u003e\u003e\u003e from shapely.geometry import mapping, shape\n    \u003e\u003e\u003e s = shape(json.loads('{\"type\": \"Point\", \"coordinates\": [0.0, 0.0]}'))\n    \u003e\u003e\u003e s\n    \u003cPOINT (0 0)\u003e\n    \u003e\u003e\u003e print(json.dumps(mapping(s)))\n    {\"type\": \"Point\", \"coordinates\": [0.0, 0.0]}\n\nSupport\n=======\n\nQuestions about using Shapely may be asked on the `GIS StackExchange\n\u003chttps://gis.stackexchange.com/questions/tagged/shapely\u003e`__ using the \"shapely\"\ntag.\n\nBugs may be reported at https://github.com/shapely/shapely/issues.\n\nCopyright \u0026 License\n===================\n\nShapely is licensed under BSD 3-Clause license.\nGEOS is available under the terms of GNU Lesser General Public License (LGPL) 2.1 at https://libgeos.org.\n","funding_links":[],"categories":["Libraries","Python","地理Geo处理","CAD","Uncategorized","کتابخانه هاي جغرافيا","Science"],"sub_categories":["Uncategorized","کار با زمان و تقویم"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshapely%2Fshapely","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshapely%2Fshapely","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshapely%2Fshapely/lists"}