[Proj] cs2cs additional fields beyond coords passed thru

Frank Warmerdam warmerdam at pobox.com
Thu Apr 24 12:41:21 EDT 2008


Mark Wimer wrote:
> 
> Hi all,
> 
> I am new to using cs2cs, and the documentation says that info to the 
> right of the coordinates get sent to output. It specifies this is true 
> for ASCII files.
> 
> I was able to pass a unique ID through after some trial and error, 
> although it turns an integer into a decimal numeric type (adds ".00"). 
>  But if I pass anything with text or any more than one field, it does 
> not get through: it is ignored.
> 
> Is this expected behavior?
> 
> Input data  file looks like this, with long, lat, and site ID:
> 
> (mdtext.txt is the file)
> -120.34553 78.01231 2121123 a
> -120.44543 78.02231 2121124 b
> -120.48698 78.03321 2121125 c
> -120.88343 78.09982 2121126 d
> 
> Command is this:
> cs2cs +proj=longlat +ellps=GRS80 +datum=NAD83 +to
>  +proj=utm +zone=18 +datum=NAD83  mdtext.txt >mdout.txt
> 
> output file mdout.txt looks like this, regardless of what I put after my 
> long/lat:
> 
> -452007.16        9050449.38 2121123.00
> -452875.00        9052899.16 2121124.00
> -452697.75        9054457.33 2121125.00
> -453914.52        9066316.58 2121126.00

Mark,

I suspect the comment about passing through extra text was carried into
the cs2cs docs from the proj command docs but that it isn't true.  The
third value is being treated as "Z" which is why it is processed and
reformatted.

I would suggest you file a doc ticket on this issue, but since we don't have
a bug database currently, I'll just go ahead and try to fix the docs.

If you are just doing the above transformation, you should be able to get
the passthrough you want with the proj command.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org



More information about the Proj mailing list