Skip to content

Commit

Permalink
Optimise LineString Envelope method
Browse files Browse the repository at this point in the history
  • Loading branch information
peterstace committed Oct 4, 2023
1 parent 125f4a7 commit 80be3df
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions geom/type_line_string.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,7 @@ func (s LineString) IsEmpty() bool {

// Envelope returns the Envelope that most tightly surrounds the geometry.
func (s LineString) Envelope() Envelope {
var env Envelope
n := s.seq.Length()
for i := 0; i < n; i++ {
env = env.uncheckedExtend(s.seq.GetXY(i))
}
return env
return s.seq.Envelope()
}

// Boundary returns the spatial boundary of this LineString. For closed
Expand Down

0 comments on commit 80be3df

Please sign in to comment.