{ "info": { "author": "Guilhem Vellut", "author_email": "g@vellut.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Information Technology", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: GIS" ], "description": "# RastaChimp\n\nRastaChimp is a utility library to perform topological processing of polygons vectorized from rasters, as returned by the [rasterio.features.shapes function](https://mapbox.github.io/rasterio/topics/features.html):\n\n- Simplification, using Douglas-Peucker: [Shapely](https://toblerity.org/shapely/manual.html) (and GEOS) can be used to simplify polygons but will create gaps and overlaps between polygons that share a boundary (even with preserve_topology=true)\n- Smoothing, using the Chaikin method\n- Densify\n\nRastaChimp decomposes the polygons into edges (using Shapely), applies an operation to them then rebuilds transformed polygons. It works well as long as the output of rasterio.features.shapes is in pixel coordinates (default) or the transform to world coordinates does not have a rotation component, which is usually the case. Because of limited floating precision, it may not work well in the more general case, although it could if the polygons are noded (for example, by using the [bpol tool of v.clean in GRASS](https://grass.osgeo.org/grass73/manuals/v.clean.html)).\n\n### Install\n\n`pip install rastachimp`\n\n### Usage\n\nThe function to perform simplification is ```simplify_dp```. As inputs, it takes the tuples (geometry, value) as output from rasterio.features.shapes and the tolerance (in the same unit as the input geometries). It returns an iterator of tuples (geometry, value), just like rasterio.features.shapes.\n\n```python\nfrom rasterio import features\nfrom rastachimp import as_shapely, simplify_dp\n\n# 2D array with classification values\nimage = np.array(...., dtype=np.uint8)\n\n# no transform => in pixel coordinates\nshapes = features.shapes(image)\n\n# convert to Shapely geometry (features.shapes returns a GeoJSON dict)\nshapes = as_shapely(shapes)\n\ntolerance = 2\n# simpl is an interator of tuples (geometry, value)\nsimpl = simplify_dp(shapes, tolerance)\n\n```\n\n### Issues\n\nReport issues at https://github.com/gvellut/rastachimp/issues\n\n### TODO\n\n- Better detection and handling of bad inputs\n- Other generalization algorithms (Visvalingam)\n- Other smoothing algorithm (Bezier Curves)\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/gvellut/rastachimp", "keywords": "gis raster vector data", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "rastachimp", "package_url": "https://pypi.org/project/rastachimp/", "platform": "", "project_url": "https://pypi.org/project/rastachimp/", "project_urls": { "Bug Reports": "https://github.com/gvellut/rastachimp/issues", "Homepage": "https://github.com/gvellut/rastachimp", "Source": "https://github.com/gvellut/rastachimp" }, "release_url": "https://pypi.org/project/rastachimp/0.3/", "requires_dist": [ "shapely (>=1.6)", "rtree", "numba", "black (>=18) ; extra == 'dev'", "isort ; extra == 'dev'", "flake8 (>=3.6) ; extra == 'dev'", "sphinx ; extra == 'dev'", "twine ; extra == 'dev'", "pytest (>=4) ; extra == 'dev'", "rasterio ; extra == 'dev'", "fiona ; extra == 'dev'" ], "requires_python": "", "summary": "Tools for topological processing of polygons vectorized from rasters", "version": "0.3" }, "last_serial": 5390340, "releases": { "0.3": [ { "comment_text": "", "digests": { "md5": "8f9dde6761f8074a4c02c899809cda0f", "sha256": "46fe9f16d357516ece3d4e78c9dccb6442998e623709fbc259ac7525df968e46" }, "downloads": -1, "filename": "rastachimp-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "8f9dde6761f8074a4c02c899809cda0f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8222, "upload_time": "2019-06-12T09:55:06", "url": "https://files.pythonhosted.org/packages/0e/2b/0257507db6973b6affbf8539162868635117da83f181343765c58f83a9aa/rastachimp-0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7b2617cbf2c2859538835805921c40fe", "sha256": "6962410627b84449ce0e8c1d9be70e1a10767df38e9a9c517d6b232cfaa6a3d1" }, "downloads": -1, "filename": "rastachimp-0.3.tar.gz", "has_sig": false, "md5_digest": "7b2617cbf2c2859538835805921c40fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7119, "upload_time": "2019-06-12T09:55:09", "url": "https://files.pythonhosted.org/packages/4c/ca/b9d75e55fe1433b9809787d96bad56c9d11f2dd832f2ad288a0f4a169bcf/rastachimp-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8f9dde6761f8074a4c02c899809cda0f", "sha256": "46fe9f16d357516ece3d4e78c9dccb6442998e623709fbc259ac7525df968e46" }, "downloads": -1, "filename": "rastachimp-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "8f9dde6761f8074a4c02c899809cda0f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8222, "upload_time": "2019-06-12T09:55:06", "url": "https://files.pythonhosted.org/packages/0e/2b/0257507db6973b6affbf8539162868635117da83f181343765c58f83a9aa/rastachimp-0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7b2617cbf2c2859538835805921c40fe", "sha256": "6962410627b84449ce0e8c1d9be70e1a10767df38e9a9c517d6b232cfaa6a3d1" }, "downloads": -1, "filename": "rastachimp-0.3.tar.gz", "has_sig": false, "md5_digest": "7b2617cbf2c2859538835805921c40fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7119, "upload_time": "2019-06-12T09:55:09", "url": "https://files.pythonhosted.org/packages/4c/ca/b9d75e55fe1433b9809787d96bad56c9d11f2dd832f2ad288a0f4a169bcf/rastachimp-0.3.tar.gz" } ] }