Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
cleder committed Apr 27, 2024
1 parent a802b6c commit 264f799
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,16 @@ x, y, z : float
Example
~~~~~~~~

>>> from pygeoif import Point
>>> p = Point(1.0, -1.0)
>>> print(p)
POINT (1.0 -1.0)
>>> p.y
-1.0
>>> p.x
1.0
.. code-block:: pycon
>>> from pygeoif import Point
>>> p = Point(1.0, -1.0)
>>> print(p)
POINT (1.0 -1.0)
>>> p.y
-1.0
>>> p.x
1.0
Expand Down Expand Up @@ -270,6 +272,8 @@ So it's very rarely used in the real GIS professional world.
Example
~~~~~~~~

.. code-block:: pycon
>>> from pygeoif import geometry
>>> p = geometry.Point(1.0, -1.0)
>>> p2 = geometry.Point(1.0, -1.0)
Expand All @@ -291,6 +295,8 @@ properties : dict

Example
~~~~~~~~
.. code-block:: pycon
>>> from pygeoif import Point, Feature
>>> p = Point(1.0, -1.0)
>>> props = {'Name': 'Sample Point', 'Other': 'Other Data'}
Expand All @@ -311,6 +317,7 @@ features: sequence

Example
~~~~~~~~
.. code-block:: pycon
>>> from pygeoif import Point, Feature, FeatureCollection
>>> p = Point(1.0, -1.0)
Expand All @@ -332,6 +339,7 @@ shape

Create a pygeoif feature from an object that provides the ``__geo_interface__``
or any GeoJSON_ compatible dictionary.
.. code-block:: pycon
>>> from shapely.geometry import Point
>>> from pygeoif import geometry, shape
Expand All @@ -343,6 +351,7 @@ from_wkt
---------

Create a geometry from its WKT representation
.. code-block:: pycon
>>> from pygeoif import from_wkt
>>> p = from_wkt('POINT (0 1)')
Expand Down Expand Up @@ -389,18 +398,21 @@ pre-commit
----------

Install the ``pre-commit`` hook with::
.. code-block:: console
pip install pre-commit
pre-commit install
and check the code with::
.. code-block:: console
pre-commit run --all-files
Testing
-------

Run the unit and static tests with::
.. code-block:: console
pytest tests
pytest --doctest-glob="README.rst"
Expand Down

0 comments on commit 264f799

Please sign in to comment.