Monday 18 November 2019

qgis - Using proj to convert EPSG:2263 to WGS84


I have input data in EPSG:2263 with X and Y coordinates such as:


X,Y
987043,206407
982441,212359
990907,209020


(these locations are within NYC).


I need to convert these to WGS84. Using QGIS if I import these coordinates and tell it the input data is in "EPSG:2263, NAD83 / New York Long Island (ftUS)" successfully imports the coordinates and renders them correctly (e.g. if overlaid over a WGS84 map).


It gives me this as the conversion options:


+proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +lat_0=40.16666666666666  +lon_0=-74 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs

However, if I try to manually convert a point on the command line, for example:


cs2cs +proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs -f '%.8f'
987043,206407
-73.99000712 40.16666623 0.00000000,206407


The resulting point is obviously not correct and (if shown on Google Earth) is off the coast of New Jersey.


I'll admit projections and coordinate systems and converting between them does still quite baffle me...


Suggestions for how I should be adjusting those cs2cs options to get a correct conversion?



Answer



The correct syntax is:


cs2cs +proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +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 +to +init=epsg:4326 -f %%.8fout.txt

with


987043 206407


in the input file nad.txt to get this output:


-73.98992216    40.73321572 0.00000000

Note that input values have to be delimited by blanks, not commas.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...