Skip to content

Commit

Permalink
[vector.boundary] fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
johntruckenbrodt committed Mar 2, 2022
1 parent 7af9b42 commit ef62cc8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions spatialist/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,11 +804,13 @@ def boundary(vectorobject, expression=None, outname=None):
major = feat_major.GetGeometryRef()

boundary = major.Boundary()

longest = None
for line in boundary:
if (longest is None) or (line.Length() > longest.Length()):
longest = line
if boundary.GetGeometryName() == 'LINESTRING':
longest = boundary
else: # MULTILINESTRING
longest = None
for line in boundary:
if (longest is None) or (line.Length() > longest.Length()):
longest = line

points = longest.GetPoints()
ring = ogr.Geometry(ogr.wkbLinearRing)
Expand Down

0 comments on commit ef62cc8

Please sign in to comment.