-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scotland, Finland, Italy, Flanders, Spain, France and Norway DTM prov…
…iders * Scotland DTM provider * linting (as usual) * moar linting * and more linting * Finland provider * remove superfluous print statements * update docs on DTM providers that require a key * And Tinitaly provider * Add Flanders provider * Spain 5m DTM Provider * remove grequests * Add France provider * Norway provider * Ignore similar code in providers * Addressed PR feedback * forgot a file * try again after merging
- Loading branch information
1 parent
079aea8
commit efbd296
Showing
18 changed files
with
488 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Streamlit: webui", | ||
"type": "debugpy", | ||
"request": "launch", | ||
"module": "streamlit", | ||
"args": ["run", "./webui/webui.py"], | ||
"presentation": { | ||
"reveal": "always", | ||
"panel": "new" | ||
}, | ||
"env": { | ||
"PYTHONPATH": "${workspaceFolder}:${PYTHONPATH}", | ||
"LOG_LEVEL": "DEBUG", | ||
} | ||
}, | ||
{ | ||
"name": "demo.py", | ||
"type": "debugpy", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/demo.py", | ||
"console": "integratedTerminal", | ||
"justMyCode": true, | ||
"env": { | ||
"PYTHONPATH": "${workspaceFolder}" | ||
} | ||
}, | ||
{ | ||
"name": "Current File", | ||
"type": "debugpy", | ||
"request": "launch", | ||
"program": "${file}", | ||
"console": "integratedTerminal", | ||
"justMyCode": true, | ||
"env": { | ||
"PYTHONPATH": "${workspaceFolder}" | ||
} | ||
} | ||
] | ||
} | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Streamlit: webui", | ||
"type": "debugpy", | ||
"request": "launch", | ||
"module": "streamlit", | ||
"args": ["run", "./webui/webui.py"], | ||
"presentation": { | ||
"reveal": "always", | ||
"panel": "new" | ||
}, | ||
"env": { | ||
"PYTHONPATH": "${workspaceFolder}:${PYTHONPATH}", | ||
"LOG_LEVEL": "DEBUG" | ||
} | ||
}, | ||
{ | ||
"name": "demo.py", | ||
"type": "debugpy", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/demo.py", | ||
"console": "integratedTerminal", | ||
"justMyCode": true, | ||
"env": { | ||
"PYTHONPATH": "${workspaceFolder}" | ||
} | ||
}, | ||
{ | ||
"name": "Current File", | ||
"type": "debugpy", | ||
"request": "launch", | ||
"program": "${file}", | ||
"console": "integratedTerminal", | ||
"justMyCode": true, | ||
"env": { | ||
"PYTHONPATH": "${workspaceFolder}" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
"""This module contains provider of Finland data.""" | ||
|
||
from owslib.util import Authentication | ||
|
||
from maps4fs.generator.dtm.base.wcs import WCSProvider | ||
from maps4fs.generator.dtm.dtm import DTMProvider, DTMProviderSettings | ||
|
||
|
||
class FinlandProviderSettings(DTMProviderSettings): | ||
"""Settings for the Finland provider.""" | ||
|
||
api_key: str = "" | ||
|
||
|
||
class FinlandProvider(WCSProvider, DTMProvider): | ||
"""Provider of Finland data.""" | ||
|
||
_code = "finland" | ||
_name = "Finland" | ||
_region = "FI" | ||
_icon = "🇫🇮" | ||
_resolution = 2 | ||
_settings = FinlandProviderSettings | ||
_author = "[kbrandwijk](https://github.com/kbrandwijk)" | ||
_is_community = True | ||
_is_base = False | ||
_extents = (70.09, 59.45, 31.59, 19.08) | ||
|
||
_url = "https://avoin-karttakuva.maanmittauslaitos.fi/ortokuvat-ja-korkeusmallit/wcs/v2" | ||
_wcs_version = "2.0.1" | ||
_source_crs = "EPSG:3067" | ||
_tile_size = 1000 | ||
|
||
_instructions = ( | ||
"ℹ️ This provider requires an API Key. See [here](https://www.maanmittausl" | ||
"aitos.fi/rajapinnat/api-avaimen-ohje) for more information on how to create one, then " | ||
"enter it below in the settings field for API Key." | ||
) | ||
|
||
def get_wcs_instance_parameters(self): | ||
settings = super().get_wcs_instance_parameters() | ||
settings["auth"] = Authentication( | ||
username=self.user_settings.api_key, password=self.user_settings.api_key | ||
) | ||
return settings | ||
|
||
def get_wcs_parameters(self, tile: tuple[float, float, float, float]) -> dict: | ||
return { | ||
"identifier": ["korkeusmalli_2m"], | ||
"subsets": [("N", str(tile[0]), str(tile[2])), ("E", str(tile[1]), str(tile[3]))], | ||
"format": "image/tiff", | ||
"timeout": 600, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
"""This module contains provider of Flanders data.""" | ||
|
||
from maps4fs.generator.dtm.base.wcs import WCSProvider | ||
from maps4fs.generator.dtm.dtm import DTMProvider | ||
|
||
|
||
class FlandersProvider(WCSProvider, DTMProvider): | ||
"""Provider of Flanders data.""" | ||
|
||
_code = "flanders" | ||
_name = "Flanders DHM II" | ||
_region = "BE" | ||
_icon = "🇧🇪" | ||
_resolution = 1 | ||
_author = "[kbrandwijk](https://github.com/kbrandwijk)" | ||
_is_community = True | ||
_is_base = False | ||
_extents = (51.5150730375579684, 50.6694992827160817, 5.9444417082210812, 2.5170092434134252) | ||
|
||
_url = "https://geo.api.vlaanderen.be/el-dtm/wcs" | ||
_wcs_version = "1.0.0" | ||
_source_crs = "EPSG:4258" | ||
_tile_size = 0.02 | ||
|
||
def get_wcs_parameters(self, tile: tuple[float, float, float, float]) -> dict: | ||
return { | ||
"identifier": "EL.GridCoverage.DTM", | ||
"bbox": tile, | ||
"format": "GeoTIFF", | ||
"crs": "EPSG:4258", | ||
"width": 1000, | ||
"height": 1000, | ||
"timeout": 600, | ||
} |
Oops, something went wrong.