Ticket #567 (closed defect: fixed)
Shapely cannot compare a geometry with None
| Reported by: | elemoine | Owned by: | elemoine |
|---|---|---|---|
| Priority: | blocker | Milestone: | framework.server 1.2.2 Release |
| Component: | framework.server | Version: | SVN |
| Keywords: | Cc: | ||
| State: | Commit |
Description
In our Geometry TypeEngine we have this compare_values method for comparing geometries:
def compare_values(self, x, y):
return x.equals(y)
(x and y are Shapely geometries)
But Shapely gives an error when comparing a geometry with None (geometry.equals(None)). So I suggest that we guard against that and change our code to:
def compare_values(self, x, y):
t = (x, y)
if None not in t:
return x.equals(y)
return t == (None, None)
Attachments
Change History
Note: See
TracTickets for help on using
tickets.
