Skip to content

Commit

Permalink
Merge 516c837 into ca7bb1f
Browse files Browse the repository at this point in the history
  • Loading branch information
fitodic authored Jan 2, 2020
2 parents ca7bb1f + 516c837 commit f417f54
Show file tree
Hide file tree
Showing 9 changed files with 309 additions and 25 deletions.
14 changes: 10 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ matrix:
env:
- TOXENV=py37-gdal2.3.3
- GDALVERSION=2.3.3
- python: 3.8
stage: test
env:
- TOXENV=py38-gdal2.3.3
- GDALVERSION=2.3.3
- python: 2.7
stage: test
env:
Expand All @@ -73,12 +78,13 @@ matrix:
env:
- TOXENV=py37-gdal2.4.0
- GDALVERSION=2.4.0
- python: 3.8
stage: test
env:
- TOXENV=py38-gdal2.4.0
- GDALVERSION=2.4.0
- python: 3.7
stage: deploy
addons: skip
before_install: skip
script: skip
after_success: skip
deploy:
provider: pypi
user: fitodic
Expand Down
20 changes: 10 additions & 10 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ Misc
- Convert the package to the `src/ layout <https://setuptools.readthedocs.io/en/latest/setuptools.html#using-a-src-layout>`_ and the tests to `pytest <https://docs.pytest.org/en/latest/>`_. The modules have been renamed, and the ``Centerline`` class has been refactored to enable overrides. (`#23 <https://github.com/fitodic/centerline/pull/23>`_)


0.5.2 - 2019-01-27
0.5.2 (2019-01-27)
------------------

Fixed
^^^^^

- Package versioning that caused a broken upload

0.5.1 - 2019-01-27
0.5.1 (2019-01-27)
------------------

Changed
Expand All @@ -50,15 +50,15 @@ Removed
- Python 3.5 support


0.5 - 2018-09-09
0.5.0 (2018-09-09)
----------------

Added
^^^^^

- ``MultiPolygon`` support

0.4.2 - 2018-08-22
0.4.2 (2018-08-22)
------------------

Added
Expand Down Expand Up @@ -87,15 +87,15 @@ Removed
- ``Centerline`` from the ``centerline`` namespace. To import the ``Centerline``
class, use ``from centerline.main import Centerline``

0.4.1 - 2018-01-07
0.4.1 (2018-01-07)
------------------

Fixed
^^^^^

- Ignore the ``osgeo`` package when building the documentation on `readthedocs.org <https://readthedocs.org/>`_.

0.4 - 2018-01-07
0.4.0 (2018-01-07)
----------------

Added
Expand All @@ -110,7 +110,7 @@ Fixed
- Add a comma to the list of development requirements


0.3 - 2017-11-26
0.3.0 (2017-11-26)
----------------

Added
Expand All @@ -137,15 +137,15 @@ Removed
- ``shp2centerline`` script


0.2.1 - 2017-06-18
0.2.1 (2017-06-18)
------------------

Fixed
^^^^^

- Read the ``README.rst`` from ``setup.py``

0.2 - 2017-06-18
0.2.0 (2017-06-18)
----------------

Added
Expand All @@ -168,7 +168,7 @@ Changed
- Fix PEP8 errors in ``setup.py``
- Convert README from MarkDown to ReStructuredText

0.1 - 2016-01-15
0.1.0 (2016-01-15)
----------------

Added
Expand Down
30 changes: 30 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,33 @@ centerline using the `Voronoi diagram
<https://en.wikipedia.org/wiki/Voronoi_diagram>`_. For more info on how
to use this package, see the
`official documentation <http://centerline.readthedocs.io/>`_.


Features
^^^^^^^^

* A command-line script for creating centerlines from a vector source file and saving them into a destination vector file: ``create_centerlines``

.. code:: bash
$ create_centerlines input.shp output.geojson
* The ``Centerline`` class that allows integration into your own workflow.


.. code:: python
>>> from shapely.geometry import Polygon
>>> from centerline.geometry import Centerline
>>> polygon = Polygon([[0, 0], [0, 4], [4, 4], [4, 0]])
>>> attributes = {"id": 1, "name": "polygon", "valid": True}
>>> centerline = Centerline(polygon, **attributes)
>>> centerline.id == 1
True
>>> centerline.name
'polygon'
>>> centerline.geoms
<shapely.geometry.base.GeometrySequence object at 0x7f7d24116210>
1 change: 1 addition & 0 deletions changelog.d/25.misc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Run the test suite against Python 3.8.
31 changes: 31 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,37 @@ This library tries to solve this problem by creating the the polygon's centerlin

The source and the output geometry visualized in `QGIS <https://www.qgis.org/en/site/>`_.


Features
^^^^^^^^

* A command-line script for creating centerlines from a vector source file and saving them into a destination vector file: ``create_centerlines``

.. code:: bash
$ create_centerlines input.shp output.geojson
* The ``Centerline`` class that allows integration into your own workflow.


.. code:: python
>>> from shapely.geometry import Polygon
>>> from centerline.geometry import Centerline
>>> polygon = Polygon([[0, 0], [0, 4], [4, 4], [4, 0]])
>>> attributes = {"id": 1, "name": "polygon", "valid": True}
>>> centerline = Centerline(polygon, **attributes)
>>> centerline.id == 1
True
>>> centerline.name
'polygon'
>>> centerline.geoms
<shapely.geometry.base.GeometrySequence object at 0x7f7d24116210>
.. toctree::
:maxdepth: 2
:caption: Contents:
Expand Down
10 changes: 7 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,19 @@ author = Filip Todic
author_email = todic.filip@gmail.com
platforms = POSIX, Microsoft, MacOS
classifiers =
Development Status :: 4 - Beta
Development Status :: 5 - Production/Stable
License :: OSI Approved :: MIT License
Operating System :: OS Independent
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Intended Audience :: Science/Research
Intended Audience :: Developers
Topic :: Scientific/Engineering :: GIS
Topic :: Software Development :: Libraries :: Python Modules
Topic :: Scientific/Engineering :: Mathematics
Topic :: Scientific/Engineering :: Visualization

[options]
zip_safe = False
Expand All @@ -41,7 +43,9 @@ install_requires =
where=src

[options.extras_require]
dev = ipdb
dev =
ipdb
tox
gdal =
GDAL>=2.3.3
lint =
Expand Down
3 changes: 1 addition & 2 deletions src/centerline/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,4 @@ def get_ogr_driver(filepath):
if extension == driver_extension or extension in driver_extensions:
return driver

else:
raise UnsupportedVectorType
raise UnsupportedVectorType
Loading

0 comments on commit f417f54

Please sign in to comment.