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 mapstore #252

Conversation

landryb
Copy link
Member

@landryb landryb commented Oct 3, 2023

much like #227 and vastly inspired by it, mapstore2 is getting COG native support in 2023.02 (cf georchestra/mapstore2-georchestra#338), and i'm working upstream on support for parametrized opening of COG links in mapstore2 in geosolutions-it/MapStore2#9531

with this PR, i'm able to open links from GN4 in my dev MS2 instance, using the same url template for the external viewer.

the MD has the new COG format (i've chosen OGC:COG as it's a candidate to OGC standards cf https://portal.ogc.org/files/102116) among the other available link types:

image

in the XML i have this:

<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>

and the opened link has this queryparams:
?actions=[{"type":"CATALOG:ADD_LAYERS_FROM_CATALOGS","layers":["Vichy 3cm"],"sources":[{"type":"cog","url":"https%3A%2F%2Fcogeo.craig.fr%2Fopendata%2Fortho%2Forthocraig3_vichy_2021.cog.tif"}]}]

title is correctly set from the gmd:name value:

image

will ofc push the two commits upstream

@landryb
Copy link
Member Author

landryb commented Oct 9, 2023

geonetwork/core-geonetwork#7387 was merged upstream (squashed commit in geonetwork/core-geonetwork@123db88a0), so this one can be merged now i think ? @fvanderbiest ?

@fvanderbiest
Copy link
Member

fvanderbiest commented Oct 9, 2023

Thanks Landry !

M merged on 4.4, which will not be part of geOrchestra in the short term.
If you want this contribution to be available on the next major release, you'll have to port this to 4.2.6 after the upgrade.
I fear this PR is going nowhere if we merge it now.

@landryb
Copy link
Member Author

landryb commented Oct 9, 2023

Thanks Landry !

M merged on 4.4, which will not be part of geOrchestra in the short term. If you want this contribution to be available on the next major release, you'll have to port this to 4.2.6 after the upgrade. I fear this PR is going nowhere if we merge it now.

no problem i can rebase the PR (and #227 which was also merged upstream) on top of 4.2.6 once its been merged/rebased in georchestra/geonetwork.

@landryb landryb changed the base branch from georchestra-gn4.2.x to georchestra-gn4.2.x-rebase December 8, 2023 08:07
@landryb
Copy link
Member Author

landryb commented Dec 8, 2023

PR rebased on top of #260, has been already merged upstream but in the 4.4 branch

* add OGC:COG to possible values for gmd:protocol

* add support to open OGC:COG links in the external viewer

* show an alert saying COG/3DTiles is not supported yet

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

---------

Co-authored-by: Olivia <[email protected]>
@landryb
Copy link
Member Author

landryb commented Jan 16, 2024

rebased the PR to be just the upstream squashed commit (geonetwork/core-geonetwork@123db88a0) on top of georchestra-gn4.2.x-rebase - this also has the advantage to fix georchestra/georchestra#3956 because it includes the commit from @jahow that was still missing from this PR.

tested successfully on 4.2.2, clicking on a 3dtiles or cog link in a MD opens the layer in mapstore, and clicking back in the browser correctly comes back to the MD view.

@f-necas f-necas force-pushed the georchestra-gn4.2.x-rebase branch 3 times, most recently from 8af78f2 to 8765a1d Compare January 26, 2024 09:07
@f-necas f-necas deleted the branch georchestra:georchestra-gn4.2.x-rebase January 26, 2024 09:35
@f-necas f-necas closed this Jan 26, 2024
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.

3 participants