[GRASS-user] Projection Confusion

   It took a while today for me to figure out where I went off the rails
importing a text file in Lat/Lon coordinates to Nevada East State Plane
Coordinate System, NAD 83, US Survey Feet (epsg:3421) using cs2cs. Still,
I've become confused because of the apparent switch in projection coordinate
sequence. Let me explain.

   The script file begins like this:

cs2cs -r +proj=latlong +datum=NAD83 +to +init=epsg:3421 <<EOF
+41.42188333 -115.99418333

with the latitude first and the longitude second. What continues to throw me
is that the output apparently has the longitude (easting) first and the
latitude (northing) second:

543495.65 28676372.70

   I confirmed this by using a Web page that does the conversions:

Latitude 41.42188333
Longitude 115.99418333

Calculated Values - based on Degrees Lat Long to seven decimal places.
Position Type Lat Lon
Degrees Lat Long 41.4218833°, -115.9941833°
Degrees Minutes 41°25.31300', -115°59.65100'
Degrees Minutes Seconds 41°25'18.7800", -115°59'39.0600"
State Plane X Y (Meters) 2701 165657.806mE 8740575.881mN
X Y (US Survey Feet) 2701 543495.651ftUSE 28676372.703ftUSN
X Y (International Feet) 2701 543496.738ftE 28676430.056ftN

   Why this change in coordinate order?

Rich

Rich wrote:

It took a while today for me
to figure out where I went off the rails
importing a text file in Lat/Lon coordinates to Nevada East
State Plane Coordinate System, NAD 83, US Survey Feet
(epsg:3421) using cs2cs. Still, I've become confused because
of the apparent switch in projection coordinate
sequence. Let me explain.

The script file begins like this:

cs2cs -r +proj=latlong +datum=NAD83 +to +init=epsg:3421
<<EOF
+41.42188333 -115.99418333

with the latitude first and the longitude second.

n.b. lat,lon is y,x; note also the use of the +proj=latlong
alias instead of the true +proj=longlat setting, that doesn't
change the order but can help you see what's being done clearer;
and finally if you look at the option description in the cs2cs
man page -r only swaps the expected input order.

What continues to throw me is that the output apparently has
the longitude (easting) first and the latitude (northing)
second:

543495.65 28676372.70

(x,y)

Why this change in coordinate order?

it's working as designed. If you want to reverse the order of
the output for some reason you need to use cs2cs's -s flag too.

Hamish

On Fri, 15 Jun 2012, Hamish wrote:

n.b. lat,lon is y,x; note also the use of the +proj=latlong
alias instead of the true +proj=longlat setting,

Hamish,

   Ah, I hadn't noticed this when I first used the cs2cs script. I'll make
that change.

... and finally if you look at the option description in the cs2cs man
page -r only swaps the expected input order.

   I completely forgot about this. It's been many months since I last used
the tool and I just replaced coordinate sets for the current need.

Thanks,

Rich