Questions tagged [ogr2ogr]

ogr2ogr is used to convert simple features data between file formats performing various operations during the process such as spatial or attribute selections, reducing the set of attributes, setting the output coordinate system or even reprojecting the features during translation.

97 questions
0
votes
2 answers

The problem with Java Runtime Exec on Docker Container

I am trying to dockerize a Java application with GDAL package (for ogr2ogr command). My Dockerfile is: FROM openjdk:10 ARG JAR_FILE=target/*.jar COPY ${JAR_FILE} app.jar RUN apt-get update RUN apt-get -y install python3-gdal RUN apt-get -y install…
Oğuzcan Budumlu
  • 511
  • 1
  • 4
  • 11
0
votes
0 answers

Pythons subprocess check_call doesn't give the same result as the same command executed in the command line

I am using an anaconda environment both for the python code and the terminal. When I want to execute a program in the shell (Windows CMD) with the environment activated. The program ogr2ogr returns the correct output with the given parameter. The…
Sebastian H
  • 111
  • 3
0
votes
1 answer

Using npm module (ogr2ogr) in lambda function returns no results

I'm trying to use the ogr2gr module in a lambda function but I'm having some issues with it, so I wanted to see if anyone tried to use the module in a lambda function? The way I am using the ogr2ogr module is by doing .promise(). However when I try…
fairlyMinty
  • 413
  • 8
  • 22
0
votes
1 answer

how to iterate through 2 sets of of FOR in a batch file for ogr2ogr

I am fairly new to using batch files asides from the basics. I am trying to see if it is possible to run through 2 different loops at the same time to get my exports in ogr2ogr (postresql to geopackage, geojson etc). I have no issues figuring out 1…
Will C.
  • 41
  • 6
0
votes
1 answer

Why is ogr2ogr trying to open the app it's being run from?

I'm trying to write some script using the ogr2ogr function in python: convertstring = 'ogr2ogr -f r"GeoJSON" r"Output.GeoJson" -select * -where "layer = building" r"' + filepath+'"' os.system(convertstring) but I keep getting this error: FAILURE: …
0
votes
1 answer

ogr2ogr incorrectly formating geometry column values

On Windows, I'm trying to load in a shapefile (found here) to PostGIS in order to be able to do geospatial queries. Using the following ogr2ogr command: set PGCLIENTENCODING=LATIN1 ogr2ogr -f "PostgreSQL" PG:"dbname=my_database user=docker…
sshirley
  • 239
  • 2
  • 6
  • 19
0
votes
1 answer

Is it possible to prevent ogr2ogr from generating a shapefile if no records are returned from the given intersection?

I am generating shapefiles from a geodatabase file with ogr2ogr via the spatialite dialect using the following command: ogr2ogr -f "ESRI Shapefile" ./clipped.shp -dialect sqlite -sql "SELECT * FROM table_name WHERE ST_Intersects(SHAPE,…
L.Youl
  • 361
  • 3
  • 9
0
votes
0 answers

How to load ogr2ogr?

I installed ogr2ogr by using npm i ogr2ogr, but when I try to call ogr2ogr from TypeScript, I am getting this error. Can anyone explain how to load ogr2ogr in TypeScript? ERROR in ./node_modules/fs-constants/browser.js Module not found: Error: Can't…
Ram .V
  • 39
  • 4
0
votes
1 answer

envsubst with ogr2ogr external .sql file

I’m trying to combine the envsubst command with an external sql file passed as an option to ogr2ogr, but can't quite get it work. export STOP_NAME=Park; ogr2ogr \ -f geojson \ /vsistdout/ \ stops.csv \ -dialect sqlite \ -sql envsubst <…
m.brocks
  • 43
  • 5
0
votes
1 answer

after gdal installation, 'ogr2ogr/ogrinfo/gdalinfo' is not recognized as an internal or external command, operable program, or batch file

I installed Homebrew and used it to install GDAL from within Ubuntu. After the installation finished, I'm still running into the following error: "'ogr2ogr/ogrinfo/gdalinfo' is not recognized as an internal or external command, operable program, or…
amb
  • 27
  • 6
0
votes
0 answers

ogr2ogr error: "Unable to initialize connection to the server ...."

I am getting the error detailed in the screenshot below when running ogr2ogr. The command used worked on my other computer. I am wondering if this is an error that is triggering because I do not have proper permissions. One last detail: the…
DIDS_421
  • 35
  • 5
0
votes
1 answer

ODBC string connect to specific table

I'm connecting to a SQL Server spatial database by using ogr2ogr with the MSSQL driver. C:\>ogr2ogr -f "GeoJSON" C:\Users\usr_m\Documents\shape_odbc.geojson "MSSQL:Driver=SQL Server;server=hksql;database=ql51pd;trusted_Connection=yes;" as…
MichaelR
  • 152
  • 8
0
votes
1 answer

CLI script with python with variable including special character

I am trying to run a CLI script with python but I am running into issues due to special characters. So if I run this harcoded it work just fine. Writing the "Innjsø" layer to database named as "innsjo" for the table name. ogr2ogr -f "PostgreSQL"…
geogrow
  • 485
  • 2
  • 9
  • 26
0
votes
1 answer

Viewing errors on ogr2ogr - python subprocess check_output returned non-zero exit status 1

I am getting this error on running a subprocess.check_call that runs an ogr2ogr command. I have put on error trapping but can't see the error details and the cmd window closes without me being able to see the problem. How can I trace the…
GeorgeC
  • 956
  • 5
  • 16
  • 40
0
votes
0 answers

Using ogr2ogr in a web page

Is it possible to use ogr2ogr to merge shapefiles within a html page ? I would like to make a website page that allows me to search a computers directory to select two shapefiles then use ogr2ogr to merge the shapefiles and return that merged…
user10952102