Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fastkml
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Aurélien Vermylen
fastkml
Commits
9e59054a
Commit
9e59054a
authored
Aug 09, 2017
by
Aurelien Vermylen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug that MultiGeometry cannot contain another MultiGeometry.
parent
2206a1bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
21 deletions
+18
-21
fastkml/geometry.py
fastkml/geometry.py
+18
-21
No files found.
fastkml/geometry.py
View file @
9e59054a
...
...
@@ -19,27 +19,19 @@
Import the geometries from shapely if it is installed or otherwise from Pygeoif
"""
try
:
from
shapely.geometry
import
Point
,
LineString
,
Polygon
from
shapely.geometry
import
MultiPoint
,
MultiLineString
,
MultiPolygon
from
shapely.geometry.polygon
import
LinearRing
# from shapely.geometry import GeometryCollection
# Sean Gillies:
# I deliberately omitted a geometry collection constructor because
# there was almost no support in GEOS for operations on them. You
# couldn't buffer a collection, for example, or find its difference
# to another geometry. I've seen some signs of this changing in GEOS,
# but until it does I don't think there's any point to the class.
# It wouldn't be much more than a list of geometries.
from
pygeoif.geometry
import
GeometryCollection
from
shapely.geometry
import
asShape
except
ImportError
:
from
pygeoif.geometry
import
Point
,
LineString
,
Polygon
from
pygeoif.geometry
import
MultiPoint
,
MultiLineString
,
MultiPolygon
from
pygeoif.geometry
import
LinearRing
from
pygeoif.geometry
import
GeometryCollection
from
pygeoif.geometry
import
as_shape
as
asShape
from
shapely.geometry
import
Point
,
LineString
,
Polygon
from
shapely.geometry
import
MultiPoint
,
MultiLineString
,
MultiPolygon
from
shapely.geometry.polygon
import
LinearRing
# from shapely.geometry import GeometryCollection
# Sean Gillies:
# I deliberately omitted a geometry collection constructor because
# there was almost no support in GEOS for operations on them. You
# couldn't buffer a collection, for example, or find its difference
# to another geometry. I've seen some signs of this changing in GEOS,
# but until it does I don't think there's any point to the class.
# It wouldn't be much more than a list of geometries.
from
pygeoif.geometry
import
GeometryCollection
from
shapely.geometry
import
asShape
import
re
import
fastkml.config
as
config
...
...
@@ -393,6 +385,11 @@ class Geometry(_BaseObject):
for
lr
in
linearings
:
self
.
_get_geometry_spec
(
lr
)
geoms
.
append
(
LinearRing
(
self
.
_get_coordinates
(
lr
)))
multigeometries
=
element
.
findall
(
'%sMultiGeometry'
%
self
.
ns
)
if
multigeometries
:
for
mg
in
multigeometries
:
geoms
.
append
(
self
.
_get_multigeometry
(
mg
))
if
len
(
geoms
)
>
0
:
geom_types
=
[]
for
geom
in
geoms
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment