New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cct: Forward non-coordinate input to output #918
Comments
I think proj and cs2cs just appends the input record to the output. And, besides being the easiest to implement, I also think it in most cases will be the most useful. Editing the input record, replacing input coordinate by output coordinate is tedious, and gets even more complicated in cases where -t and/or -z options are used, so one or two coordinates are missing from the input record. @kbevers: If you agree, I will submit a PR implementing this. |
I agree 👍 |
How difficult would it be to implement a solution where all non-coordinate columns are appended at the end of the output? Let's say for input like
you would get a the following back
I am not sure it is preferable as the default behaviour but maybe if controlled by switch it can be useful in some cases. |
Probably not terribly difficult, but I am a bit reluctant at building too much of AWK into cct. Better include everything, and let the user pipe output through an awk one-liner to remove the unneeded. |
Any text written after the coordinate input will automatically be forwarded to the output stream. Text in columns before the coordinate input is discarded in the output. This works for any combination of -c, -t and -z parameters: $ echo 12 56 100 2018.0 comment comment | cct +proj=merc 1335833.8895 7522963.2411 100.0000 2018.0000 comment commen $ echo text 12 56 100 2018.0 comment | cct -c 2,3,4,5 +proj=merc 1335833.8895 7522963.2411 100.0000 2018.0000 comment $ echo text 12 56 comment | cct -c 2,3 -t0 -z0 +proj=merc 1335833.8895 7522963.2411 0.0000 0.0000 comment $ echo 12 56 comment | cct -t0 -z0 +proj=merc 1335833.8895 7522963.2411 0.0000 0.0000 comment Closes OSGeo#918
Any text written after the coordinate input will automatically be forwarded to the output stream. Text in columns before the coordinate input is discarded in the output. This works for any combination of -c, -t and -z parameters: $ echo 12 56 100 2018.0 comment comment | cct +proj=merc 1335833.8895 7522963.2411 100.0000 2018.0000 comment commen $ echo text 12 56 100 2018.0 comment | cct -c 2,3,4,5 +proj=merc 1335833.8895 7522963.2411 100.0000 2018.0000 comment $ echo text 12 56 comment | cct -c 2,3 -t0 -z0 +proj=merc 1335833.8895 7522963.2411 0.0000 0.0000 comment $ echo 12 56 comment | cct -t0 -z0 +proj=merc 1335833.8895 7522963.2411 0.0000 0.0000 comment Closes OSGeo#918
Any text written after the coordinate input will automatically be forwarded to the output stream. Text in columns before the coordinate input is discarded in the output. This works for any combination of -c, -t and -z parameters: $ echo 12 56 100 2018.0 comment comment | cct +proj=merc 1335833.8895 7522963.2411 100.0000 2018.0000 comment commen $ echo text 12 56 100 2018.0 comment | cct -c 2,3,4,5 +proj=merc 1335833.8895 7522963.2411 100.0000 2018.0000 comment $ echo text 12 56 comment | cct -c 2,3 -t0 -z0 +proj=merc 1335833.8895 7522963.2411 0.0000 0.0000 comment $ echo 12 56 comment | cct -t0 -z0 +proj=merc 1335833.8895 7522963.2411 0.0000 0.0000 comment Closes OSGeo#918
Any text written after the coordinate input will automatically be forwarded to the output stream. Text in columns before the coordinate input is discarded in the output. This works for any combination of -c, -t and -z parameters: $ echo 12 56 100 2018.0 comment comment | cct +proj=merc 1335833.8895 7522963.2411 100.0000 2018.0000 comment commen $ echo text 12 56 100 2018.0 comment | cct -c 2,3,4,5 +proj=merc 1335833.8895 7522963.2411 100.0000 2018.0000 comment $ echo text 12 56 comment | cct -c 2,3 -t0 -z0 +proj=merc 1335833.8895 7522963.2411 0.0000 0.0000 comment $ echo 12 56 comment | cct -t0 -z0 +proj=merc 1335833.8895 7522963.2411 0.0000 0.0000 comment Closes OSGeo#918
Any text written after the coordinate input will automatically be forwarded to the output stream. Text in columns before the coordinate input is discarded in the output. This works for any combination of -c, -t and -z parameters: $ echo 12 56 100 2018.0 comment comment | cct +proj=merc 1335833.8895 7522963.2411 100.0000 2018.0000 comment commen $ echo text 12 56 100 2018.0 comment | cct -c 2,3,4,5 +proj=merc 1335833.8895 7522963.2411 100.0000 2018.0000 comment $ echo text 12 56 comment | cct -c 2,3 -t0 -z0 +proj=merc 1335833.8895 7522963.2411 0.0000 0.0000 comment $ echo 12 56 comment | cct -t0 -z0 +proj=merc 1335833.8895 7522963.2411 0.0000 0.0000 comment Closes OSGeo#918
Any text written after the coordinate input will automatically be forwarded to the output stream. Text in columns before the coordinate input is discarded in the output. This works for any combination of -c, -t and -z parameters: $ echo 12 56 100 2018.0 comment comment | cct +proj=merc 1335833.8895 7522963.2411 100.0000 2018.0000 comment commen $ echo text 12 56 100 2018.0 comment | cct -c 2,3,4,5 +proj=merc 1335833.8895 7522963.2411 100.0000 2018.0000 comment $ echo text 12 56 comment | cct -c 2,3 -t0 -z0 +proj=merc 1335833.8895 7522963.2411 0.0000 0.0000 comment $ echo 12 56 comment | cct -t0 -z0 +proj=merc 1335833.8895 7522963.2411 0.0000 0.0000 comment Closes OSGeo#918
Say I have a file with the following content:
I can use that in a transformation with cct by specifying which columns the data is located in with
The ouput will then be something like:
Here it would be useful to also have the data from the non-coordinate columns, similar to what proj and cs2cs does. This can be done in a number of ways, for instance the data can be output in the same column order as the input or the coordinates could be printed first with the non-coordinate columns printed after the coordinates.
The text was updated successfully, but these errors were encountered: