-
Notifications
You must be signed in to change notification settings - Fork 409
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
support loading COG layers from query params #9527
Comments
after more digging.. |
@landryb URLhttp://localhost:8081/#/viewer/new?actions=[{%22type%22:%22CATALOG:ADD_LAYERS_FROM_CATALOGS%22,%22layers%22:[%22%22],%22sources%22:[{%22type%22:%22cog%22,%20%22records%22:[{%22title%22:%20%22orthocraig3_vichy_2021.cog%22,%20%22url%22:%22https://cogeo.craig.fr/opendata/ortho/orthocraig3_vichy_2021.cog.tif%22}]}]}]It needs some update on catalog epic too. But if you like to try it locally, you can modify this line to something like this |
thanks, with that tweak and that url it 'works' (but wont zoom on the layer nor allow zoom to layer) i see where this is going, but it feels wrong to have to construct a specific url for cog format while we should be able to use the same pattern as for other catalog types.. ofc, the goal is to have a generic API to be able to build the URL from client code (in my case, from geonetwork) without specific cases. wouldn't it be possible to rework COG.js catalog type to be 'like' the others and have records array directly populated with the single entry that is available, constructed from url & title ? Unless there are plans to support multiple layers in a tiff but i doubt that's a usecase... and loading a COG directly from queryparams, to me we want to directly zoom on it so |
tried with this to have a default layer entry created on the fly (because
but that crashes when geotiff tries to load it:
|
@landryb Try setting if (!_layers.length) {
_layers = [{
title: text,
type: COG_LAYER_TYPE,
sources: [{url: _url}]
}];
} |
so it works with that suggestion, but isnt satisfying since it wont allow to zoom to layer. my idea then is to move the metadata/crs/bbox fetching to a separate function, and reuse that... but sadly my wip branch doesnt work yet. I'm probably doing something wrong with promises since sometimes _layers is defined and sometimes it's pending |
on this, eslint will complain (rightfully?) that one isnt supposed to assign to a function parameter, per https://github.com/geosolutions-it/MapStore2/actions/runs/6379936002/job/17313379000 |
* COG services only have a single layer, use provided layer text as title (#9527) * create COG layer on the fly if none is provided (#9527) * use properly named parameters for getLayerConfig call * return layer in case getLayerConfig failed * add documentation about loading COG layer via viewer parameters (#9531) * Update docs/developer-guide/map-query-parameters.md --------- Co-authored-by: Suren <[email protected]>
* COG services only have a single layer, use provided layer text as title (geosolutions-it#9527) * create COG layer on the fly if none is provided (geosolutions-it#9527) * use properly named parameters for getLayerConfig call * return layer in case getLayerConfig failed * add documentation about loading COG layer via viewer parameters (geosolutions-it#9531) * Update docs/developer-guide/map-query-parameters.md --------- Co-authored-by: Suren <[email protected]> (cherry picked from commit 6b4d662)
* COG services only have a single layer, use provided layer text as title (#9527) * create COG layer on the fly if none is provided (#9527) * use properly named parameters for getLayerConfig call * return layer in case getLayerConfig failed * add documentation about loading COG layer via viewer parameters (#9531) * Update docs/developer-guide/map-query-parameters.md --------- Co-authored-by: Suren <[email protected]> (cherry picked from commit 6b4d662) Co-authored-by: Landry Breuil <[email protected]>
Description
now that we have COG support since #9320 im looking at how to implement support for loading such data type from the url params eg http://localhost:8081/#/viewer/new?actions=[{%22type%22:%22CATALOG:ADD_LAYERS_FROM_CATALOGS%22,%22layers%22:[%22title%22],%22sources%22:[{%22type%22:%22cog%22,%22url%22:%22https%3A%2F%2Fcogeo.craig.fr%2Fopendata%2Fortho%2Forthocraig3_vichy_2021.cog.tif%22}]}]
for now i only changed one thing so that the layer title is not looked for in the catalog records like its done for 3dtiles (#9021) & geojson (#9276):
but no layer is loaded. From my digging in the browser debugger, i understand that's because
service.records
is empty in https://github.com/geosolutions-it/MapStore2/blob/master/web/client/api/catalog/COG.js#L65, probably becausesearchAndPaginate
hasnt been called yet, and that method will return no records anyway sincelayers
is an empty array ? so ... does it make sense to have asearchAndPaginate
method in a COG catalog type ? afaict this method isnt present forgeojson
and3dtiles
formats... @dsuren1, any idea ?The text was updated successfully, but these errors were encountered: