-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to export postegresql table to .shp using org2org? #92
Labels
Comments
It looks like you aren't awaiting the promise. You probably want to catch any errors as well. const ogr2ogr = require('ogr2ogr').default;
(async() {
try {
let shapefile = await ogr2ogr(
'PG:dbname=postgres host=localhost port=5432 user=postgres password=xxx', {
format: 'ESRI Shapefile',
options: ['-sql', 'SELECT * FROM ViewTest'],
project: 'ESPG:4326',
destination: 'C:\Users\Danielle\output.shp'
});
console.log("shapefile", shapefile);
} catch (err) {
console.error("error", err);
}
})() See https://github.com/wavded/ogr2ogr#usage for more examples. |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
This issue was closed because it has been stalled for 5 days with no activity. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I'm trying to export a postgresql database view to shapefile using org2org but I'm not succeeding.
I did the following:
`const ogr2ogr = require('ogr2ogr').default;
var shapefile = ogr2ogr('PG:dbname=postgres host=localhost port=5432 user=postgres password=xxx',
{
format: 'ESRI Shapefile',
options: ['-sql', 'SELECT * FROM ViewTest'],
project: 'ESPG:4326',
destination: 'C:\Users\Danielle\output.shp'
});
console.log(shapefile);`
Can you help me?
The text was updated successfully, but these errors were encountered: