georaster icon indicating copy to clipboard operation
georaster copied to clipboard

Metadata values are ignored when loading COG from URL

Open NoamRa opened this issue 2 years ago • 1 comments

Describe the bug When loading a COG from URL, metadata values are not used. This might be intentional, but there is nothing in the documentation indicate that that's the case.

To Reproduce Steps to reproduce the behavior:

  • Add break point in GeoRaster's constructor
  • Call parseGeoraster(https://path.to/cog.tiff, { projection: "example" })

Expected behavior Metadata is expected to be used. When parseGeoraster's input is an ArrayBuffer, it is used.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome
  • Version: 116

Additional context I see that there are other types of inputs where metadata is not passed as well.

NoamRa avatar Aug 28 '23 06:08 NoamRa

Hi, @NoamRa . I'm terribly sorry about the late reply. This is an important issue that you bring up and is certainly something that should be addressed. I'm a bit tight on time at the moment, so a solution might take some time. Would you be interested in submitting a PR?

Otherwise, I think an interim solution would be to over-ride the values after they are returned by parseGeoRaster, so that:

const georaster = await parseGeoraster(url);
georaster.projection = 3857; // or whatever projection

Also, are you needing to override the projection field with a standard EPSG code or a custom projection via PROJ4 String or WKT? I'm asking because if you are trying custom projections, I can prioritize adding custom projection support to the other family of libraries that work with georaster, as well.

Thank you.

DanielJDufour avatar Oct 15 '23 14:10 DanielJDufour