Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
giscience
mapswipe
MapSwipeTools
Commits
44fd5163
Commit
44fd5163
authored
Jun 21, 2017
by
Benjamin Herfort
Browse files
fixed 3D polygons issue
#1
#2
parent
2db693b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
ms_getall.py
View file @
44fd5163
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment