Skip to main content

All Questions

Tagged with
1 vote
1 answer
60 views

How to use ogr2ogr -segmentize on a CSV file?

Here each line only has two nodes. $ cat file.csv WKT,ID,Name "LINESTRING (-900 -1450,-900 100)",0,900W "LINESTRING (-800 -1450,-800 100)",1,800W How can I use ogr2ogr -segmentize ...
Dan Jacobson's user avatar
4 votes
1 answer
204 views

How can I use ogr2ogr to left join a CSV to a GPKG file and produce a GeoJSON output in a scalable way?

I have a large GPKG and a CSV file, and I'd like to (left) join the CSV to the GPKG on one of the columns. A visualisation of what I'm trying to achieve: Reproducible example We can create an example ...
zabop's user avatar
  • 2,224
2 votes
3 answers
259 views

Integer field of CSV file always output as String when processed with ogr2ogr

I have a file places.csv with the following contents: name,lat,lon,type,population Aalfang,48.8393882,15.0675236,village,410 Abern,48.0556773,13.1533381,village,203 Abersee,47.7266536,13.4169871,...
Florian Ledermann's user avatar
1 vote
0 answers
62 views

Unreadable text when converting .SHP to .CSV

I am trying to convert .SHP file to .CSV using ogr2ogr in QGIS and I also have all the associated files related to the .SHP files. The text in the .SHP file is in Ukrainian and after the conversion, ...
user227880's user avatar
4 votes
1 answer
203 views

Failing reprojecting from EPSG 4326 to EPSG 3857

I am trying to reproject a CSV file from EPSG:4326 (WGS84 lat/long points) to EPSG:3857 (Web Mercator in meters). Here is my command: ogr2ogr -f CSV -overwrite -s_srs EPSG:4326 -t_srs EPSG:3857 Output....
darrepac's user avatar
1 vote
1 answer
464 views

Making ogr2ogr convert from CSV to SpatiaLite while keeping capital letters on the header

Let's say I have the following input.csv file: Column1,Column2,latitude,longitude testData,TestData,-23.547384,-46.643363 testData,TestData,-23.555297,-46.635642 I know I can convert it from CSV to ...
raylight's user avatar
  • 1,163
0 votes
0 answers
417 views

ogr2ogr to CSV with quotes breaks with NULL values

I have some data stored in a Postgres 13 Postgis 3.1 table that looks like id(integer),valid_to(timestamp),language(varchar),name(varchar) 1,2021/08/16 11:19:06.493,eng,London 2,2021/08/16 11:19:06....
tjmgis's user avatar
  • 3,330
1 vote
0 answers
208 views

ogr2ogr: casting field to string

I am attempting a simple data extraction from an Oracle database to a CSV file using ogr2ogr.exe (the version packaged with QGIS 3.8 i.e. ..QGIS_3.8\bin\ogr2ogr.exe ) I have a field ("Mapsheet&...
grego's user avatar
  • 1,063
1 vote
1 answer
186 views

Return all results from join of non-spatial CSV to spatial data using ogr2ogr and SQLite dialect

I am attempting to carry out a simple join of a non-spatial CSV to a GeoJSON data source using ogr2ogr an its built-in SQL capabilities. I would like to use the SQLite dialect to carry out the join. ...
maptastik's user avatar
  • 389
4 votes
1 answer
284 views

Join non-spatial CSV to GeoJSON data source using ogr2ogr and SQLite dialect

I am attempting to do a simple join of a non-spatial CSV file to a GeoJSON data source using the built-in SQL capabilities in ogr2ogr. I have successfully managed to do this using the OGR SQL dialect ...
maptastik's user avatar
  • 389
2 votes
1 answer
596 views

Join a CSV file to GeoJSON using ogr2ogr in a Python script?

I have a CSV which I would like to join to a GeoJSON. I found this answer which I tried to implement but I can't get it to work just yet. Here's an extract of my python: join_command = ['ogr2ogr', '...
MattEnvSys's user avatar
3 votes
1 answer
450 views

dbf to shp within BASH (ogr2ogr would be ideal)

I have a CSV with many points and attributes that I'm trying to convert into a shapefile but I'm having no luck. I have installed gdal-bin and can use my terminal environment to create a shapefile ...
Pictory's user avatar
  • 194
2 votes
1 answer
503 views

Joining CSV file to Shp file using ogr2ogr and python?

I am having problems with the code below i.e. parsing the SQL string in python. I keep getting an error. I am joining a CSV file called lookup_scales.csv to a shp file called RC_CATALOGUE_GRANTED. I ...
daveb's user avatar
  • 139
3 votes
1 answer
693 views

ogr2ogr: Create CSV with strings wrapped in double quotes

Is there a way to force ogr2ogr to wrap string-column values with double-quotes? I have a column with string values like "000010001", which OGR correctly interprets as a string when writing to CSV. ...
rgwozdz's user avatar
  • 807
4 votes
1 answer
6k views

Bulk csv to shapefile (using ogr2ogr)

Is bulk conversion from csv to shapefile possible with ogr2ogr? I can do it file by file when I first create dbf file, then using vrt file I create shapefile. But using command for /R %f in (*.csv) ...
Maicen19's user avatar
  • 103

15 30 50 per page