Comments (4)
I think its the GDAL version you have installed on Linux. SHZ support is a newer file type that GDAL added support for. Are you able to get a 3.x version of GDAL installed on Linux?
from ogr2ogr.
Yeah, that's kinda what I was afraid of. After spending the better part of the day trying to figure out how to get the 3.x version working, it seems that support for GDAL 3.x on Debian is not supported except for in their "unstable" Debian packages (see https://gdal.org/download.html#binaries) which would never fly at my client. They use the nodeJS Debian docker images as its build source so that isn't negotiable. I did try to see if I could use Anaconda or other ways to get GDAL injected into the docker image but it was getting pretty messy. I ultimately hacked around it by modifying the convertGeoJsonToShapeFile with:
async convertGeoJsonToShapeFile({ geometry }) {
const ogr2ogr = Ogr2ogr.default;
const { stream } = await ogr2ogr(geometry, {
format: 'ESRI Shapefile'
});
let buffer;
try {
// the normal way to process on a dev machine
buffer = await this.stream2Buffer(stream);
} catch (e) {
// docker ogr2ogr which is v2.1 doesn't save it as a file
// but rather as a directory, so zip the directory
const archive = archiver('zip');
archive.directory(stream.path, false);
archive.finalize();
buffer = await this.stream2Buffer(archive);
}
return buffer;
}
Perhaps this repo could support the 2.x output by evaluating the resulting stream fromres.stream = createReadStream(this.outputPath)
and if the length of the stream was zero, send it through the createZipStream() function instead?
from ogr2ogr.
This current version 3.x really is designed around GDAL 3 support in this case. I intentionally made the API as close to the ogr2ogr tool as possible in 3.x to avoid various issues we had in the past (so this lib's support is tied to ogr2ogr's support rather than trying to make special cases). The 2.x version should support your use case for now until you are able to upgrade.
You probably have already went through this in your mind but GDAL does have official docker containers that have the latest version and they document using the unstable
repo for their release on Debian platforms. Of course you can always build from source too.
https://gdal.org/download.html
from ogr2ogr.
Yeah, no prob. that makes sense. 99.9% that their corporate security wouldn't allow the unstable docker builds and there is a lot of other intermediate build steps that are required with their CI/CD stuff. I'll keep the code I have for now - like most projects, on to the next thing. Thanks! I'll close this issue.
from ogr2ogr.
Related Issues (20)
- PRODUCTION ERROR HOT 2
- stdout maxBuffer length exceeded. HOT 3
- /vsicurl/ can not be used with all kind of http or ftp resources HOT 4
- Convert files uploaded by user HOT 4
- Module not found: Error: Can't resolve 'fs' - installation HOT 3
- Currently can't provide custom args when specifying a custom command HOT 6
- How to write -update statement ? HOT 2
- how to use on angular project? HOT 2
- OGR_XLSX_HEADERS HOT 1
- precision? HOT 5
- geoJSON features order HOT 2
- Uncaught errors when opening a bad CSV file HOT 4
- Load CSV to Postgres very slow HOT 5
- change http method HOT 3
- ogr2ogr is not a function HOT 1
- How to export postegresql table to .shp using org2org? HOT 3
- More examples of how to write data HOT 6
- Unexpected behavior with double quotes in PG connection string HOT 2
- Unknown option name '-spat' HOT 2
- Result.cmd is missing a space between command and args
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 ogr2ogr.