Comments (3)
Good question! The answer is "kind of". vsis3
support requires libcurl
to be compiled into the bundle, and currently that is not done, so you can't run loam.open('/vsis3/bucket_name/path/to/cog.tif)
as things stand.
Emscripten provides a lazy file wrapper that can be used to wrap a remote file, and I've tested it out and it issues ranged reads as you would hope. However, it reads in fixed 1MB chunks, so there's a lot of efficiency lost because 1MB is rarely the ideal size for reading in the appropriate parts of the COG, so it either makes too many requests, or needlessly loads extra data. For that reason, I haven't added support for remote files directly to Loam, but it should be an easy change if it would be useful for someone.
The other two options for accomplishing this are
- Compile in
libcurl
support. This would increase the size of the downloaded WebAssembly. I don't know by how much, but as it's already 2.2MB compressed, I would prefer not to take this route. It would also make the build process quite a bit more complex, and I'm not totally certain thatlibcurl
would function properly from WebAssembly, so there is some potential risk here. - Make a PR to GDAL so that it can use Emscripten's fetch API as an alternative to
libcurl
when being compiled byemcc
. This is my preferred option because it should limit bundle size and provide the smoothest integration betweengdal.js
and the browser's built-in HTTP request capabilities.
Can you tell me more about your use case? This is a high-priority feature for me because lots of people are asking for it, but as you can see, the preferred solution is quite a bit of a lift, so I'm happy to help brainstorm workarounds. Alternatively, if you have the expertise necessary to implement any of these solutions I would be very happy to review a PR!
from loam.
My use case is the standard "view a COG and metadata in the browser" use case that's handled by geotiff.js
, but wasn't sure if this was something gdal.js
was able to replace yet.
Your solution #2 sounds like the way to go, but unfortunately I don't have the technical ability to be any help implementing it.
from loam.
Okay, thanks! I will add this to the stack of requests for this feature. 🙂 The good news is that I'm close to finishing up the current set of features I'm working on, which mostly relate to developer experience, and this will be my next focus. It's not necessarily going to happen quickly, but I am planning to start working on this soon.
from loam.
Related Issues (20)
- Add OGR wrappers
- Gcps to point work for external positioning but not internal when warping/ transforming HOT 2
- Switch to `try` / `finally` for wrapper cleanup
- Error in GDALOpen HOT 4
- Unable to use Loam in React HOT 16
- How to install loam without react HOT 1
- Asset locations HOT 1
- Production builds don't utilize loam-worker.min.js
- Add `prepare` script that builds the library
- Further bundling cleanup
- Does this library support GDALGetRasterStatistics exposed in gdal-js ? HOT 5
- Support opening vector datasets with GDALOpenEx HOT 13
- SyntaxError: Unexpected token '<' HOT 4
- Packaging not including minified files correctly HOT 1
- loam.initialize throws Invalid base URL exception HOT 4
- GDALDataset.bytes() is not documented HOT 3
- Convert (gdal_translate) to mbtiles HOT 2
- How to rotate image? HOT 4
- Loam cannot be run under Node.js HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from loam.