Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/jacquestardie/seattle in…
Browse files Browse the repository at this point in the history
…to develop

* 'develop' of https://github.com/jacquestardie/seattle:
  Fix neighborhood update over water issue.
  • Loading branch information
jqtrde committed Feb 27, 2015
2 parents dd4fba7 + 48650cb commit c50191f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions seattle/seattle/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ class Neighborhoods_Model(Base):
@classmethod
def neighborhood(cls, lat, lon):
"""Output neighborhood that contains lat lon."""
return (DBSession.query(cls)
.filter(func.ST_Within(func.ST_SetSRID(func
.ST_MakePoint(lon, lat), 4236), func
.ST_SetSRID(cls.geom, 4236))).one().name
)
try:
return (DBSession.query(cls)
.filter(func.ST_Within(func.ST_SetSRID(func
.ST_MakePoint(lon, lat), 4236), func
.ST_SetSRID(cls.geom, 4236))).one().name
)
except:
return u'----'


class Incidents_Model(Base):
Expand Down

0 comments on commit c50191f

Please sign in to comment.