Commit 558bcf75 authored by Tomas Pettersson's avatar Tomas Pettersson 🏸

temporary removed onland and tree

parent d04cf52a
...@@ -285,21 +285,22 @@ class Model(object): ...@@ -285,21 +285,22 @@ 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') # 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)
activepoints, onlandpoints = self.onlandPoints(mp.geoms, displacedpoints, matches) # activepoints, onlandpoints = self.onlandPoints(mp.geoms, displacedpoints, matches)
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)
mp = geometry.MultiPoint(displacedpoints)
level = [0] * len(mp.geoms) level = [0] * len(mp.geoms)
category = [2] * len(mp.geoms) category = [2] * len(mp.geoms)
properties = self.createProperties((i+2), timearray[i], mp.centroid, level, category) properties = self.createProperties((i+2), timearray[i], mp.centroid, level, category)
...@@ -307,7 +308,7 @@ class Model(object): ...@@ -307,7 +308,7 @@ class Model(object):
if (i % 10 == 0): if (i % 10 == 0):
Cloudtrack.write(featurecollection) Cloudtrack.write(featurecollection)
Particletrack.write(featurecollection) Particletrack.write(featurecollection)
mp = geometry.MultiPoint(activepoints) # mp = geometry.MultiPoint(activepoints)
print('deactivepoints: '+str(len(deactivepoints))) print('deactivepoints: '+str(len(deactivepoints)))
......
Markdown is supported
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