Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup OBE references to gdal_remote and "Online" QgsLayerType #728

Merged
merged 11 commits into from
Aug 17, 2023
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
places" layer. Scale point markers for this layer by population.
* Add new "Internet-required data/Geological Map (1:500 000)" layer from GEUS.
* Add new "Geology/Mineral occurrences" layer from GEUS.
* Remove OBE references to "gdal_remote" layers. Remove "Online" from `QgsLayerType`.
trey-stafford marked this conversation as resolved.
Show resolved Hide resolved


# v3.0.0alpha4 (2023-07-21)
Expand Down
2 changes: 1 addition & 1 deletion qgreenland/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""
from typing import Literal, Union

QgsLayerType = Literal["Vector", "Raster", "Online"]
QgsLayerType = Literal["Vector", "Raster"]
QgsLayerProviderType = Literal["gdal", "ogr", "wms", "wfs", "wcs"]

ResamplingMethod = Literal["bilinear", "nearest"]
Expand Down
4 changes: 1 addition & 3 deletions qgreenland/models/config/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ def provenance(self) -> str:
return f"# Data fetched via HTTP from {[str(u) for u in self.urls]}"


# TODO: OnlineRaster/OnlineVector asset types? The thing that makes this a
# "gdal_remote" layer is the `/vsicurl/` prefix. Otherwise, this is created as a
# regular layer with a URL as its path.
# TODO: OnlineRaster/OnlineVector asset types?
class OnlineAsset(DatasetAsset):
"""A QGIS online layer that is not fetched, but is accessed by QGIS."""

Expand Down
2 changes: 1 addition & 1 deletion qgreenland/test/util/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ def test_layer_compile_dir(raster_layer_node):
assert expected == actual


def test_vector_or_raster_gdal_remote(online_layer_node):
def test_vector_or_raster(online_layer_node):
assert layer_util.vector_or_raster(online_layer_node) == "Raster"
6 changes: 4 additions & 2 deletions qgreenland/util/config/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import json
import os
from pathlib import Path
from typing import Union
from typing import Literal, Union

from humanize import naturalsize

Expand Down Expand Up @@ -82,7 +82,9 @@ def export_config_csv(
if not layer_cfg.in_package:
continue

layer_type: QgsLayerType
# NOTE: we want to make it clear to users that some layers are "online"
# and we use the "Vector or Raster" column to do that.
layer_type: Union[QgsLayerType, Literal["Online"]]
trey-stafford marked this conversation as resolved.
Show resolved Hide resolved
if isinstance(layer_cfg.input.asset, OnlineAsset):
layer_type = "Online"
# Online layers have no size on disk.
Expand Down