Commit 328efdf7 authored by Christian Ledermann's avatar Christian Ledermann

make shapely an option, rely on pygeoif for the geometries instead

parent c1120cd4
......@@ -24,7 +24,12 @@ I wonder if the "geojson" package fits
the purpose or it's rather better to implement to protocol from scratch.
"""
from shapely.geometry import Point, LineString, Polygon
from shapely.geometry import MultiPoint, MultiLineString, MultiPolygon
from shapely.geometry.polygon import LinearRing
try:
from shapely.geometry import Point, LineString, Polygon
from shapely.geometry import MultiPoint, MultiLineString, MultiPolygon
from shapely.geometry.polygon import LinearRing
except ImportError:
from pygeoif.geometry import Point, LineString, Polygon
from pygeoif.geometry import MultiPoint, MultiLineString, MultiPolygon
from pygeoif.geometry import LinearRing
......@@ -23,9 +23,9 @@ from fastkml import atom
from fastkml import config
import datetime
import xml.etree.ElementTree as etree
from shapely.geometry import Point, LineString, Polygon
from shapely.geometry import MultiPoint, MultiLineString, MultiPolygon
from shapely.geometry.polygon import LinearRing
from fastkml.geometry import Point, LineString, Polygon
from fastkml.geometry import MultiPoint, MultiLineString, MultiPolygon
from fastkml.geometry import LinearRing
class BaseClassesTestCase(unittest.TestCase):
""" BaseClasses must raise a NotImplementedError on etree_element
......@@ -427,6 +427,9 @@ class KmlFromStringTestCase( unittest.TestCase ):
k2.from_string(k.to_string())
self.assertEqual(k.to_string(), k2.to_string())
def test_atom(self):
pass
class StyleTestCase( unittest.TestCase ):
def test_styleurl(self):
......@@ -438,6 +441,9 @@ class StyleTestCase( unittest.TestCase ):
f.styleUrl = s
self.assertTrue(isinstance(f._styleUrl, styles.StyleUrl))
self.assertEqual(f.styleUrl, '#otherstyle')
f2 = kml.Document()
f2.from_string(f.to_string())
self.assertEqual(f.to_string(), f2.to_string())
......
......@@ -27,7 +27,7 @@ setup(name='fastkml',
zip_safe=False,
install_requires=[
# -*- Extra requirements: -*-
'shapely',
'pygeoif',
'python-dateutil',
],
entry_points="""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment