antimeridian


Nameantimeridian JSON
Version 0.3.4 PyPI version JSON
download
home_pageNone
SummaryFix GeoJSON geometries that cross the antimeridian
upload_time2024-03-29 13:06:17
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseApache-2.0
keywords geojson antimeridian shapely
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # antimeridian

[![CI Status](https://img.shields.io/github/actions/workflow/status/gadomski/antimeridian/ci.yaml?style=for-the-badge&label=CI)](https://github.com/gadomski/antimeridian/actions/workflows/ci.yaml)
[![Read the Docs](https://img.shields.io/readthedocs/antimeridian?style=for-the-badge)](https://antimeridian.readthedocs.io/en/stable/)
[![PyPI](https://img.shields.io/pypi/v/antimeridian?style=for-the-badge)](https://pypi.org/project/antimeridian/)

[![GitHub](https://img.shields.io/github/license/gadomski/antimeridian?style=for-the-badge)](https://github.com/gadomski/antimeridian/blob/main/LICENSE)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg?style=for-the-badge)](https://github.com/gadomski/antimeridian/blob/main/CODE_OF_CONDUCT)

<img src="docs/img/complex-split.png" style="width: 600px;" alt="Demonstration image" />

Fix shapes that cross the antimeridian.
See [the documentation](https://antimeridian.readthedocs.io) for information about the underlying algorithm.
Depends on [shapely](https://shapely.readthedocs.io) and [numpy](https://numpy.org/).

Can fix:

- Shapely [`Polygon`](https://shapely.readthedocs.io/en/stable/reference/shapely.Polygon.html#shapely.Polygon), [`MultiPolygon`](https://shapely.readthedocs.io/en/stable/reference/shapely.MultiPolygon.html#shapely.MultiPolygon), [`LineString`](https://shapely.readthedocs.io/en/stable/reference/shapely.LineString.html#shapely.LineString), and [`MultiLineString`](https://shapely.readthedocs.io/en/stable/reference/shapely.MultiLineString.html#shapely.MultiLineString) objects
- GeoJSON [Polygons](https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.6), [MultiPolygons](https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.7), [Features](https://datatracker.ietf.org/doc/html/rfc7946#section-3.2) and [FeatureCollections](https://datatracker.ietf.org/doc/html/rfc7946#section-3.3), as dictionaries
- Anything that has a [`__geo_interface__`](https://gist.github.com/sgillies/2217756)

## Usage

```shell
pip install antimeridian
```

Then:

```python
import antimeridian

fixed = antimeridian.fix_geojson(geojson)
```

We also have some utilities to create [bounding boxes](https://antimeridian.readthedocs.io/en/latest/api.html#antimeridian.bbox) and [centroids](https://antimeridian.readthedocs.io/en/latest/api.html#antimeridian.centroid) from antimeridian-crossing polygons and multipolygons.
See [the documentation](https://antimeridian.readthedocs.io/) for a complete API reference.

### Command line interface

Use the `cli` optional dependency to install the `antimeridian` CLI:

```shell
pip install 'antimeridian[cli]'
antimeridian fix input.json > output.json
```

## Developing

Clone and install in editable mode with the development optional dependencies:

```shell
git clone https://github.com/gadomski/antimeridian
cd antimeridian
pip install -e '.[dev,docs]'
```

We use [pytest](https://docs.pytest.org) for tests:

```shell
pytest
```

We use [Sphinx](https://www.sphinx-doc.org) for docs:

```shell
make -C docs html
```

## Contributing

Github [issues](https://github.com/gadomski/antimeridian/issues) and [pull requests](https://github.com/gadomski/antimeridian/pulls), please and thank you!

## License

[Apache-2.0](https://github.com/gadomski/antimeridian/blob/main/LICENSE)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "antimeridian",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "geojson, antimeridian, shapely",
    "author": null,
    "author_email": "Pete Gadomski <pete.gadomski@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/3b/fd/2a288c9a4cefe32391430e6974e444d8e580f52e95d2e0725cac6f9fdb01/antimeridian-0.3.4.tar.gz",
    "platform": null,
    "description": "# antimeridian\n\n[![CI Status](https://img.shields.io/github/actions/workflow/status/gadomski/antimeridian/ci.yaml?style=for-the-badge&label=CI)](https://github.com/gadomski/antimeridian/actions/workflows/ci.yaml)\n[![Read the Docs](https://img.shields.io/readthedocs/antimeridian?style=for-the-badge)](https://antimeridian.readthedocs.io/en/stable/)\n[![PyPI](https://img.shields.io/pypi/v/antimeridian?style=for-the-badge)](https://pypi.org/project/antimeridian/)\n\n[![GitHub](https://img.shields.io/github/license/gadomski/antimeridian?style=for-the-badge)](https://github.com/gadomski/antimeridian/blob/main/LICENSE)\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg?style=for-the-badge)](https://github.com/gadomski/antimeridian/blob/main/CODE_OF_CONDUCT)\n\n<img src=\"docs/img/complex-split.png\" style=\"width: 600px;\" alt=\"Demonstration image\" />\n\nFix shapes that cross the antimeridian.\nSee [the documentation](https://antimeridian.readthedocs.io) for information about the underlying algorithm.\nDepends on [shapely](https://shapely.readthedocs.io) and [numpy](https://numpy.org/).\n\nCan fix:\n\n- Shapely [`Polygon`](https://shapely.readthedocs.io/en/stable/reference/shapely.Polygon.html#shapely.Polygon), [`MultiPolygon`](https://shapely.readthedocs.io/en/stable/reference/shapely.MultiPolygon.html#shapely.MultiPolygon), [`LineString`](https://shapely.readthedocs.io/en/stable/reference/shapely.LineString.html#shapely.LineString), and [`MultiLineString`](https://shapely.readthedocs.io/en/stable/reference/shapely.MultiLineString.html#shapely.MultiLineString) objects\n- GeoJSON [Polygons](https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.6), [MultiPolygons](https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.7), [Features](https://datatracker.ietf.org/doc/html/rfc7946#section-3.2) and [FeatureCollections](https://datatracker.ietf.org/doc/html/rfc7946#section-3.3), as dictionaries\n- Anything that has a [`__geo_interface__`](https://gist.github.com/sgillies/2217756)\n\n## Usage\n\n```shell\npip install antimeridian\n```\n\nThen:\n\n```python\nimport antimeridian\n\nfixed = antimeridian.fix_geojson(geojson)\n```\n\nWe also have some utilities to create [bounding boxes](https://antimeridian.readthedocs.io/en/latest/api.html#antimeridian.bbox) and [centroids](https://antimeridian.readthedocs.io/en/latest/api.html#antimeridian.centroid) from antimeridian-crossing polygons and multipolygons.\nSee [the documentation](https://antimeridian.readthedocs.io/) for a complete API reference.\n\n### Command line interface\n\nUse the `cli` optional dependency to install the `antimeridian` CLI:\n\n```shell\npip install 'antimeridian[cli]'\nantimeridian fix input.json > output.json\n```\n\n## Developing\n\nClone and install in editable mode with the development optional dependencies:\n\n```shell\ngit clone https://github.com/gadomski/antimeridian\ncd antimeridian\npip install -e '.[dev,docs]'\n```\n\nWe use [pytest](https://docs.pytest.org) for tests:\n\n```shell\npytest\n```\n\nWe use [Sphinx](https://www.sphinx-doc.org) for docs:\n\n```shell\nmake -C docs html\n```\n\n## Contributing\n\nGithub [issues](https://github.com/gadomski/antimeridian/issues) and [pull requests](https://github.com/gadomski/antimeridian/pulls), please and thank you!\n\n## License\n\n[Apache-2.0](https://github.com/gadomski/antimeridian/blob/main/LICENSE)\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Fix GeoJSON geometries that cross the antimeridian",
    "version": "0.3.4",
    "project_urls": {
        "Changelog": "https://github.com/gadomski/antimeridian/blob/main/CHANGELOG.md",
        "Documentation": "https://antimeridian.readthedocs.io",
        "Github": "https://github.com/gadomski/antimeridian"
    },
    "split_keywords": [
        "geojson",
        " antimeridian",
        " shapely"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1f8f5a27e262cb5ee5ee8c521c075100aa912e55136c058d2aedb36203b6cd2c",
                "md5": "4e760872b89db6a9e0e445583524e83d",
                "sha256": "88e8eabf08c327457dd477c57f6f41c88a9ef65a8fee5267918d7552de7cb13b"
            },
            "downloads": -1,
            "filename": "antimeridian-0.3.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4e760872b89db6a9e0e445583524e83d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 14011,
            "upload_time": "2024-03-29T13:06:15",
            "upload_time_iso_8601": "2024-03-29T13:06:15.115231Z",
            "url": "https://files.pythonhosted.org/packages/1f/8f/5a27e262cb5ee5ee8c521c075100aa912e55136c058d2aedb36203b6cd2c/antimeridian-0.3.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3bfd2a288c9a4cefe32391430e6974e444d8e580f52e95d2e0725cac6f9fdb01",
                "md5": "57f2e2596985eaf035377d84b64e40c2",
                "sha256": "4d84ff711ce91a7ff005ca145b6301a4a4572eab32e439edd0b76d2c318d70e5"
            },
            "downloads": -1,
            "filename": "antimeridian-0.3.4.tar.gz",
            "has_sig": false,
            "md5_digest": "57f2e2596985eaf035377d84b64e40c2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 16490,
            "upload_time": "2024-03-29T13:06:17",
            "upload_time_iso_8601": "2024-03-29T13:06:17.655707Z",
            "url": "https://files.pythonhosted.org/packages/3b/fd/2a288c9a4cefe32391430e6974e444d8e580f52e95d2e0725cac6f9fdb01/antimeridian-0.3.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-29 13:06:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gadomski",
    "github_project": "antimeridian",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "antimeridian"
}
        
Elapsed time: 0.21898s