Commit 7d06fb68 authored by Tomas Pettersson's avatar Tomas Pettersson 🏸

bugfix

parent 3c8fd9d1
2017-12-14 10:00 26.9879 59.9743 0.0000 2017-12-14 10:00 26.9879 59.9743 0.0000
2017-12-14 10:15 26.9882 59.9769 0.0000 2017-12-14 10:15 26.9872 59.9767 0.0000
2017-12-14 10:30 26.9859 59.9794 0.0000 2017-12-14 10:30 26.9859 59.9794 0.0000
2017-12-14 10:45 26.9845 59.9815 0.0000 2017-12-14 10:45 26.9845 59.9815 0.0000
2017-12-14 11:00 26.9838 59.9835 0.0000 2017-12-14 11:00 26.9838 59.9835 0.0000
2017-12-14 11:15 26.9824 59.9856 0.0000 2017-12-14 11:15 26.9824 59.9856 0.0000
2017-12-14 11:30 26.9817 59.9877 0.0000 2017-12-14 11:30 26.9817 59.9877 0.0000
2017-12-14 11:45 26.9810 59.9897 0.0000 2017-12-14 11:45 26.9811 59.9897 0.0000
2017-12-14 12:00 26.9810 59.9921 0.0000 2017-12-14 12:00 26.9810 59.9921 0.0000
2017-12-14 12:15 26.9810 59.9949 0.0000 2017-12-14 12:15 26.9810 59.9949 0.0000
2017-12-14 12:30 26.9817 59.9973 0.0000 2017-12-14 12:30 26.9817 59.9973 0.0000
2017-12-14 12:45 26.9838 59.9993 0.0000 2017-12-14 12:45 26.9838 59.9993 0.0000
2017-12-14 13:00 26.9865 60.0014 0.0000 2017-12-14 13:00 26.9865 60.0014 0.0000
2017-12-14 13:15 26.9872 60.0034 0.0000 2017-12-14 13:15 26.9872 60.0035 0.0000
2017-12-14 13:30 26.9872 60.0059 0.0000 2017-12-14 13:30 26.9872 60.0058 0.0000
2017-12-14 13:45 26.9859 60.0079 0.0000 2017-12-14 13:45 26.9859 60.0079 0.0000
2017-12-14 14:00 26.9845 60.0100 0.0000 2017-12-14 14:00 26.9845 60.0100 0.0000
2017-12-14 14:15 26.9804 60.0107 0.0000 2017-12-14 14:15 26.9804 60.0107 0.0000
...@@ -39,11 +39,11 @@ ...@@ -39,11 +39,11 @@
2017-12-14 19:30 26.9275 60.0395 0.0000 2017-12-14 19:30 26.9275 60.0395 0.0000
2017-12-14 19:45 26.9316 60.0408 0.0000 2017-12-14 19:45 26.9316 60.0408 0.0000
2017-12-14 20:00 26.9357 60.0419 0.0000 2017-12-14 20:00 26.9357 60.0419 0.0000
2017-12-14 20:15 26.9398 60.0432 0.0000 2017-12-14 20:15 26.9399 60.0432 0.0000
2017-12-14 20:30 26.9447 60.0446 0.0000 2017-12-14 20:30 26.9447 60.0446 0.0000
2017-12-14 20:45 26.9488 60.0453 0.0000 2017-12-14 20:45 26.9488 60.0453 0.0000
2017-12-14 21:00 26.9536 60.0460 0.0000 2017-12-14 21:00 26.9536 60.0460 0.0000
2017-12-14 21:15 26.9577 60.0470 0.0000 2017-12-14 21:15 26.9577 60.0470 0.0000
2017-12-14 21:30 43.5057 43.5050 0.0000 2017-12-14 21:30 26.9631 60.0476 0.0000
2017-12-14 21:45 43.5078 43.5053 0.0000 2017-12-14 21:45 26.9651 60.0478 0.0000
2017-12-14 22:00 43.5102 43.5055 0.0000 2017-12-14 22:00 26.9666 60.0478 0.0000
...@@ -152,10 +152,10 @@ class Model(object): ...@@ -152,10 +152,10 @@ class Model(object):
intersection = match.intersection(queryline) intersection = match.intersection(queryline)
if (intersection is not None): if (intersection is not None):
if (intersection.geom_type is 'Point'): if (intersection.geom_type is 'Point'):
deactive.append([intersection.x,intersection.y]) deactive.append([intersection.y,intersection.x])
if (intersection.geom_type is 'MultiPoint'): if (intersection.geom_type is 'MultiPoint'):
deactive.append([intersection.coords[0][0],intersection.coords[0][1]]) deactive.append([intersection.geoms[0].y,intersection.geoms[0].x])
else: else:
active.append(nowpoints[i]) active.append(nowpoints[i])
intersectionend = time.time() intersectionend = time.time()
...@@ -294,15 +294,20 @@ class Model(object): ...@@ -294,15 +294,20 @@ class Model(object):
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):
print('active: '+str(len(mp.geoms)))
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)
print('displacedpoints: '+str(len(displacedpoints)))
activepoints, onlandpoints = self.onlandPoints(mp.geoms, displacedpoints, matches) activepoints, onlandpoints = self.onlandPoints(mp.geoms, displacedpoints, matches)
print('activepoints: '+str(len(activepoints)))
print('onlandpoints: '+str(len(onlandpoints)))
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)
print('active+deactive: '+str(len(mp.geoms)))
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)
......
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