Strabon
view examples/teleios/discoverFires.rq @ 1426:014379fdddf2
fixed the tests of geof:distance and geof:buffer, that had wrong results due to the
conversion of the resulting geometry to the srid 3857.
The results are validated using PostGIS, where in the case of buffer there are
small differences in the precision.
Moreover, in the case of BufferMetresTest, there was no point in having as distance
1m, because the geometry did not change, so i added 55000 metres instead (about 0.5 degrees).
conversion of the resulting geometry to the srid 3857.
The results are validated using PostGIS, where in the case of buffer there are
small differences in the precision.
Moreover, in the case of BufferMetresTest, there was no point in having as distance
1m, because the geometry did not change, so i added 55000 metres instead (about 0.5 degrees).
author | Stella Giannakopoulou <sgian@di.uoa.gr> |
---|---|
date | Wed Sep 24 17:43:53 2014 +0300 (2014-09-24) |
parents | 3b3e9ed00cf0 |
children |
line source
1 #Το πρώτο query εφαρμόζεται με σκοπό τον περιορισμό τoυ θορύβου,
2 #εντοπίζοντας την χρονική αστάθεια ("αναλαμπές") σε πολύγωνα
3 #καμένων εκτάσεων. Υλοποιήσαμε και εφαρμόσαμε το ακόλουθο χρονικό φίλτρο
4 #στα δεδομένα (με αναφορές στον πηγαίο κώδικα):
5 #- Στις γραμμές 1574..1614, για κάθε πολύγωνο, ομαδοποιούμε τις
6 #καταγραφές οι οποίες δεν απέχουν μεταξύ τους (επόμενη-προηγούμενη)
7 #περισσότερο από την τιμή της μεταβλητής persistence.
8 #- Στην συνέχεια εξετάζουμε κάθε τέτοια ομάδα (κοντινών στο χώρο
9 #καταγραφών), και ελέγχουμε εάν το πλήθος τους (για κάθε τέτοια ομάδα)
10 #είναι μικρότερο ή ίσο από την τιμή της μεταβλητής repeat_in_persistence
11 #(γραμμές 1614..1630).
12 #- Αυτές τις καταγραφές τις διαγράφουμε θεωρώντας τις θόρυβο
14 PREFIX noa: <http://teleios.di.uoa.gr/ontologies/noaOntology.owl#>
15 PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
16 PREFIX strdf: <http://strdf.di.uoa.gr/ontology#>
17 PREFIX strdf-ext: <http://strdf.di.uoa.gr/extensions/ontology#>
18 PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
19 PREFIX gag: <http://geo.linkedopendata.gr/greekadministrativeregion/ontology#>
21 # The ending time of a fire (identificated by its starting time) is the latest
22 # hotspot attributed to this fire
23 SELECT ?start (max(?hTime) as ?end) ?geo
24 WHERE
25 {
26 {
27 # Each hotspots is finally grouped only with the latest fire starting
28 # time found
29 SELECT (max(?hStartTime) as ?start) ?hTime ?geo ?h
30 # SELECT (count(distinct ?hStartTime) as ?c) ?geo
31 WHERE {
32 # -- FIND HOTSPOTS THAT DEFINE THE START OF A FIRE (GROUP ALA THEMOS) --
33 # Retrieve all hotstpots in time range...
34 ?hStart noa:hasAcquisitionTime ?hStartTime ;
35 noa:hasGeometry ?geo ;
36 noa:producedFromProcessingChain "PROCESSING_CHAIN"^^xsd:string ;
37 noa:isDerivedFromSensor "SENSOR"^^xsd:string .
38 OPTIONAL {?hStart noa:isDiscarded ?hStartDisc }. FILTER (!bound(?hStartDisc)) .
39 FILTER(strdf-ext:diffDateTime("MIN_ACQUISITION_TIME"^^xsd:dateTime,?hStartTime)<=0 && strdf-ext:diffDateTime("MAX_ACQUISITION_TIME"^^xsd:dateTime,?hStartTime)>=0).
40 # ... narrow down results so that any previous hotspots is detected at least PERSISTENCE mins earlier
41 OPTIONAL {
42 ?hPrevious noa:hasAcquisitionTime ?hPreviousTime ;
43 noa:hasGeometry ?geo ;
44 noa:producedFromProcessingChain "PROCESSING_CHAIN"^^xsd:string ;
45 noa:isDerivedFromSensor "SENSOR"^^xsd:string .
46 OPTIONAL {?hPrevious noa:isDiscarded ?hPreviousDisc }. FILTER (!bound(?hPreviousDisc)) .
47 FILTER(strdf-ext:diffDateTime("MIN_ACQUISITION_TIME"^^xsd:dateTime,?hPreviousTime)<=0 && strdf-ext:diffDateTime("MAX_ACQUISITION_TIME"^^xsd:dateTime,?hPreviousTime)>=0).
48 FILTER(strdf-ext:diffDateTime(?hStartTime, ?hPreviousTime) <= PERSISTENCE*60000 && strdf-ext:diffDateTime(?hStartTime, ?hPreviousTime) > 0).
49 }
50 FILTER(!bound(?hPrevious)) .
52 # FIND HOTSPOTS AFTER A FIRE STARTING TIME
53 ?h noa:hasAcquisitionTime ?hTime;
54 noa:hasGeometry ?geo;
55 noa:producedFromProcessingChain "PROCESSING_CHAIN"^^xsd:string ;
56 noa:isDerivedFromSensor "SENSOR"^^xsd:string .
57 OPTIONAL {?h noa:isDiscarded ?hDisc }. FILTER (!bound(?hDisc)) .
58 FILTER(strdf-ext:diffDateTime("MIN_ACQUISITION_TIME"^^xsd:dateTime,?hTime)<=0 && strdf-ext:diffDateTime("MAX_ACQUISITION_TIME"^^xsd:dateTime,?hTime)>=0).
59 FILTER(strdf-ext:diffDateTime(?hTime, ?hStartTime) >= 0).
60 }
61 # group by ?geo
62 group by ?h ?hTime ?geo
63 }.
64 }
65 group by ?start ?geo
66 having (count(?h) >= REPEAT_IN_PERS)