toar-location-services
1. Synopsis
Python Django services to extract station characterisation information from global geographic and geophysical datasets.
All "location" services provide similar REST interfaces so that they can easily be harvested, e.g. for inclusion into the TOAR database:
.../location/SERVICE_NAME
/?lat=Y
&lon=X
&OPTIONS
Valid SERVICE_NAME
s are:
major-roads
: returns distance to major roads using the OpenStreetMap Overpass
interface
population-density
: returns aggregate statistics of population density from
the GPW3.1 1 km dataset
topography-tandem-x
: returns aggregate statistics of topography from TanDEM-X
90m dataset (provided by German Aerospace Center DLR)
Arguments:
Y
: latitude in degrees_north (southern latitudes as negative values)
X
: longitude in degrees_east (either -180 to +180 or 0 to 360)
Note: You can also write long
or longitude
instead of lon
, or
latitude
instead of lat
.
OPTIONS:
radius
=: radius in m for aggregation of results. Default: 20000, i.e.
20 km.
agg
=mean|median|min|max|NN-percentile: aggregation method. Not available for
all services. For example, major-raods will always return the nearest
distance to a road. NN-percentile
can also be written as NN%-ile
.
direction
=N|NEN|NE|ENE|E|ESE|SE|SES|S|SWS|SW|WSW|W|WNW|NW|NWN: restrict
search and/or aggregation to specified wind sector.
by_direction
=True: return result for each wind sector. The result will be an
array (or dict??) instead of a single value.
Individual services may have additional optional URL parameters.
2. Individual services
2.1 major-roads
This services performs a query to the Overpass Web API of Open Street Map
and returns the distance
and compass angle to the nearest major road from the point location specified by
the lat
and lon
arguments. The response also contains information about the
highway type (see definitions)
and highway name if available.
OPTIONS:
The radius
, direction
, and by_direction
arguments work as described above.
The agg
option is ignored.
highway_types
=string: specify the Open Street Map highway types to be included
in the search. Default is to ask for
'motorway,trunk,primary,secondary,tertiary'. Highway types must be specified as
comma-separated string.
2.2 population-density
This services queries a local copy of the Global Population of the World,
version 3.1 dataset (see SEDAC) and
returns the population density at the point location specified by
the lat
and lon
arguments or aggregated over a given radius
.
OPTIONS:
All arguments can be used as described above. There are no service-specific arguments.
2.3 topography-tandem-x
This service works on a local file with topography data previously downloaded from
DLR ftp-server. It returns the height of topography at
the point location specified by the lat
and lon
arguments or aggregrated over
given radius
.
OPTIONS:
All arguments can be used as described above. There are no service-specific arguments.
3. Installation
Clone package from https://gitlab.version.fz-juelich.de/schultz1/toar-location-services.git (or use wheel file if available) Copy population.txt data from https://b2drop.eudat.eu/s/oMKces2x8GfNDmF into [toar-location-services]/data
Copy tandem-x topography data ...
Install geospatial libraries: sudo apt-get install binutils libproj-dev gdal-bin
python manage.py runserver
A database migration is not necessary as this application uses no models.
Note: the installation procedure may change in the future when we access data via rasdaman.
4. Authors
Martin G. Schultz and Jan Vogelsang, Jülich Supercomputing Centre, Forschungszentrum Jülich, Germany
5. Acknowledgements
All providers of geographic and geophysical data who made their data publicly available and allowed us to use them in these services.
The authors are grateful for funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No 787576).
6. ToDos
- fix bug in major roads. Example: https://www.openstreetmap.org/search?query=35N%20105W#map=14/34.9995/-105.0031 shows raods 500 m E and 3 km South of location, but result is "direction": "E", "distance": 16888.17616208224, "units": "m", "compass_angle": 89.19719274833112,
"direction": "S", "distance": 2551.1981212307574, "units": "m", "compass_angle": 183.42691921844707,
What is visibly in E direction only gets displayed for direction ENE! "direction": "ENE", "distance": 606.2812107100551, "units": "m", "compass_angle": 74.98425164260534,
- Add more datasets and services
- topography data from SRTM and Tandem-X
- Update population data to GPW 4
-
Store larger datasets in rasdaman and rewire services to query rasdaman
-
Add support for temporally changing data