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
2b0d555f
Commit
2b0d555f
authored
Dec 14, 2017
by
Tomas Pettersson
🏸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1000 section length on tree
parent
8aadeb67
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
exercisemodel/__init__.py
exercisemodel/__init__.py
+1
-1
exercisemodel/model.py
exercisemodel/model.py
+5
-4
exercisemodel/resources/strtree.pickle
exercisemodel/resources/strtree.pickle
+0
-0
No files found.
exercisemodel/__init__.py
View file @
2b0d555f
...
@@ -23,7 +23,7 @@ def storetree():
...
@@ -23,7 +23,7 @@ def storetree():
sections
=
[]
sections
=
[]
for
line
in
lines
:
for
line
in
lines
:
if
len
(
section
)
==
10
:
if
len
(
section
)
==
10
00
:
sections
.
append
(
LineString
(
section
))
sections
.
append
(
LineString
(
section
))
section
=
[]
section
=
[]
if
'-999999'
in
line
:
if
'-999999'
in
line
:
...
...
exercisemodel/model.py
View file @
2b0d555f
...
@@ -285,10 +285,11 @@ class Model(object):
...
@@ -285,10 +285,11 @@ class Model(object):
deactivepoints
=
[]
deactivepoints
=
[]
linestring
=
geometry
.
shape
(
exercisefeature
[
'geometry'
])
linestring
=
geometry
.
shape
(
exercisefeature
[
'geometry'
])
latlngpoints
=
[[
latlng
[
1
],
latlng
[
0
]]
for
latlng
in
linestring
.
coords
]
latlngpoints
=
[[
latlng
[
1
],
latlng
[
0
]]
for
latlng
in
linestring
.
coords
]
print
(
'before matches'
)
matches
=
strtree
.
query
(
LineString
(
latlngpoints
))
matches
=
strtree
.
query
(
LineString
(
latlngpoints
))
#
print('matches: '+str(matches))
print
(
'matches: '
+
str
(
matches
))
for
i
,
coord
in
enumerate
(
linestring
.
coords
):
for
i
,
coord
in
enumerate
(
linestring
.
coords
):
#
start = time.time()
start
=
time
.
time
()
if
(
len
(
mp
.
geoms
)
>
0
):
if
(
len
(
mp
.
geoms
)
>
0
):
points
=
self
.
centerPoints
(
coord
,
mp
.
centroid
,
mp
.
geoms
)
points
=
self
.
centerPoints
(
coord
,
mp
.
centroid
,
mp
.
geoms
)
displacedpoints
=
self
.
displacePoints
(
pDist
,
points
)
displacedpoints
=
self
.
displacePoints
(
pDist
,
points
)
...
@@ -296,8 +297,8 @@ class Model(object):
...
@@ -296,8 +297,8 @@ class Model(object):
deactivepoints
+=
onlandpoints
deactivepoints
+=
onlandpoints
# print('active: '+str(len(activepoints)))
# print('active: '+str(len(activepoints)))
# print('onland: '+str(len(onlandpoints)))
# print('onland: '+str(len(onlandpoints)))
#
end = time.time()
end
=
time
.
time
()
#
print('onland: '+str(end-start))
print
(
'onland: '
+
str
(
end
-
start
))
mp
=
geometry
.
MultiPoint
(
activepoints
+
deactivepoints
)
mp
=
geometry
.
MultiPoint
(
activepoints
+
deactivepoints
)
level
=
[
0
]
*
len
(
mp
.
geoms
)
level
=
[
0
]
*
len
(
mp
.
geoms
)
category
=
[
2
]
*
len
(
mp
.
geoms
)
category
=
[
2
]
*
len
(
mp
.
geoms
)
...
...
exercisemodel/resources/strtree.pickle
View file @
2b0d555f
No preview for this file type
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