Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
exercisemodel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
stw
wt
exercisemodel
Commits
acf24cb7
Commit
acf24cb7
authored
Dec 14, 2017
by
Tomas Pettersson
🏸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed printouts
parent
51cf239c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
14 deletions
+1
-14
exercisemodel/__init__.py
exercisemodel/__init__.py
+1
-2
exercisemodel/model.py
exercisemodel/model.py
+0
-12
No files found.
exercisemodel/__init__.py
View file @
acf24cb7
...
...
@@ -106,7 +106,6 @@ def writeStatus(status):
def
run
():
try
:
writeStatus
(
"INITIAL"
)
# strtree = STRtree(pickle.load(pkg_resources.resource_stream(__name__, '/'.join(('resources', 'strtree.pickle')))))
jsondata
=
json
.
load
(
pkg_resources
.
resource_stream
(
__name__
,
'/'
.
join
((
'resources'
,
'strtree.json'
))));
sections
=
[]
for
section
in
jsondata
:
...
...
@@ -148,6 +147,6 @@ def run():
To run in terminal call with python __init__.py
'''
if
__name__
==
"__main__"
:
#
storetree()
storetree
()
loadtree
()
\ No newline at end of file
exercisemodel/model.py
View file @
acf24cb7
...
...
@@ -290,27 +290,15 @@ class Model(object):
activepoints
.
append
([
point
.
x
,
point
.
y
])
linestring
=
geometry
.
shape
(
exercisefeature
[
'geometry'
])
latlngpoints
=
[[
latlng
[
1
],
latlng
[
0
]]
for
latlng
in
linestring
.
coords
]
# print('before matches')
matches
=
strtree
.
query
(
LineString
(
latlngpoints
))
# print('matches: '+str(matches))
for
i
,
coord
in
enumerate
(
linestring
.
coords
):
# start = time.time()
if
(
len
(
activepoints
)
>
0
):
# print('active: '+str(len(mp.geoms)))
mp
=
geometry
.
MultiPoint
(
activepoints
)
points
=
self
.
centerPoints
(
coord
,
mp
.
centroid
,
mp
.
geoms
)
displacedpoints
=
self
.
displacePoints
(
pDist
,
points
)
# print('displacedpoints: '+str(len(displacedpoints)))
activepoints
,
onlandpoints
=
self
.
onlandPoints
(
mp
.
geoms
,
displacedpoints
,
matches
)
# print('activepoints: '+str(len(activepoints)))
# print('onlandpoints: '+str(len(onlandpoints)))
deactivepoints
+=
onlandpoints
# print('active: '+str(len(activepoints)))
# print('onland: '+str(len(onlandpoints)))
# end = time.time()
# print('onland: '+str(end-start))
mp
=
geometry
.
MultiPoint
(
activepoints
+
deactivepoints
)
# print('active+deactive: '+str(len(mp.geoms)))
level
=
[
0
]
*
len
(
mp
.
geoms
)
category
=
[
2
]
*
len
(
mp
.
geoms
)
properties
=
self
.
createProperties
((
i
+
2
),
timearray
[
i
],
mp
.
centroid
,
level
,
category
)
...
...
Write
Preview
Markdown
is supported
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