Skip to content

Commit

Permalink
Spgc will now recognice both the old polygon format from QGIS (lines …
Browse files Browse the repository at this point in the history
…starting with "POLYGON((") and the new format ("Polygon ((")
  • Loading branch information
mtop committed Nov 25, 2015
1 parent 5a95f7b commit da57a21
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions geocoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,14 @@ def getPolygons(self):
sys.exit("[ Error ] No such file \'%s\'" % self.polygonFile)

for line in lines:
if line[:7] == "POLYGON":
if line[:7].lower() == "polygon":
low = None
high = None
# Identify the name of the polygon
splitline = line.split('\t')
name = splitline[1].rstrip()
splitline[0] = splitline[0].replace(", ", ",")
polygon = splitline[0].lstrip("POLYGON((").rstrip("))").split(",")
polygon = splitline[0].split("((", 1)[-1].rstrip("))").split(",")
# Check if polygon has elevation restrictions
try:
if splitline[2]:
Expand Down

0 comments on commit da57a21

Please sign in to comment.