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] allow to open COG links in external viewer #7387

Merged
merged 3 commits into from
Oct 9, 2023

Conversation

landryb
Copy link
Contributor

@landryb landryb commented Oct 3, 2023

on top of #6950 to avoid conflicts - so only the last two commits matter for the feature - adds support for OGC:COG links, that's a cherrypick/backport of georchestra/geonetwork#252.

i've chosen OGC:COG as it's a candidate to OGC standards cf https://portal.ogc.org/files/102116

with this in the XML:

<gmd:onLine>
  <gmd:CI_OnlineResource>
    <gmd:linkage>
      <gmd:URL>
        https://cogeo.craig.fr/opendata/ortho/orthocraig3_vichy_2021.cog.tif
      </gmd:URL>
    </gmd:linkage>
    <gmd:protocol>
      <gco:CharacterString>OGC:COG</gco:CharacterString>
    </gmd:protocol>
    <gmd:name>
      <gco:CharacterString>Vichy 3cm</gco:CharacterString>
    </gmd:name>
    <gmd:description>
      <gco:CharacterString>COG de 2021</gco:CharacterString>
    </gmd:description>
  </gmd:CI_OnlineResource>
</gmd:onLine>

i can open COG links in a mapstore2 instance with support for parametrized opening of COG links (being upstreamed in geosolutions-it/MapStore2#9531)

@josegar74 josegar74 added this to the 4.4.1 milestone Oct 3, 2023
@jahow
Copy link
Contributor

jahow commented Oct 3, 2023

Thanks! would it make sense to have it also show in the GeoNetwork viewer? I'm not sure what would happen currently if no external viewer is used and the user clicks on the "add layer" button for COG (or 3DTiles for that matter)

OpenLayers has received a lot of powerful features for showing live COGs, maybe we could upgrade the lib and leverage these.

@landryb
Copy link
Contributor Author

landryb commented Oct 3, 2023

Thanks! would it make sense to have it also show in the GeoNetwork viewer? I'm not sure what would happen currently if no external viewer is used and the user clicks on the "add layer" button for COG (or 3DTiles for that matter)

as i already said in #6950 i dont know since i never really used/tested the gn bundled viewer.. and i think my code adds support/plumbing for that, just i have no idea what would happen in that case if the links are clicked and sent to the bundled viewer.

@jahow
Copy link
Contributor

jahow commented Oct 6, 2023

I added a commit to address #6950 (comment), @landryb if you're ok with it then I think we can merge both PRs.

@landryb
Copy link
Contributor Author

landryb commented Oct 9, 2023

I added a commit to address #6950 (comment), @landryb if you're ok with it then I think we can merge both PRs.

definitely, i'll make sure to backport this to georchestra/geonetwork#252 so that georchestra's fork is up to date with upstream. thanks !

Copy link
Contributor

@jahow jahow left a comment

Choose a reason for hiding this comment

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

@landryb could you please rebase this on main to avoid conflicts? thanks!

@landryb landryb force-pushed the feat/send-cog-to-external-viewer branch from 98fd3c3 to 7c7fb62 Compare October 9, 2023 08:20
@landryb
Copy link
Contributor Author

landryb commented Oct 9, 2023

done

This will also avoid switching to the viewer if no layer with supported
protocol is found
Copy link
Contributor

@jahow jahow left a comment

Choose a reason for hiding this comment

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

Thanks for the work on this @landryb!

@jahow jahow merged commit 123db88 into geonetwork:main Oct 9, 2023
6 checks passed
@fxprunayre
Copy link
Member

OpenLayers has received a lot of powerful features for showing live COGs, maybe we could upgrade the lib and leverage these.

How difficult would that be? A quick test shows that Stamen layer require StadiaMaps, tileLoadFunction need an update, annotations panel is not displayed but legend/layer manager/measures/zoom/print/wfs layers/feature info looks ok.

@jahow
Copy link
Contributor

jahow commented Oct 9, 2023

How difficult would that be? A quick test shows that Stamen layer require StadiaMaps, tileLoadFunction need an update, annotations panel is not displayed but legend/layer manager/measures/zoom/print/wfs layers/feature info looks ok.

Probably not much work really, one or two days at most. There might be more work for displaying COGs in the viewer, unless they simply contain RGB channels; otherwise we might have to let the user decide which channels to show under which color etc.

@fxprunayre
Copy link
Member

Probably not much

Tentative #7421 maybe you can think of any other OL changes to check?

return config;
}

$scope.resultviewFns = {
addMdLayerToMap: function (link, md) {
// This is probably only a service
// Open the add service layer tab
var config = buildAddToMapConfig(link, md);
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this is somehow related to #6548. Should we close #6548?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think so, yes

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.

4 participants