Commit 491bd7d8 authored by Tomas Pettersson's avatar Tomas Pettersson 🏸

testing

parent ce5b8390
...@@ -5,19 +5,19 @@ ...@@ -5,19 +5,19 @@
2017-12-14 14:00 18.3273 58.7730 0.0000 2017-12-14 14:00 18.3273 58.7730 0.0000
2017-12-14 14:15 18.3063 58.7805 0.0000 2017-12-14 14:15 18.3063 58.7805 0.0000
2017-12-14 14:30 18.2833 58.7880 0.0000 2017-12-14 14:30 18.2833 58.7880 0.0000
2017-12-14 14:45 18.2648 58.7936 0.0000 2017-12-14 14:45 18.2648 58.7937 0.0000
2017-12-14 15:00 18.2476 58.7993 0.0000 2017-12-14 15:00 18.2476 58.7994 0.0000
2017-12-14 15:15 18.2335 58.8036 0.0000 2017-12-14 15:15 18.2335 58.8036 0.0000
2017-12-14 15:30 18.2256 58.8065 0.0000 2017-12-14 15:30 18.2256 58.8064 0.0000
2017-12-14 15:45 18.2184 58.8093 0.0000 2017-12-14 15:45 18.2184 58.8093 0.0000
2017-12-14 16:00 18.2157 58.8107 0.0000 2017-12-14 16:00 18.2157 58.8107 0.0000
2017-12-14 16:15 18.2136 58.8118 0.0000 2017-12-14 16:15 18.2136 58.8118 0.0000
2017-12-14 16:30 18.2105 58.8132 0.0000 2017-12-14 16:30 18.2105 58.8132 0.0000
2017-12-14 16:45 18.2091 58.8141 0.0000 2017-12-14 16:45 18.2092 58.8141 0.0000
2017-12-14 17:00 18.2071 58.8152 0.0000 2017-12-14 17:00 18.2071 58.8152 0.0000
2017-12-14 17:15 18.2054 58.8161 0.0000 2017-12-14 17:15 18.2054 58.8161 0.0000
2017-12-14 17:30 18.2068 58.8169 0.0000 2017-12-14 17:30 18.2067 58.8169 0.0000
2017-12-14 17:45 18.2092 58.8177 0.0000 2017-12-14 17:45 18.2091 58.8177 0.0000
2017-12-14 18:00 18.2102 58.8187 0.0000 2017-12-14 18:00 18.2102 58.8187 0.0000
2017-12-14 18:15 18.2102 58.8209 0.0000 2017-12-14 18:15 18.2102 58.8209 0.0000
2017-12-14 18:30 18.2102 58.8225 0.0000 2017-12-14 18:30 18.2102 58.8225 0.0000
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
2017-12-14 19:45 18.2112 58.8290 0.0000 2017-12-14 19:45 18.2112 58.8290 0.0000
2017-12-14 20:00 18.2109 58.8303 0.0000 2017-12-14 20:00 18.2109 58.8303 0.0000
2017-12-14 20:15 18.2105 58.8313 0.0000 2017-12-14 20:15 18.2105 58.8313 0.0000
2017-12-14 20:30 18.2092 58.8328 0.0000 2017-12-14 20:30 18.2091 58.8328 0.0000
2017-12-14 20:45 18.2081 58.8340 0.0000 2017-12-14 20:45 18.2081 58.8340 0.0000
2017-12-14 21:00 18.2061 58.8351 0.0000 2017-12-14 21:00 18.2061 58.8351 0.0000
2017-12-14 21:15 18.2043 58.8361 0.0000 2017-12-14 21:15 18.2043 58.8361 0.0000
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
2017-12-15 03:45 18.1532 58.8544 0.0000 2017-12-15 03:45 18.1532 58.8544 0.0000
2017-12-15 04:00 18.1518 58.8557 0.0000 2017-12-15 04:00 18.1518 58.8557 0.0000
2017-12-15 04:15 18.1501 58.8566 0.0000 2017-12-15 04:15 18.1501 58.8566 0.0000
2017-12-15 04:30 18.1487 58.8575 0.0000 2017-12-15 04:30 18.1487 58.8574 0.0000
2017-12-15 04:45 18.1470 58.8583 0.0000 2017-12-15 04:45 18.1470 58.8583 0.0000
2017-12-15 05:00 18.1456 58.8592 0.0000 2017-12-15 05:00 18.1456 58.8592 0.0000
2017-12-15 05:15 18.1443 58.8601 0.0000 2017-12-15 05:15 18.1443 58.8601 0.0000
...@@ -74,23 +74,23 @@ ...@@ -74,23 +74,23 @@
2017-12-15 07:15 18.1375 58.8638 0.0000 2017-12-15 07:15 18.1375 58.8638 0.0000
2017-12-15 07:30 18.1373 58.8641 0.0000 2017-12-15 07:30 18.1373 58.8641 0.0000
2017-12-15 07:45 18.1370 58.8643 0.0000 2017-12-15 07:45 18.1370 58.8643 0.0000
2017-12-15 08:00 18.1366 58.8645 0.0000 2017-12-15 08:00 18.1366 58.8646 0.0000
2017-12-15 08:15 18.1363 58.8648 0.0000 2017-12-15 08:15 18.1363 58.8648 0.0000
2017-12-15 08:30 18.1358 58.8649 0.0000 2017-12-15 08:30 18.1358 58.8649 0.0000
2017-12-15 08:45 18.1353 58.8650 0.0000 2017-12-15 08:45 18.1353 58.8650 0.0000
2017-12-15 09:00 18.1348 58.8652 0.0000 2017-12-15 09:00 18.1348 58.8652 0.0000
2017-12-15 09:15 18.1345 58.8655 0.0000 2017-12-15 09:15 18.1345 58.8654 0.0000
2017-12-15 09:30 18.1343 58.8656 0.0000 2017-12-15 09:30 18.1343 58.8656 0.0000
2017-12-15 09:45 18.1341 58.8658 0.0000 2017-12-15 09:45 18.1340 58.8657 0.0000
2017-12-15 10:00 18.1338 58.8659 0.0000 2017-12-15 10:00 18.1338 58.8659 0.0000
2017-12-15 10:15 18.1335 58.8660 0.0000 2017-12-15 10:15 18.1335 58.8660 0.0000
2017-12-15 10:30 18.1333 58.8662 0.0000 2017-12-15 10:30 18.1333 58.8662 0.0000
2017-12-15 10:45 18.1332 58.8663 0.0000 2017-12-15 10:45 18.1331 58.8663 0.0000
2017-12-15 11:00 18.1330 58.8664 0.0000 2017-12-15 11:00 18.1330 58.8664 0.0000
2017-12-15 11:15 18.1328 58.8665 0.0000 2017-12-15 11:15 18.1328 58.8665 0.0000
2017-12-15 11:30 18.1327 58.8666 0.0000 2017-12-15 11:30 18.1327 58.8666 0.0000
2017-12-15 11:45 18.1327 58.8666 0.0000 2017-12-15 11:45 18.1326 58.8666 0.0000
2017-12-15 12:00 18.1326 58.8667 0.0000 2017-12-15 12:00 18.1326 58.8666 0.0000
2017-12-15 12:15 18.1326 58.8667 0.0000 2017-12-15 12:15 18.1326 58.8667 0.0000
2017-12-15 12:30 18.1326 58.8667 0.0000 2017-12-15 12:30 18.1326 58.8667 0.0000
2017-12-15 12:45 18.1326 58.8667 0.0000 2017-12-15 12:45 18.1326 58.8667 0.0000
......
...@@ -283,18 +283,21 @@ class Model(object): ...@@ -283,18 +283,21 @@ class Model(object):
timearray = exercisefeature['properties']['time'] timearray = exercisefeature['properties']['time']
properties = self.createProperties(1, starttime, multipoint.centroid, [0] * len(multipoint.geoms), [2] * len(multipoint.geoms)) properties = self.createProperties(1, starttime, multipoint.centroid, [0] * len(multipoint.geoms), [2] * len(multipoint.geoms))
features.append(self.createFeature(multipoint, properties)) features.append(self.createFeature(multipoint, properties))
mp = multipoint
activepoints = [] activepoints = []
deactivepoints = [] deactivepoints = []
for point in multipoint.geoms:
activepoints.append([point.x, point.y])
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(activepoints) > 0):
# print('active: '+str(len(mp.geoms))) # print('active: '+str(len(mp.geoms)))
mp = geometry.MultiPoint(activepoints)
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))) # print('displacedpoints: '+str(len(displacedpoints)))
...@@ -304,7 +307,7 @@ class Model(object): ...@@ -304,7 +307,7 @@ 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)
# print('active+deactive: '+str(len(mp.geoms))) # print('active+deactive: '+str(len(mp.geoms)))
...@@ -315,7 +318,6 @@ class Model(object): ...@@ -315,7 +318,6 @@ 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)
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