GeoTIFF / GeoTIFF/georaster

Save as PNG

Open
#19 2 comments 0 reactions 0 assignees View on GitHub
good first issue
Dominant language
JavaScript
Stars
96
Forks
37
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**

Sometimes users might want to save their GeoRaster as a PNG file. For example, this would be useful for displaying results in Observable or Jupyter Notebooks.

**Describe the solution you'd like**

We should create a new function called savePNG that returns an (array)buffer for a PNG.

**Describe alternatives you've considered**

I've thought about creating a save method where you pass in the filename and the function auto-detects the file type from the extension of the filename. I don't think this would be a good idea, because we can't easily save files in the browser and I think this would make this package much more complicated. Perhaps, we can explore this after creating the function that creates the arraybuffer because I think this is a pre-requisite to saving a file, anyway.

**Additional context**

Should users have to manually create a data URI like those found at https://en.wikipedia.org/wiki/Data_URI_scheme or should we have a separate method savePNGDataURI. It might be more maintainable to force the users to construct their own data URIs, but I'm not sure what % of users will know how to do this.

Contributor guide

No contributing guide indexed for this repository

Research direction

No file, test, or entry point is named in the issue; start by locating the GeoRaster export or serialization code and its existing tests. Implement the requested savePNG behavior so it returns a PNG ArrayBuffer, and verify the expected output and whether data-URI creation remains the caller's responsibility.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.