diff --git a/geo_location_services/views.py b/geo_location_services/views.py index 341db4e819b0bab3c44de2d7f873dbfef12b5912..3c4ea312e86dca16b8df7e5b3c64f9068e7c0a30 100644 --- a/geo_location_services/views.py +++ b/geo_location_services/views.py @@ -26,31 +26,31 @@ class LocationServicesRootView(APIView): - ecoregion: description=[True|False] - Examples: see service URLs from https://toar-data-dev.fz-juelich.de/api/v2/geolocation_urls/ + Examples: see service URLs from https://toar-data-testing.fz-juelich.de/api/v2/geopeas_urls/ """ def get(self, request, format=None): - print(request.build_absolute_uri()) + requests_pathname_prefix = "geopeas/api/v1/" data = [ 'User interface APIs:', OrderedDict([ - ('major_road', request.build_absolute_uri()+'major_road/?lat=50.909637703990136&lon=6.406305214120635'), - ('population_density', request.build_absolute_uri()+'population_density/?lat=50.909637703990136&lon=6.406305214120635&year=2000'), - ('topography_srtm', request.build_absolute_uri()+'topography_srtm/?lat=50.909637703990136&lon=6.406305214120635&relative=False'), - ('stable_nightlights', request.build_absolute_uri()+'stable_nightlights/?lat=50.909637703990136&lon=6.406305214120635&year=2012'), - # ('wheat_production', request.build_absolute_uri()+'wheat_production/'), - # ('rice_production', request.build_absolute_uri()+'rice_production/'), - ('ecoregion', request.build_absolute_uri()+'ecoregion/?lat=50.909637703990136&lon=6.406305214120635&description=False'), - ('climatic_zone', request.build_absolute_uri()+'climatic_zone/?lat=50.909637703990136&lon=6.406305214120635'), - ('nox_emissions', request.build_absolute_uri()+'nox_emissions/?lat=50.909637703990136&lon=6.406305214120635&year=2012'), - # ('omi_no2', request.build_absolute_uri()+'omi_no2/'), - ('htap_region_tier1', request.build_absolute_uri()+'htap_region_tier1/?lat=50.909637703990136&lon=6.406305214120635&country=DE'), - # ('htap_regions_tier2', request.build_absolute_uri()+'htap_regions_tier2/'), - ('population_number', request.build_absolute_uri()+'population_number/?lat=50.909637703990136&lon=6.406305214120635&year=2000'), - ('landcover', request.build_absolute_uri()+'landcover/?lat=50.909637703990136&lon=6.406305214120635&description=False&year=2012'), - # ('built_up_area', request.build_absolute_uri()+'built_up_area/'), - # ('population_density_ghs', request.build_absolute_uri()+'population_density_ghs/') + ('major_road', request.build_absolute_uri()+requests_pathname_prefix+'major_road/?lat=50.909637703990136&lon=6.406305214120635'), + ('population_density', request.build_absolute_uri()+requests_pathname_prefix+'population_density/?lat=50.909637703990136&lon=6.406305214120635&year=2000'), + ('topography_srtm', request.build_absolute_uri()+requests_pathname_prefix+'topography_srtm/?lat=50.909637703990136&lon=6.406305214120635&relative=False'), + ('stable_nightlights', request.build_absolute_uri()+requests_pathname_prefix+'stable_nightlights/?lat=50.909637703990136&lon=6.406305214120635&year=2012'), + # ('wheat_production', request.build_absolute_uri()+requests_pathname_prefix+'wheat_production/'), + # ('rice_production', request.build_absolute_uri()+requests_pathname_prefix+'rice_production/'), + ('ecoregion', request.build_absolute_uri()+requests_pathname_prefix+'ecoregion/?lat=50.909637703990136&lon=6.406305214120635&description=False'), + ('climatic_zone', request.build_absolute_uri()+requests_pathname_prefix+'climatic_zone/?lat=50.909637703990136&lon=6.406305214120635'), + ('nox_emissions', request.build_absolute_uri()+requests_pathname_prefix+'nox_emissions/?lat=50.909637703990136&lon=6.406305214120635&year=2012'), + # ('omi_no2', request.build_absolute_uri()+requests_pathname_prefix+'omi_no2/'), + ('htap_region_tier1', request.build_absolute_uri()+requests_pathname_prefix+'htap_region_tier1/?lat=50.909637703990136&lon=6.406305214120635&country=DE'), + # ('htap_regions_tier2', request.build_absolute_uri()+requests_pathname_prefix+'htap_regions_tier2/'), + ('population_number', request.build_absolute_uri()+requests_pathname_prefix+'population_number/?lat=50.909637703990136&lon=6.406305214120635&year=2000'), + ('landcover', request.build_absolute_uri()+requests_pathname_prefix+'landcover/?lat=50.909637703990136&lon=6.406305214120635&description=False&year=2012'), + # ('built_up_area', request.build_absolute_uri()+requests_pathname_prefix+'built_up_area/'), + # ('population_density_ghs', request.build_absolute_uri()+requests_pathname_prefix+'population_density_ghs/') ]), ] # add admin view if staff user diff --git a/services/ecoregions/views.py b/services/ecoregions/views.py index 0101d287a74a2071898d437fb7f25b7d08ae26af..2ba496652153b52b5dece2800da60cf7fd020b3a 100644 --- a/services/ecoregions/views.py +++ b/services/ecoregions/views.py @@ -77,27 +77,33 @@ class EcoregionsViewMap(EcoregionsView): data_origin = { "datasource": { "label": "Datasource", - "value": provenance["data_source"] +# "value": provenance["data_source"] + "value": "RESOLVE Biodiversity and Wildlife Solutions" }, "url": { "label": "URL", - "value": provenance["data_url"] +# "value": provenance["data_url"] + "value": "" }, "description": { "label": "Description", - "value": provenance["data_description"] +# "value": provenance["data_description"] + "value": "" }, "citation": { "label": "Citation", - "value": provenance["citation"] +# "value": provenance["citation"] + "value": "Eric Dinerstein, David Olson, Anup Joshi, Carly Vynne, Neil D. Burgess, Eric Wikramanayake, Nathan Hahn, Suzanne Palminteri, Prashant Hedao, Reed Noss, Matt Hansen, Harvey Locke, Erle C Ellis, Benjamin Jones, Charles Victor Barber, Randy Hayes, Cyril Kormos, Vance Martin, Eileen Crist, Wes Sechrest, Lori Price, Jonathan E. M. Baillie, Don Weeden, Kieran Suckling, Crystal Davis, Nigel Sizer, Rebecca Moore, David Thau, Tanya Birch, Peter Potapov, Svetlana Turubanova, Alexandra Tyukavina, Nadia de Souza, Lilian Pintea, Jose C. Brito, Othman A. Llewellyn, Anthony G. Miller, Annette Patzelt, Shahina A. Ghazanfar, Jonathan Timberlake, Heinz Klöser, Yara Shennan-Farpon, Roeland Kindt, Jens-Peter Barnekow Lilleso, Paulo van Breugel, Lars Graudal, Maianna Voge, Khalaf F. Al-Shammari, Muhammad Saleem, An Ecoregion-Based Approach to Protecting Half the Terrestrial Realm, BioScience, Volume 67, Issue 6, June 2017, Pages 534–545, https://doi.org/10.1093/biosci/bix014" }, "version": { "label": "Version", - "value": provenance["version"] +# "value": provenance["version"] + "value": "" }, "terms_of_use": { "label": "Terms of Use", - "value": provenance["terms_of_use"] +# "value": provenance["terms_of_use"] + "value": "" } } diff --git a/services/population_density/static/js/population_density_map.js b/services/population_density/static/js/population_density_map.js index 7ecf561f562e48f3117bcdcb380ebadc13cf846e..350612bb760732aaa4ee5757d1211d4719fb3a01 100644 --- a/services/population_density/static/js/population_density_map.js +++ b/services/population_density/static/js/population_density_map.js @@ -17,15 +17,14 @@ var cfg = { } - - -L.tileLayer( 'https://zam10222.zam.kfa-juelich.de/tiles/{z}/{x}/{y}.png', { +L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>', subdomains: ['a','b','c'] }).addTo( map ); + L.circle(centerpoint, { radius: visualization_radius }).addTo(map); var heatCanvas = new HeatCanvas(cfg); heatCanvas.drawData(map); -heatCanvas.drawLegend(data_units) \ No newline at end of file +heatCanvas.drawLegend(data_units) diff --git a/services/population_density/views.py b/services/population_density/views.py index 2bf4b0c8b28c8492d4bb7640ebe7a705692fc9c7..3c93a20c52d87f4874359d9a7365a1cf4ce5a0c1 100644 --- a/services/population_density/views.py +++ b/services/population_density/views.py @@ -92,29 +92,41 @@ class PopulationDensityMapView(PopulationDensityView): years: list[str] = self.geo_cube_connection.metadata['years'] data_population_density = self.get_map_data(lat, lon, radius) + arcsec = 30 if radius is not None and radius > 10000 else 9 + data_population_density["data"] = [ {"dlat": d["dlat"], "dlon": d["dlon"], "lat": d["lat"], "lon": d["lon"], "value": d["value"] / ( + math.cos(math.radians(lat)) * (arcsec * 1.852/60.)**2 + )} for d in data_population_density["data"] ] agg_function = properties["agg_function"] - data_origin = { "datasource": { "label": "Datasource", - "value": response.data['provenance']['data_source'] +# "value": response.data['provenance']['data_source'] + "value": "The European Commission, Joint Research Centre" }, "copyright": { "label": "Copyright", - "value": response.data['provenance']['terms_of_use'] +# "value": response.data['provenance']['terms_of_use'] + "value": "" }, "data description": { "label": "Data Description", - "value": response.data['provenance']['data_description'] +# "value": response.data['provenance']['data_description'] + "value": "" }, "data url": { "label": "Data URL", - "value": response.data['provenance']['data_url'] +# "value": response.data['provenance']['data_url'] + "value": "" + }, + "data doi": { + "label": "Data DOI", + "value": "10.2905/0C6B9751-A71F-4062-830B-43C9F432370F PID: http://data.europa.eu/89h/0c6b9751-a71f-4062-830b-43c9f432370f" }, "citation": { "label": "Citation", - "value": response.data['provenance']['citation'] +# "value": response.data['provenance']['citation'] + "value": "Schiavina, Marcello; Freire, Sergio; MacManus, Kytt (2019): GHS-POP R2019A - GHS population grid multitemporal (1975-1990-2000-2015). European Commission, Joint Research Centre (JRC)" } } diff --git a/services/population_number/static/js/population_number_map.js b/services/population_number/static/js/population_number_map.js index 74abd30448e1a617b9a6114138d9aa1a43a26766..564409800e2d3ceff83b0035b254a0d57e1f21ce 100644 --- a/services/population_number/static/js/population_number_map.js +++ b/services/population_number/static/js/population_number_map.js @@ -18,8 +18,7 @@ var cfg = { - -L.tileLayer( 'https://zam10222.zam.kfa-juelich.de/tiles/{z}/{x}/{y}.png', { +L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>', subdomains: ['a','b','c'] }).addTo( map ); diff --git a/services/population_number/views.py b/services/population_number/views.py index 1d806f4e3d5c29bd4bfb5071d400656399a0f77a..2747f657b9326210a3b6c1c0ae6766a030ca3cf6 100644 --- a/services/population_number/views.py +++ b/services/population_number/views.py @@ -72,23 +72,32 @@ class PopulationNumberMapView(PopulationNumberView): data_origin = { "datasource": { "label": "Datasource", - "value": response.data['provenance']['data_source'] +# "value": response.data['provenance']['data_source'] + "value": "The European Commission, Joint Research Centre" }, "copyright": { "label": "Copyright", - "value": response.data['provenance']['terms_of_use'] +# "value": response.data['provenance']['terms_of_use'] + "value": "" }, "data description": { "label": "Data Description", - "value": response.data['provenance']['data_description'] +# "value": response.data['provenance']['data_description'] + "value": "" }, "data url": { "label": "Data URL", - "value": response.data['provenance']['data_url'] +# "value": response.data['provenance']['data_url'] + "value": "" + }, + "data doi": { + "label": "Data DOI", + "value": "10.2905/0C6B9751-A71F-4062-830B-43C9F432370F PID: http://data.europa.eu/89h/0c6b9751-a71f-4062-830b-43c9f432370f" }, "citation": { "label": "Citation", - "value": response.data['provenance']['citation'] +# "value": response.data['provenance']['citation'] + "value": "Schiavina, Marcello; Freire, Sergio; MacManus, Kytt (2019): GHS-POP R2019A - GHS population grid multitemporal (1975-1990-2000-2015). European Commission, Joint Research Centre (JRC)" } } diff --git a/services/stable_nightlights/views.py b/services/stable_nightlights/views.py index 74766109f5dfadee26c6f8582a85a001ff61a88b..f514392c8cccbb483238cadb5fafd6db2622b48e 100644 --- a/services/stable_nightlights/views.py +++ b/services/stable_nightlights/views.py @@ -83,27 +83,33 @@ class StableNightlightsMapView(StableNightlightsView): data_origin = { 'datasource': { 'label': 'Datasource', - 'value': provenance['data_source'] +# 'value': provenance['data_source'] + 'value': "NOAA National Centers for Environmental Information (NCEI)" }, 'url': { 'label': 'URL', - 'value': provenance['data_url'] +# 'value': provenance['data_url'] + 'value': "" }, 'description': { 'label': 'Description', - 'value': provenance['data_description'] +# 'value': provenance['data_description'] + 'value': "" }, 'citation': { 'label': 'Citation', - 'value': provenance['citation'] +# 'value': provenance['citation'] + 'value': "Image and data processing by NOAA's National Geophysical Data Center. DMSP data collected by US Air Force Weather Agency" }, 'version': { 'label': 'Version', - 'value': provenance['version'] +# 'value': provenance['version'] + 'value': "" }, 'terms_of_use': { 'label': 'Terms of Use', - 'value': provenance['terms_of_use'] +# 'value': provenance['terms_of_use'] + 'value': "" } } diff --git a/utils/global_templates/base.html b/utils/global_templates/base.html index 94e692d47fcf370858efa15914a41a6d941ddc1f..d94b4844935e341294f3dfbf7a858224fa1fa65b 100644 --- a/utils/global_templates/base.html +++ b/utils/global_templates/base.html @@ -96,7 +96,7 @@ <body> <nav class="navbar navbar-expand-lg navbar-light bg-light"> - <a class="navbar-brand" href="/gui">GeoLocationService</a> + <a class="navbar-brand" href="/gui">GeoPEAS</a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar-content" aria-controls="navbar-content" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> diff --git a/utils/global_templates/gui.html b/utils/global_templates/gui.html index 50a7c29d2be99684790db153b6c83aa0efe1a66c..02af3a6d78686a4eebda0e1dfde59200a48c83ad 100644 --- a/utils/global_templates/gui.html +++ b/utils/global_templates/gui.html @@ -3,14 +3,14 @@ <html lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> <head profile="http://gmpg.org/xfn/11"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> - <title> GeoLocationService - Overview </title> + <title> GeoPEAS - Overview </title> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous"> <link rel="stylesheet" href="{% static 'css/gui.css' %}"> </head> <body> <div class="container-fluid"> <div class="row"> - <h2 style="text-align: center;">GeoLocationService - Visualisation</h2> + <h2 style="text-align: center;">GeoPEAS - Visualisation</h2> </div> <div class="row mt-5"> {% for service_type, service_type_data in services.items %} diff --git a/utils/map_utils.py b/utils/map_utils.py index 98c3aab834e09a67a965c745f9d80e0806e38f52..e2b57163a0429dad86f69f91cfcf6f68ed064b1c 100644 --- a/utils/map_utils.py +++ b/utils/map_utils.py @@ -20,6 +20,8 @@ DIRECTIONS: dict[str, tuple[float, float]] = { for i, v in enumerate(['N','NNE','NE','ENE','E','ESE','SE','SSE','S','SSW','SW','WSW','W','WNW','NW','NNW']) } +requests_pathname_prefix = "geopeas/api/v1/" + SERVICES = { "isolated-points": { "label": "Isolated points services", @@ -27,7 +29,7 @@ SERVICES = { "major_roads": { "label": "Major Roads", "description": "Visualizes the specified roads with data from OpenStreetMap", - "path": f"/major_road/map/?lat=50.909637703990136&lon=6.406305214120635", + "path": f"/{requests_pathname_prefix}major_road/map/?lat=50.909637703990136&lon=6.406305214120635", } } }, @@ -37,22 +39,22 @@ SERVICES = { "climatic_zones": { "label": "Climatic Zones", "description": "Visualizes the climatic zones with data from University of East Anglia Climatic Research Unit", - "path": f"/climatic_zone/map/?lat={DEFAULT_LAT}&lon={DEFAULT_LON}&radius={DEFAULT_RADIUS}", + "path": f"/{requests_pathname_prefix}climatic_zone/map/?lat={DEFAULT_LAT}&lon={DEFAULT_LON}&radius={DEFAULT_RADIUS}", }, "ecoregions": { "label": "Ecoregions", "description": "Visualizes the ecoregions with data from RESOLVE", - "path": f"/ecoregion/map/?lat={DEFAULT_LAT}&lon={DEFAULT_LON}&radius={DEFAULT_RADIUS}&description=False", + "path": f"/{requests_pathname_prefix}ecoregion/map/?lat={DEFAULT_LAT}&lon={DEFAULT_LON}&radius={DEFAULT_RADIUS}&description=False", }, "landcover": { "label": "Landcover", "description": "Visualizes the landcover with data from the ESA", - "path": f"/landcover/map/?lat={DEFAULT_LAT}&lon={DEFAULT_LON}&radius={DEFAULT_RADIUS}&description=False&year=2012", + "path": f"/{requests_pathname_prefix}landcover/map/?lat={DEFAULT_LAT}&lon={DEFAULT_LON}&radius={DEFAULT_RADIUS}&description=False&year=2012", }, "stable_nightlights": { "label": "Stable Nightlights", "description": "Visualizes the stable nightlights with data from NCEI", - "path": f"/stable_nightlights/map/?lat={DEFAULT_LAT}&lon={DEFAULT_LON}&radius={DEFAULT_RADIUS}&year=2012", + "path": f"/{requests_pathname_prefix}stable_nightlights/map/?lat={DEFAULT_LAT}&lon={DEFAULT_LON}&radius={DEFAULT_RADIUS}&year=2012", } } }, @@ -62,22 +64,22 @@ SERVICES = { "nox_emissions": { "label": "NOx Emissions", "description": "Visualizes the nitrogen oxides with data from Copernicus", - "path": f"/nox_emissions/map/?lat={DEFAULT_LAT}&lon={DEFAULT_LON}&radius={DEFAULT_RADIUS}&year=2012" + "path": f"/{requests_pathname_prefix}nox_emissions/map/?lat={DEFAULT_LAT}&lon={DEFAULT_LON}&radius={DEFAULT_RADIUS}&year=2012" }, "population_density": { "label": "Population Density", "description": "Visualizes the population density with data from the Joint Research Center of the European Commission", - "path": f"/population_density/map/?lat={DEFAULT_LAT}&lon={DEFAULT_LON}&radius={DEFAULT_RADIUS}&year=2000" + "path": f"/{requests_pathname_prefix}population_density/map/?lat={DEFAULT_LAT}&lon={DEFAULT_LON}&radius={DEFAULT_RADIUS}&year=2000" }, "population_number": { "label": "Population Number", "description": "Visualizes the population number with data from the Join Research Center of the European Commission", - "path": f'/population_number/map/?lat={DEFAULT_LAT}&lon={DEFAULT_LON}&radius={DEFAULT_RADIUS}&year=2000' + "path": f'/{requests_pathname_prefix}population_number/map/?lat={DEFAULT_LAT}&lon={DEFAULT_LON}&radius={DEFAULT_RADIUS}&year=2000' }, "topography_srtm": { "label": "Topography SRTM", "description": "Visualizes the topography with data from the NASA Shuttle Radar Topographic Mission (SRTM)", - "path": f"/topography_srtm/map/?lat={DEFAULT_LAT}&lon={DEFAULT_LON}&radius={DEFAULT_RADIUS}&relative=False" + "path": f"/{requests_pathname_prefix}topography_srtm/map/?lat={DEFAULT_LAT}&lon={DEFAULT_LON}&radius={DEFAULT_RADIUS}&relative=False" } } }