2

I'm reading a book where it says to run the following in the commandline, I think he used Linux. Therefore the command doesn't run in Windows Powershell

cs2cs +proj=latlong +datum=NAD83 +to +proj=utm +zone=10 +datum=NAD27 -r <<EOF
45d15’33.1" 111.5W
45d15.551666667N -111d30
+45.25919444444 111d30’000w
EOF

enter image description here

When ran, Powershell says

The '<' operator is reserved for future use. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : MissingFileSpecification

enter image description here

How do I run the command in Powershell?

1 Answer 1

5

Use a here-string and pipe "|" to cs2cs (note you must have a new line immediately after the opening @" and before the closing "@)

echo @"
45d15'33.1" 111.5W
45d15.551666667N -111d30
+45.25919444444 111d30'000w
"@ | cs2cs +proj=latlong +datum=NAD83 +to +proj=utm +zone=10 +datum=NAD27 -r

Or add the coordinates to a file (e.g coords.txt) and pass that as an argument

cs2cs +proj=latlong +datum=NAD83 +to +proj=utm +zone=10 +datum=NAD27 -r coords.txt
1
  • It worked. Now I understand the syntax.
    – BallpenMan
    Commented Nov 13, 2021 at 9:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.