Commit 44fd5163 authored by Benjamin Herfort's avatar Benjamin Herfort
Browse files

fixed 3D polygons issue #1 #2

parent 2db693b3
......@@ -184,6 +184,7 @@ def saveGeomAsShapefile(geometry, shapeName):
# save each polygon as feature in layer
for p in range(0, geometry.GetGeometryCount()):
da = geometry.GetGeometryRef(p)
da.FlattenTo2D()
if da.GetGeometryName()!='POLYGON':
print 'other geometry type: %s' % da.GetGeometryName()
print da
......@@ -857,8 +858,8 @@ def main(arg1):
#Compare this project file to the old one
#check if theres an old project file
if os.path.isfile('/home/m/mreinmuth/data/projects.json'):
with open('/home/m/mreinmuth/data/projects.json', 'r') as data_file:
if os.path.isfile('projects.json'):
with open('projects.json', 'r') as data_file:
old_data = json.load(data_file)
#loop through all projects
for key in fulldata:
......@@ -899,14 +900,14 @@ def main(arg1):
list_flag = 1
#wirte new infos to file
data_file.close()
os.remove('/home/m/mreinmuth/data/projects.json')
with open('/home/m/mreinmuth/data/projects.json','w') as data_file:
os.remove('projects.json')
with open('projects.json','w') as data_file:
data_file.write(URLdata)
data_file.close()
else:
#no file with old data: download and process all
print time.strftime('[%x-%X]:: ') +'No old projects.json available \n creating new projects.json and download all available data'
with open ('/home/m/mreinmuth/data/projects.json', 'w') as initial_file:
with open ('projects.json', 'w') as initial_file:
initial_file.write(URLdata)
#set list flag
list_flag = 0
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment