Skip to content
Snippets Groups Projects
Commit 650cce19 authored by lukas leufen's avatar lukas leufen
Browse files

update to v0.5.0

Closes #26, #34

See merge request toar/toar-location-services!19
parents 484dc247 cea08c11
No related branches found
No related tags found
1 merge request!19update to v0.5.0
Pipeline #24168 passed
Showing
with 27 additions and 39 deletions
......@@ -12,13 +12,13 @@ be harvested, e.g. for inclusion into the TOAR database:
**Valid `SERVICE_NAME`s are:**
`major-roads`: returns distance to major roads using the OpenStreetMap Overpass
`major_roads`: returns distance to major roads using the OpenStreetMap Overpass
interface
`population-density`: returns aggregate statistics of population density from
`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
`topography_tandem_x`: returns aggregate statistics of topography from TanDEM-X
90m dataset (provided by German Aerospace Center DLR)
**Arguments:**
......@@ -39,17 +39,15 @@ _Note:_ You can also write `long` or `longitude` instead of `lon`, or
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.
`direction`=N|NEN|NE|ENE|E|ESE|SE|SES|S|SWS|SW|WSW|W|WNW|NW|NWN|all|true: restrict
search and/or aggregation to specified wind sector. If set to all or true, return
result for each wind sector
Individual services may have additional optional URL parameters.
## 2. Individual services
### 2.1 major-roads
### 2.1 major_roads
This services performs a query to the Overpass Web API of Open Street Map
and returns the distance
......@@ -60,7 +58,7 @@ and highway name if available.
**OPTIONS:**
The `radius`, `direction`, and `by_direction` arguments work as described above.
The `radius` and `direction` arguments work as described above.
The `agg` option is ignored.
`highway_types`=string: specify the Open Street Map highway types to be included
......@@ -68,12 +66,12 @@ in the search. Default is to ask for
_'motorway,trunk,primary,secondary,tertiary'_. Highway types must be specified as
comma-separated string.
The *major-roads* service also has a `map` variant where
The *major_roads* service also has a `map` variant where
OpenStreetmap tiles are displayed with an overlay of the search point
and the roads surrounding it. The url for this is
[base-url]/major-roads/map/[?Options].
[base-url]/major_roads/map/[?Options].
### 2.2 population-density
### 2.2 population_density
This services queries a local copy of the Global Population of the World,
version 3.1 dataset (see [SEDAC](https://doi.org/10.7927/H4XK8CG2)) and
......@@ -85,12 +83,12 @@ the `lat` and `lon` arguments or aggregated over a given `radius`.
All arguments can be used as described above. There are no service-specific
arguments.
### 2.3 topography-tandem-x
### 2.3 topography_tandem_x
This services queries a local copy of TANDEM-X radar topography data from the DLR, Germany.
This services queries a local copy of TANDEM-X radar topography data from the [DLR, Germany](ftpes://tandemx-90m.dlr.de).
The dataset has 90 m resolution. The current local copy only covers the region of
Harz, Germany.
The service returns the topgraphic altitude at the point location specified by
The service returns the topographic altitude at the point location specified by
the `lat` and `lon` arguments or aggregated over a given `radius`.
**OPTIONS:**
......@@ -98,18 +96,6 @@ the `lat` and `lon` arguments or aggregated over a given `radius`.
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](ftpes://tandemx-90m.dlr.de). 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
### ubuntu
......
from django.apps import AppConfig
class ClimaticZonesConfig(AppConfig):
class ClimaticZonesConfig(AppConfig): # pragma: no cover
name = 'climatic_zones'
......@@ -31,4 +31,5 @@ class ClimateView(APIView, CommonViews):
CommonViews.__init__(self, **opts)
self.keep_only_given_agg_allowed(dict(maxclass=most_common_value,
frequency=relative_frequency),
frequency=dict(bins=13))
frequency=dict(bins=13,
missing_value=self.default_value))
from django.apps import AppConfig
class HtapRegionsConfig(AppConfig):
class HtapRegionsConfig(AppConfig): # pragma: no cover
name = 'htap_regions_tier1'
......@@ -34,4 +34,5 @@ class HTAPView(APIView, CommonViews):
self.keep_only_given_agg_allowed(dict(maxclass=most_common_value,
frequency=relative_frequency),
frequency=dict(bins=len(self.bins),
start_bin=self.min_valid))
start_bin=self.min_valid,
missing_value=self.default_value))
from django.apps import AppConfig
class HtapRegionsConfig(AppConfig):
class HtapRegionsConfig(AppConfig): # pragma: no cover
name = 'htap_regions_tier2'
from django.apps import AppConfig
class LocalConfig(AppConfig):
name = 'major-roads'
File moved
......@@ -23,7 +23,7 @@ class Road(APIView):
example : https://www.openstreetmap.org/way/493995603
USE EXAMPLE:
/major-roads/roads-radius/?lat=50.9&lng=6.9&radius=700&direction=ESE
/major_roads/roads-radius/?lat=50.9&lng=6.9&radius=700&direction=ESE
PARAMETERS:
lat
......
from django.apps import AppConfig
class TopographyTandemXConfig(AppConfig):
name = 'topography-tandem-x'
class LocalConfig(AppConfig): # pragma: no cover
name = 'major_roads'
File moved
File moved
File moved
File moved
File moved
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment