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

feat: support satellite imagery as basemap layer #348

Merged
merged 27 commits into from
Feb 12, 2024
Merged

Conversation

matthiasschaub
Copy link
Collaborator

@matthiasschaub matthiasschaub commented Jan 23, 2024

  • attribution
    • check if attribution is correct for all possible extents
    • attribution on sketch maps
    • attribution on open layers map
  • API key handling
  • qr-code: encode layer (osm, satellite) into qr-code #357
  • add parameters to URL
  • how to handle the case where no imagery for zoom level is available
    • max zoom level is set to 19 in front-end. Back-end will try to request images for higher zoom level. Should be checked. Are there cases where no images are return by ESRI.

closes #368

Comment on lines 37 to 48
class MapAttributions:
def __init__(self):
self.attributions = {
"osm": "Powered by OpenStreetMap<br />©openstreetmap.org/copyright",
"esri-world-imagery": "Powered by Esri<br />© Esri, Maxar, GeoEye, "
"Earthstar Geographics, CNES/Airbus DS, USD,"
" USGS, AeroGRID, IGN, and the GIS User Community",
}

def get_attribution(self, key):
if key in self.attributions:
return self.attributions[key]
Copy link
Collaborator Author

@matthiasschaub matthiasschaub Feb 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest using StrEnum. It's more concise. Something like this:

class Attribution(StrEnum):
    OSM = "Powered by OpenStreetMap<br />©openstreetmap.org/copyright"
    ESRI_WORLD_IMAGERY = "..."

Attribution of a layer can then be retrived like:

Attribution(layer.key).value

matthiasschaub and others added 19 commits February 12, 2024 12:08
… params

There was a problem sending layer "ESRI:World_Imagery".
Expected layername in python:  esri-world-imagery
Before fix:  esri-world_imagery
…Switcher Control

now it's possible to use an EventListener to get notified when the baselayer is switched with:
layerSwitcher.on("change:activeLayer", handleLayerSwitch)

This will be used to update the hidden form field with the layer information.
May also be used to update the location.href in the browser bar to create a bookmarkable URL with a layer state.
Avoid following error related to transforming Tensor object to numpy
array during marking detection:

TypeError: can't convert cuda:0 device type tensor to numpy. Use
Tensor.cpu() to copy the tensor to host memory first.
@matthiasschaub matthiasschaub merged commit b406b8c into main Feb 12, 2024
1 check passed
@matthiasschaub matthiasschaub deleted the wms-satellite branch February 12, 2024 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test: add esri-api-key to test_config
3 participants