Commit dc97b24b authored by Tomas Pettersson's avatar Tomas Pettersson 🏸

testing on linestring

parent e6ba8756
2017-12-06 15:00 18.3291 58.5122 0.0000
2017-12-06 15:15 18.3252 58.4966 0.0000
2017-12-06 15:30 18.3252 58.4765 0.0000
2017-12-06 15:45 18.3252 58.4563 0.0000
2017-12-06 16:00 18.3197 58.4391 0.0000
......@@ -80,7 +80,7 @@ def run():
if ('auxiliary' in inputfeature['properties'] and inputfeature['properties']['auxiliary'] == 'exercise'):
exercisefeature = inputfeature
outputfeaturecollection = m.createOutput(multipointoutlet,exercisefeature, strtree)
outputfeaturecollection = m.createOutput(outletproperties['simulation']['startDate'],multipointoutlet,exercisefeature, strtree)
outputfeaturecollection['properties'] = {}
outputfeaturecollection['properties']['uuid'] = os.getcwd().split(os.sep)[-1]
outputfeaturecollection['properties']['status'] = 'COMPLETE'
......
......@@ -199,12 +199,12 @@ class Model(object):
return properties
def createOutput(self, multipoint, exercisefeature, strtree):
def createOutput(self, starttime, multipoint, exercisefeature, strtree):
featurecollection = self.createFeatureCollection()
features = featurecollection['features']
time = exercisefeature['properties']['time']
properties = self.createProperties(1, time[0], 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))
mp = multipoint
linestring = geometry.shape(exercisefeature['geometry'])
......@@ -215,7 +215,7 @@ class Model(object):
mp = geometry.MultiPoint(displacedpoints)
level = [0] * len(mp.geoms)
category = [2] * len(mp.geoms)
properties = self.createProperties((i+2), time[i+1], mp.centroid, level, category)
properties = self.createProperties((i+2), time[i], mp.centroid, level, category)
features.append(self.createFeature(mp, properties))
# features.append(self.createFeature(linestring))
return featurecollection
......@@ -3,31 +3,23 @@
"features": [{
"type": "Feature",
"properties": {
"primary": "PADM",
"domain": "HELCOM",
"model": "NEMO",
"type": "oil",
"subtype": "instant",
"meanLng": 23.70025634765625,
"meanLat": 58.182280238536066,
"simulation": {
"startDate": 1508720400000,
"stopDate": 1508763600000,
"mode": "Normal",
"forecast": "NEMO",
"forwardCalculation": true,
"amount": "20",
"amountUnit": "m3",
"startDate": 1512572400000,
"stopDate": 1512576000000,
"oilclass": "Oil classes",
"substance": "Medium oils (100-1000 cSt)",
"fresh": true,
"instantaneous": true,
"amount": "10",
"amountUnit": "m3",
"uncertainty": false,
"winddrag": "0",
"depth": "0",
"duration": "",
"durationUnit": ""
"mode": "Normal"
},
"primary": "PADM",
"type": "oil",
"subtype": "instant",
"meanLat": 56.24013088499595,
"meanLng": 18.5064697265625,
"observation": [{
"id": null,
"provider": "USER",
......@@ -35,161 +27,42 @@
"providerImgRef": null,
"providerType": null,
"type": "MANUAL",
"date": 1509958800000
}]
"date": 1512572400000
}],
"domain": "HELCOM",
"model": "NEMO"
},
"geometry": {
"type": "Polygon",
"type": "LineString",
"coordinates": [
[
[23.745574951171875, 58.16273472702818],
[23.73458862304688, 58.162010297029816],
[23.722229003906254, 58.16056139277947],
[23.711242675781254, 58.15838792576698],
[23.700256347656254, 58.1576634072589],
[23.689270019531254, 58.1576634072589],
[23.67416381835938, 58.15838792576698],
[23.664550781250004, 58.15983691852708],
[23.65631103515625, 58.163459142275535],
[23.64669799804688, 58.16852963599527],
[23.63983154296875, 58.17359940698948],
[23.63433837890625, 58.17794434980202],
[23.62884521484375, 58.181564729932205],
[23.62884521484375, 58.187356571348914],
[23.62884521484375, 58.193147469104915],
[23.62884521484375, 58.19821373061911],
[23.62884521484375, 58.2032792697789],
[23.63433837890625, 58.20689706981324],
[23.64532470703125, 58.20689706981324],
[23.66043090820313, 58.20689706981324],
[23.671417236328125, 58.20689706981324],
[23.681030273437504, 58.20689706981324],
[23.69064331054688, 58.20689706981324],
[23.700256347656254, 58.20689706981324],
[23.709869384765625, 58.20689706981324],
[23.719482421875, 58.20689706981324],
[23.73046875, 58.205449994019915],
[23.74008178710938, 58.201832046582055],
[23.749694824218754, 58.19893742329482],
[23.757934570312504, 58.195318812495216],
[23.763427734375004, 58.191699833128936],
[23.766174316406254, 58.187356571348914],
[23.768920898437504, 58.18301277875975],
[23.771667480468754, 58.17794434980202],
[23.77029418945313, 58.17215097473495],
[23.763427734375004, 58.16925393324148],
[23.762054443359375, 58.16852963599527],
[23.745574951171875, 58.16273472702818],
[23.745574951171875, 58.16273472702818]
]
[18.160400390625004, 56.127184156131065],
[18.237304687500004, 56.15166933290848],
[18.303222656250004, 56.16390607394954],
[18.369140625000004, 56.17613891766981],
[18.435058593750004, 56.18225387824834],
[18.500976562500004, 56.1883678647531],
[18.588867187500004, 56.1883678647531],
[18.665771484375004, 56.19448087726972],
[18.731689453125004, 56.21281407174654],
[18.775634765625004, 56.24334992410525],
[18.808593750000004, 56.27996083172847],
[18.830566406250004, 56.31653672211301],
[18.8525390625, 56.353077613860826]
]
}
},
{
}, {
"type": "Feature",
"properties": {
"auxiliary": "exercise",
"time": [1508720400000,
1508721300000,
1508722200000,
1508723100000,
1508724000000,
1508724900000,
1508725800000,
1508726700000,
1508727600000,
1508728500000,
1508729400000,
1508730300000,
1508731200000,
1508732100000,
1508733000000,
1508733900000,
1508734800000,
1508735700000,
1508736600000,
1508737500000,
1508738400000,
1508739300000,
1508740200000,
1508741100000,
1508742000000,
1508742900000,
1508743800000,
1508744700000,
1508745600000,
1508746500000,
1508747400000,
1508748300000,
1508749200000,
1508750100000,
1508751000000,
1508751900000,
1508752800000,
1508753700000,
1508754600000,
1508755500000,
1508756400000,
1508757300000,
1508758200000,
1508759100000,
1508760000000,
1508760900000,
1508761800000,
1508762700000,
1508763600000]
"time": [1512573300000, 1512574200000, 1512575100000, 1512576000000]
},
"geometry": {
"type": "LineString",
"coordinates": [
[23.683776855468754, 58.16925393324148],
[23.692016601562504, 58.1793925460941],
[23.703002929687504, 58.18808048517292],
[23.716735839843754, 58.19821373061911],
[23.727722167968754, 58.205449994019915],
[23.744201660156254, 58.21413156442685],
[23.757934570312504, 58.222811012582135],
[23.78265380859375, 58.23148833880538],
[23.801879882812504, 58.237272044261026],
[23.818359375000004, 58.24016354341644],
[23.840332031250004, 58.243054806872685],
[23.856811523437504, 58.244500350217336],
[23.88427734375, 58.244500350217336],
[23.908996582031254, 58.244500350217336],
[23.908996582031254, 58.244500350217336],
[23.908996582031254, 58.244500350217336],
[23.928222656250004, 58.244500350217336],
[23.94744873046875, 58.243054806872685],
[23.966674804687504, 58.237272044261026],
[23.983154296875004, 58.23148833880538],
[24.002380371093754, 58.225703690410995],
[24.01611328125, 58.21991809898306],
[24.029846191406254, 58.21413156442685],
[24.046325683593754, 58.20689706981324],
[24.057312011718754, 58.19821373061911],
[24.071044921875004, 58.192423658488636],
[24.084777832031254, 58.18663264278021],
[24.098510742187504, 58.18084068339925],
[24.109497070312504, 58.17359940698948],
[24.109497070312504, 58.17359940698948],
[24.109497070312504, 58.17359940698948],
[24.125976562500004, 58.16925393324148],
[24.145202636718754, 58.163459142275535],
[24.161682128906254, 58.16056139277947],
[24.1864013671875, 58.16056139277947],
[24.208374023437504, 58.16056139277947],
[24.230346679687504, 58.16056139277947],
[24.252319335937504, 58.16056139277947],
[24.274291992187504, 58.16056139277947],
[24.296264648437504, 58.16490792851809],
[24.312744140625004, 58.16635665575894],
[24.334716796875, 58.16780532399956],
[24.353942871093754, 58.16925393324148],
[24.375915527343754, 58.16925393324148],
[24.375915527343754, 58.16925393324148],
[24.375915527343754, 58.16925393324148],
[24.395141601562504, 58.16925393324148],
[24.41436767578125, 58.16925393324148]
[18.586120605468754, 56.202120773375],
[18.580627441406254, 56.21586875215692],
[18.572387695312504, 56.22655821688316],
[18.566894531250004, 56.237244700410336]
]
}
}]
......
{
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"properties": {
"simulation": {
"forwardCalculation": true,
"startDate": 1512572400000,
"stopDate": 1512576000000,
"oilclass": "Oil classes",
"substance": "Medium oils (100-1000 cSt)",
"fresh": true,
"amount": "10",
"amountUnit": "m3",
"uncertainty": false,
"mode": "Normal"
},
"primary": "PADM",
"type": "oil",
"subtype": "instant",
"meanLat": 56.24013088499595,
"meanLng": 18.5064697265625,
"observation": [{
"id": null,
"provider": "USER",
"providerDataRef": null,
"providerImgRef": null,
"providerType": null,
"type": "MANUAL",
"date": 1512572400000
}],
"domain": "HELCOM",
"model": "NEMO"
},
"geometry": {
"type": "LineString",
"coordinates": [
[18.160400390625004, 56.127184156131065],
[18.237304687500004, 56.15166933290848],
[18.303222656250004, 56.16390607394954],
[18.369140625000004, 56.17613891766981],
[18.435058593750004, 56.18225387824834],
[18.500976562500004, 56.1883678647531],
[18.588867187500004, 56.1883678647531],
[18.665771484375004, 56.19448087726972],
[18.731689453125004, 56.21281407174654],
[18.775634765625004, 56.24334992410525],
[18.808593750000004, 56.27996083172847],
[18.830566406250004, 56.31653672211301],
[18.8525390625, 56.353077613860826]
]
}
}, {
"type": "Feature",
"properties": {
"auxiliary": "exercise",
"time": [1512573300000, 1512574200000, 1512575100000, 1512576000000]
},
"geometry": {
"type": "LineString",
"coordinates": [
[18.586120605468754, 56.202120773375],
[18.580627441406254, 56.21586875215692],
[18.572387695312504, 56.22655821688316],
[18.566894531250004, 56.237244700410336]
]
}
}]
}
\ No newline at end of file
{
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"properties": {
"simulation": {
"forwardCalculation": true,
"startDate": 1512572400000,
"stopDate": 1512576000000,
"oilclass": "Oil classes",
"substance": "Medium oils (100-1000 cSt)",
"fresh": true,
"amount": "10",
"amountUnit": "m3",
"uncertainty": false,
"mode": "Normal"
},
"primary": "PADM",
"type": "oil",
"subtype": "instant",
"meanLat": 58.950008233357046,
"meanLng": 20.302734375000004,
"observation": [{
"id": null,
"provider": "USER",
"providerDataRef": null,
"providerImgRef": null,
"providerType": null,
"type": "MANUAL",
"date": 1512572400000
}],
"domain": "HELCOM",
"model": "NEMO"
},
"geometry": {
"type": "Point",
"coordinates": [20.302734375000004, 58.950008233357046]
}
}, {
"type": "Feature",
"properties": {
"auxiliary": "exercise",
"time": [1512573300000, 1512574200000, 1512575100000, 1512576000000]
},
"geometry": {
"type": "LineString",
"coordinates": [
[20.566406250000004, 58.81374171570782],
[20.742187500000004, 58.69977573144006],
[20.961914062500004, 58.60833366077633],
[21.181640625000004, 58.51665179936381]
]
}
}]
}
\ No newline at end of file
{
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"properties": {
"simulation": {
"forwardCalculation": true,
"startDate": 1512572400000,
"stopDate": 1512576000000,
"oilclass": "Oil classes",
"substance": "Heavy oils (>1000 cSt)",
"fresh": true,
"amount": "10",
"amountUnit": "m3",
"uncertainty": false,
"mode": "Normal"
},
"primary": "PADM",
"type": "oil",
"subtype": "instant",
"meanLat": 58.513756484300636,
"meanLng": 18.322448730468754,
"observation": [{
"id": null,
"provider": "USER",
"providerDataRef": null,
"providerImgRef": null,
"providerType": null,
"type": "MANUAL",
"date": 1512572400000
}],
"domain": "HELCOM",
"model": "NEMO"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[18.209838867187504, 58.49082301741564],
[18.220825195312504, 58.50804431680734],
[18.237304687500004, 58.52812515905846],
[18.259277343750004, 58.54246158235835],
[18.292236328125004, 58.55106062287748],
[18.336181640625004, 58.55679214448154],
[18.380126953125004, 58.553926500879044],
[18.413085937500004, 58.54246158235835],
[18.429565429687504, 58.52238894827317],
[18.435058593750004, 58.50517468678928],
[18.418579101562504, 58.487951979600396],
[18.380126953125004, 58.47359327016314],
[18.347167968750004, 58.47072082411973],
[18.308715820312504, 58.47072082411973],
[18.297729492187504, 58.47072082411973],
[18.209838867187504, 58.49082301741564]
]
]
}
}, {
"type": "Feature",
"properties": {
"auxiliary": "exercise",
"time": [1512573300000, 1512574200000, 1512575100000, 1512576000000]
},
"geometry": {
"type": "LineString",
"coordinates": [
[18.325195312500004, 58.496564389069675],
[18.325195312500004, 58.476465481471976],
[18.325195312500004, 58.4563550724647],
[18.319702148437504, 58.43910842173683]
]
}
}]
}
\ No newline at end of file
This diff is collapsed.
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