Matching areas¶
Matching GRIB areas¶
Syntax: area:GRIB:key1=val1,key2=val2,...
Matches any GRIB area that has at least all the given keys, with the given values.
There is no exaustive list of possible keys, as they can be anything that gets set by the GRIB scanning configuration.
Examples¶
Given area GRIB(lat=45000, lon=12000)
:
area:GRIB:lat=45000
matchesarea:GRIB:lat=45000,lon=12000
matchesarea:GRIB:lat=45,lon=12
does not matcharea:GRIB:answer=42
does not match
Given area GRIB(blo=10, lat=5480000, lon=895000, sta=22)
area:GRIB:sta=22
matchesarea:GRIB:sta=88
does not match
Matching ODIMH5 areas¶
Syntax: area:ODIMH5:lat=value,lon=value,radius=value
Latitude and longitude are degrees in decimal notation mutiplied by 1000000 For example 12.345 degrees becomes “12345000”
Radius is a value expressed in meters
bbox for ODIMH5 PVOL files are calculated building an octagon that contains a circle centered at latitude and longitude with the given radius.
The octagon has some extra areas that exceed the original circle so so particular attention must be paid by user.
Examples¶
Given area ODIMH5(lat=45000000, lon=30000000, radius=1000)
area:ODIMH5:lat=45000000,lon=30000000,radius=1000
matchesarea:GRIB:sta=88
does not match
Matching VM2 areas¶
Syntax: area:VM2,id:key1=val1,key2=val2,...
Matches any VM2 area that has the at least the given id and all the given keys, with the given values.
The attributes (key1=value1
, …) are loaded at runtime from a meteo-vm2
attribute table.
Examples¶
Assume that area with id 1 has the attributes {lon=1207738,lat=4460016,rep="locali"}
Given area VM2(1)
area:VM2,1
matchesarea:VM2:lon=1207738,lat=4460016,rep=locali
matchesarea:VM2:rep=locali
matchesarea:VM2,2
does not matcharea:VM2:answer=42
does not match
Matching area bounding boxes¶
Syntax: area:bbox {verb} {value}
Matches the area bounding box against a sample value. The sample value is represented by a WKT geometry.
Available verbs:
equals
: the bounding box to match must be the same as the sample valuecovers
: the bounding box to match must contain the sample valuecoveredby
: the bounding box to match must be contained inside the sample valueintersects
: the bounding box to match must intersect the sample value
See: <http://www.cs.montana.edu/courses/535/resources/Understanding%20spatial%20relations.htm>
Examples¶
Given area GRIB(Ni=441, Nj=181, latfirst=45000000, latlast=43000000, lonfirst=10000000, lonlast=12000000, type=0)
equals
:
area: bbox equals POLYGON((10 43, 12 43, 12 45, 10 45, 10 43))
matchesarea: bbox equals POINT EMPTY
does not matcharea: bbox equals POINT(11 44)
does not matcharea: bbox equals POLYGON((12 43, 10 44, 12 45, 12 43))
does not match
covers
:
area: bbox covers POINT(11 44)
matchesarea: bbox covers POINT(12 43)
matchesarea: bbox covers LINESTRING(10 43, 10 45, 12 45, 12 43, 10 43)
matchesarea: bbox covers POLYGON((10 43, 10 45, 12 45, 12 43, 10 43))
matchesarea: bbox covers POLYGON((10.5 43.5, 10.5 44.5, 11.5 44.5, 11.5 43.5, 10.5 43.5))
matchesarea: bbox covers POLYGON((12 43, 10 44, 12 45, 12 43))
matchesarea: bbox covers POINT(11 40)
does not matcharea: bbox covers POINT(13 44)
does not matcharea: bbox covers POINT( 5 40)
does not matcharea: bbox covers LINESTRING(10 43, 10 45, 13 45, 13 43, 10 43)
does not matcharea: bbox covers POLYGON((10 43, 10 45, 13 45, 13 43, 10 43))
does not matcharea: bbox covers POLYGON((12 42, 10 44, 12 45, 12 42))
does not match
intersects
:
area: bbox intersects POINT(11 44)
matchesarea: bbox intersects POINT(12 43)
matchesarea: bbox intersects LINESTRING(10 43, 10 45, 12 45, 12 43, 10 43)
matchesarea: bbox intersects POLYGON((10 43, 10 45, 12 45, 12 43, 10 43))
matchesarea: bbox intersects POLYGON((10.5 43.5, 10.5 44.5, 11.5 44.5, 11.5 43.5, 10.5 43.5))
matchesarea: bbox intersects POLYGON((12 43, 10 44, 12 45, 12 43))
matchesarea: bbox intersects POLYGON((10 43, 10 45, 13 45, 13 43, 10 43))
matchesarea: bbox intersects POLYGON((12 42, 10 44, 12 45, 12 42))
matchesarea: bbox intersects POLYGON((9 40, 10 43, 10 40, 9 40))
matches: Touches one vertexarea: bbox intersects POINT(11 40)
does not match – Outsidearea: bbox intersects POINT(13 44)
does not match – Outsidearea: bbox intersects POINT( 5 40)
does not match – Outsidearea: bbox intersects LINESTRING(9 40, 10 42, 10 40, 9 40)
does not match – Disjointarea: bbox intersects POLYGON((9 40, 10 42, 10 40, 9 40))
does not match – Disjoint
coveredby
:
area: bbox coveredby POLYGON((10 43, 10 45, 12 45, 12 43, 10 43))
matches: Same shapearea: bbox coveredby POLYGON((10 43, 10 45, 13 45, 13 43, 10 43))
matches: Trapezoid containing areaarea: bbox coveredby POINT(11 44)
does not match: Intersection exists but area is 0area: bbox coveredby POINT(12 43)
does not match: Intersection exists but area is 0area: bbox coveredby POINT(11 40)
does not match: Outsidearea: bbox coveredby POINT(13 44)
does not match: Outsidearea: bbox coveredby POINT( 5 40)
does not match: Outsidearea: bbox coveredby POLYGON((12 42, 10 44, 12 45, 12 42))
does not matcharea: bbox coveredby POLYGON((12 43, 10 44, 12 45, 12 43))
does not match: Triangle contained inside, touching borders (?)area: bbox coveredby POLYGON((10.5 43.5, 10.5 44.5, 11.5 44.5, 11.5 43.5, 10.5 43.5))
does not match: Fully insidearea: bbox coveredby LINESTRING(10 43, 10 45, 12 45, 12 43, 10 43)
does not match:Same shape, but intersection area is 0area: bbox coveredby POLYGON((9 40, 10 43, 10 40, 9 40))
does not match: Touches one vertexarea: bbox coveredby LINESTRING(9 40, 10 42, 10 40, 9 40)
does not match:Disjointarea: bbox coveredby POLYGON((9 40, 10 42, 10 40, 9 40))
does not match: Disjoint