[Proj] cs2cs produces partial output when called from matlab

Charles Karney charles.karney at sri.com
Wed Nov 5 04:05:37 PST 2014


This works OK for me (Matlab 2013a on Linux).  Perhaps make sure that
1.tmp really has only the 1 number in it and doesn't contains carriage
returns that cause later numbers to overwrite earlier ones.  Failing
that, switch to Octave!

On 11/05/2014 04:47 AM, Shimi Chen wrote:
> Hello,
>
> I realize that MATLAB is proprietary software and thus not very
> reproducible.
> However I would appreciate if someone could think if he has an idea why
> this could happen.
> I will explain the issue with a simple example.
> I made a file 0.tmp with the contents:
>
> 35.049 31.728
>
>
> Running this command:
>
> cs2cs +init=epsg:4326 +to +init=epsg:2039  <0.tmp >1.tmp
>
> Produces this correct 1.tmp file:
>
> 204718.31	626160.79 -20.79
>
>
> However, when calling the exact same command from the matlab shell:
>
> system(['cs2cs +init=epsg:4326 +to +init=epsg:2039  <0.tmp >1.tmp'])
>
> The resulting file 1.tmp only has these contents:
>
> 	 -20.787
>
> So, clearly, cs2cs is getting all of the input, since otherwise it could
> not get the -20.79 right. The question is why would it not also write
> 204718.31    626160.79  to the file?
> What weird thing could MATLAB be doing with the input that would make
> cs2cs produce this partial output?
>
> Note: do not try to reproduce in Octave. It works fine in Octave.
>
> Thanks,
> Shimi.
>
>
> _______________________________________________
> Proj mailing list
> Proj at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/proj
>




More information about the Proj mailing list