Skip to content
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

The program does not function properly #26

Closed
yippee2015 opened this issue Aug 18, 2017 · 6 comments
Closed

The program does not function properly #26

yippee2015 opened this issue Aug 18, 2017 · 6 comments

Comments

@yippee2015
Copy link

C:\Users\hhx\AppData\Roaming\npm\node_modules\ogr2ogr\examples>node geojson-obj.js

Error: Error: spawn ogr2ogr ENOENT
at ChildProcess. (C:\Users\hhx\AppData\Roaming\npm\node_modules\ogr2ogr\index.js:187:18)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:891:16)
at Socket. (internal/child_process.js:342:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:497:12)
undefined

@wavded
Copy link
Owner

wavded commented Aug 18, 2017

This means that you don't have gdal installed on your system or the ogr2ogr tool is not accessible in your PATH. See https://github.com/wavded/ogr2ogr#requirements

@yippee2015
Copy link
Author

Yes,you are right. I didn't install gdal.
After installing gdal, how to configure paths of ogr2ogr tool?
Thanks for your help! I'm looking forward to your reply.

@casperfibaek
Copy link

For windows, check step three of this tutorial: https://sandbox.idre.ucla.edu/sandbox/tutorials/installing-gdal-for-windows

@yippee2015
Copy link
Author

Hi @wavded @casperfibaek Thanks a lot. It helped.
I install OGRE project, ogr2ogr can work
But when I use the example node geojson-obj.js , I get
spawn ogr2ogr ENOENT Error. when i try to convert a file
I don't know what's wrong In the process,hopes your help

@wavded
Copy link
Owner

wavded commented Feb 14, 2020

Closing due to age, reopen if issue persists.

@wavded wavded closed this as completed Feb 14, 2020
@zachsa
Copy link
Contributor

zachsa commented Nov 3, 2020

I get the same error. If I fork the code, and follow the instructions at https://stackoverflow.com/a/27883443/3114742, Then the output is this:

[Arguments] {
  '0': '/usr/bin/docker run --rm osgeo/gdal:alpine-small-latest ogr2ogr',
  '1': [
    '-f',
    'GeoJSON',
    '/vsistdout/',
    '/tmp/catalogue-api/pJMXmL/HST_indicators_2007-2019.shp'
  ],
  '2': undefined
}

If I try using cp.exec instead of cp.spawn, I get the error FAILURE: no target datasource provided

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants