Skip to content

Instantly share code, notes, and snippets.

@jsoma
Created December 23, 2014 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsoma/83d8e94fb0ddef7b8f3e to your computer and use it in GitHub Desktop.
Save jsoma/83d8e94fb0ddef7b8f3e to your computer and use it in GitHub Desktop.
Converts stop-and-frisk data from New York State Plane to lat/lng. Make a vrt for every csv and run `ogr2ogr` on them - be sure to make backups, it deletes the original csv for god knows what reason.
<OGRVRTDataSource>
<OGRVRTLayer name="2012">
<SrcDataSource>2012.csv</SrcDataSource>
<GeometryType>wkbPoint</GeometryType>
<LayerSRS>+proj=lcc +lat_1=40.66666666666666 +lat_2=41.03333333333333 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs</LayerSRS>
<GeometryField encoding="PointFromColumns" x="xcoord" y="ycoord"/>
</OGRVRTLayer>
</OGRVRTDataSource>
ogr2ogr -f CSV -t_srs EPSG:4326 -lco GEOMETRY=AS_YX -overwrite output-2013-1.csv 2012.vrt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment