Closed bertday closed 1 year ago
Problem solved; I needed to pass the -spat
values in as individual arguments. Helpful find:
https://github.com/OSGeo/gdal/issues/1066
I'm sure this is just a child_process
thing, but I had a bear of a time with it. I'm wondering if maybe there could be an input-validation step before calling the shell command, maybe one that looks for spaces in arguments and spits out a warning to break them up? I'd be happy to do a PR if that sounds desirable.
Glad you figured it out. I don't think we want to assume arguments should be split up by space. We just pass them to the raw ogr2ogr command. Given the breathe of commands you can run with ogr2ogr, this library doesn't try to make many assumptions as to how it will be used.
Hello!
I'm trying to load in a GeoJSON file into a Postgres database, filtering by a bounding box with
-spat
(docs).Here is a minimal example:
That throws an error:
If I take the
cmd
fromogr2ogr
and run it by hand in the shell, it runs fine.Interestingly, in more complex examples I can sometimes get
-spat
to work depending on where it is in myoptions
array. It seems to work if it comes before-nlt
, but not after. I've tried quoting it and that didn't help.