-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Welcome to the Support-of-Unit-Of-Measure-conversion-in-istSOS3 wiki!
-
Clone this Repo.
git clone https://github.com/ChristophBerg/postgresql-unit.git -
cd postgresql-unit -
Change postgresql-server-dev-(10, 9.5 etc.) according to your installation configuration
sudo apt-get install build-essential postgresql-server-dev-10 flex bisonmake PG_CONFIG=/usr/lib/postgresql/10/bin/pg_configsudo make install PG_CONFIG=/usr/lib/postgresql/10/bin/pg_config -
For more detail postgresql-unit https://github.com/ChristophBerg/postgresql-unit.
-
Clone istsos3 testing repo.
git clone https://github.com/rahulworld/Support-of-Unit-Of-Measure-conversion-in-istSOS3 -
Install istsos3 Using main repo. documentation https://github.com/rahulworld/istsos3/blob/master/README.md .
-
cd istsos3 -
Start server using
python examples/server_tornado.py -
Install Postman for Post request easily https://www.getpostman.com/.
-
listen at
http://localhost:8887/restin Postman. -
Insert sensor with one observable property sensor in istsos3 using http://istsos.org/en/v3.0.0-Beta/index.html OR
"action": "CREATE_SENSOR",
"data": {
"name": "belin",
"fixed": true,
"procedure": "belin",
"procedure_description_format": ["http://www.opengis.net/sensorML/1.0.1"],
"observable_properties": [
{
"name": "temperature",
"definition": "urn:ogc:def:parameter:x-istsos:1.0:temperature",
"uom": "°C",
"type": "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement"
}
],
"observation_types": [
"http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement"
],
"foi_type": "http://www.opengis.net/def/samplingFeatureType/OGC-OM/2.0/SF_SamplingPoint",
"sampled_foi": {
"identifier": "belin_foi",
"name": "belin_foi",
"type": "http://www.opengis.net/def/samplingFeatureType/OGC-OM/2.0/SF_SamplingPoint",
"shape": {
"type": "Point",
"coordinates": [
0.0,
0.0,
0.0
]
}
}
}
}
Insert Observation any valid data like bellinzona with one observable property
"action": "INSERT_OBSERVATIONS",
"data": [{
"offering": "belin",
"procedure": "belin",
"type": "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement",
"featureOfInterest": {
"href": "beline_foi"
},
"phenomenonTime": {
"timeInstant": {
"instant": "2003-08-05T00:00:00+02:00"
}
},
"resultTime": {
"timeInstant": {
"instant": "2003-08-05T00:00:00+02:00"
}
},
"result": 28.3,
"observedProperty": {
"name": "temperature",
"def": "urn:ogc:def:parameter:x-istsos:1.0:temperature",
"uom": "°C",
"type": "http://www.opengis.net/def/observationType/OGC-OM/2.0/OM_Measurement"
}
}]
}
- Fetch Observation of any offering from istsos3 and change
in_unitvariable according to specific unit below script
"action": "UNIT_CONVERSION_USING_POSTGRESQL_UNIT",
"data": {
"offerings": ["belin","belin"],
"observedProperties": [
"urn:ogc:def:parameter:x-istsos:1.0:temperature"
],
"temporal": {
"reference": "om:phenomenonTime",
"fes": "during",
"period": [
"2015-05-03T16:30:00.000000+0200",
"2015-06-03T16:30:00.000000+0200"
]
},
"responseFormat": "application/json;subtype='array'"
},
"in_unit":"°F"
}
###Take Data as array, array2, vega and default data format as user specific unit after change subtype above script.
###Cons It is not good for unit conversion it takes lot of time. It is not extensible for user can't understand istsos units like °C unlike in postgresql-unit and gave error when we convert data from degC from degF in istsos3. It has ambiguity. It Can't convert unit of data without user's knowledge of pint libraries in istsos3.
###Work
- In this we also give value of
from_unitobeservable property uom according to pint like°FasdegF. - also give value of user specific unit
to_unitlike°KasdegK. - It gave error unit conversion like
°CasdegCto any other temperature unit.
Use this post script for pint only for array type data.
"action": "UNIT_CONVERSION_USING_POSTGRESQL_UNIT",
"data": {
"offerings": ["belin","belin"],
"observedProperties": [
"urn:ogc:def:parameter:x-istsos:1.0:temperature"
],
"temporal": {
"reference": "om:phenomenonTime",
"fes": "during",
"period": [
"2015-05-03T16:30:00.000000+0200",
"2015-06-03T16:30:00.000000+0200"
]
},
"responseFormat": "application/json;subtype='array'"
},
"from_unit":"degF"
"to_unit":"degK"
}