Skip to main content
100%

Reprojecting CSV with ogr2ogr

✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Jul 10, 2014

This example demonstrates how to convert a CSV file containing projected coordinates (EPSG:2263) into unprojected longitude and latitude values (EPSG:4326). The conversion relies on a virtual dataset defined in a VRT file, which specifies the source CSV, its geometry type, and the source coordinate system. The command-line utility `ogr2ogr` from the GDAL library performs the reprojection, outputting a new CSV with the transformed coordinates. The VRT uses the `PointFromColumns` geometry encoding to interpret the X and Y columns as spatial points.

AI-generated description
rm -f output.csv
ogr2ogr -f CSV -t_srs EPSG:4326 -lco GEOMETRY=AS_XY -nln output output.csv input.vrt
gpl-3.0 Licensed

Similar vizzes