From 77305cda470029e0f509a67c4ecbd45f29970c5a Mon Sep 17 00:00:00 2001 From: Christian Ledermann Date: Sun, 29 Oct 2023 19:23:46 +0000 Subject: [PATCH] Improve README --- .gitignore | 1 + README.rst | 57 +++++++++++++++++++++++++++++++----------------------- 2 files changed, 34 insertions(+), 24 deletions(-) diff --git a/.gitignore b/.gitignore index cc9c4328..97717c04 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ html/ venv/ __pycache__/ *.stderr* +docs/_* diff --git a/README.rst b/README.rst index 66501347..64873415 100644 --- a/README.rst +++ b/README.rst @@ -3,9 +3,10 @@ Introduction .. inclusion-marker-do-not-remove -PyGeoIf provides a `GeoJSON-like protocol `_ for geo-spatial (GIS) vector data. +PyGeoIf provides a `GeoJSON-like protocol `_ +for geo-spatial (GIS) vector data. -Other Python programs and packages that you may have heard of already +Other Python programs and packages that you may have heard of that implement this protocol: * `ArcPy `_ @@ -13,6 +14,9 @@ implement this protocol: * `PySAL `_ * `Shapely `_ * `pyshp `_ +* `GeoPandas `_ +* `Karta `_ +* `mapnik `_ When you want to write your own geospatial library with support for this protocol you may use pygeoif as a starting point and build @@ -72,6 +76,14 @@ It was written to provide clean and python only geometries for fastkml_ :target: https://pypi.python.org/pypi/pygeoif/ :alt: Supported Python implementations +Installation +------------ + +You can install PyGeoIf from pypi using pip:: + + pip install pygeoif + + Example ======== @@ -321,9 +333,8 @@ Create a geometry from its WKT representation signed_area ------------ -Return the signed area enclosed by a ring using the linear time -algorithm at http://www.cgafaq.info/wiki/Polygon_Area. A value >= 0 -indicates a counter-clockwise oriented ring. +Return the signed area enclosed by a ring. +A value >= 0 indicates a counter-clockwise oriented ring. orient @@ -349,28 +360,13 @@ Return the ``__geo_interface__`` dictionary. Development =========== -Installation ------------- - -You can install PyGeoIf from pypi using pip:: - - pip install pygeoif - -Testing -------- - -Install the requirements with ``pip install -r test-requirements.txt`` -and run the unit and static tests with:: +Clone this repository, create a virtualenv with Python 3.8 or later with +``python3 -m venv .venv`` and activate it with ``source .venv/bin/activate``. - pytest pygeoif - pytest --doctest-glob="README.rst" - yesqa pygeoif/*.py - black pygeoif - flake8 pygeoif - mypy pygeoif +Then install the requirements with ``pip install -e ".[dev]"``. pre-commit -~~~~~~~~~~~ +---------- Install the ``pre-commit`` hook with:: @@ -381,6 +377,19 @@ and check the code with:: pre-commit run --all-files +Testing +------- + +Run the unit and static tests with:: + + pytest tests + pytest --doctest-glob="README.rst" + black pygeoif + ruff pygeoif + flake8 pygeoif + mypy pygeoif + + Acknowledgments ================