ogr2ogr is amazing, and it can convert datasets from pretty much any format into pretty much any other format. This is ideal for allowing conversion from ESRI feature services.
If possible, to reduce memory usage and for simplicity's sake, it would be best to write directly to a GDALDataset instance of some kind for each feature, then convert to a different format if specified. Its likely that the GDALDataset will likely live in memory for the time being. Emscripten is actively working on implementing (https://github.com/emscripten-core/emscripten/issues/15041) a new WasmFS filesystem.
The good news is that there are already ports of gdal into the browser via webassembly, which is half the battle of getting this to work. Here's some background research:
I've attempted to use @bugra9's library gdal3.js to get this to work, and gotten it to work with some success. However, this required 2 files, one for the original format (geojson) and another for the converted file. It would be better if a single file was all that was required. Additionally, I've had og2ogr conversion hang forever with larger files.
@azavea's loam look very good as well, particularly for its support of Blob inputs. However it is only compiled for raster formats, and that's pretty much a non-starter for this application.
ogr2ogr is amazing, and it can convert datasets from pretty much any format into pretty much any other format. This is ideal for allowing conversion from ESRI feature services.
If possible, to reduce memory usage and for simplicity's sake, it would be best to write directly to a GDALDataset instance of some kind for each feature, then convert to a different format if specified. Its likely that the GDALDataset will likely live in memory for the time being. Emscripten is actively working on implementing (https://github.com/emscripten-core/emscripten/issues/15041) a new WasmFS filesystem.
The good news is that there are already ports of gdal into the browser via webassembly, which is half the battle of getting this to work. Here's some background research:
Blob
inputs. However it is only compiled for raster formats, and that's pretty much a non-starter for this application.