No subject


Sat Aug 11 10:11:24 EST 2018


receive a UTM coordinate (i.e, zone, easting, northing).
Obviously, determining a zone is the first step required in the process,
but it would seem to be something that cs2cs could (/should?) handle.
The zone IS determined from the longitude (even if it is supplied on the
command line).

Is there some philosophical reason PROJ tools don't currently do this?
Would there be any point in me coding up a patch to support this &
submitting a pull request?
(I guess that's really two questions...).
Thanks again,
Robb.


On Mon, Oct 29, 2018 at 1:55 PM Kristian Evers <kreve at sdfe.dk> wrote:

> Robb,
>
> On 29 Oct 2018, at 18:34, Robb Main <rmain.mws at gmail.com> wrote:
>
> Thanks for the link, Kristian.
>
> It seemed to me that the source code (specifically proj_etmerc.c:338 -
> 354) looked like it would calculate the zone if one wasn't supplied
> (although it also doesn't handle the 'exception' cases mentioned in your
> link), though I was surprised when I could not find a way to request
> conversion without specifying a zone.
>
>
> In that part of the code it tries to determine the zone from the central
> meridian set with +lon_0. If neither +zone or +lon_0 is set PROJ defaults
> to zone 30 (based on the default value of +lon_0 which is 0 when not
> specified).
>
> As I understand your statement though, there is no way to do this with th=
e
> current implementation of PROJ tools.
>
>
> Correct.
>
> On the subject of 'correctness', doesn't using a 'clever shell script'
> like you suggest amount to doing what I was requesting, just doing it
> outside the PROJ framework?
>
>
> Yes. I am not saying that it is a smart thing to do, but if you really
> want to, there=E2=80=99s a way to do it.
>
> /Kristian
>
> Regards,
> Robb.
>
> On Mon, Oct 29, 2018 at 1:07 PM Kristian Evers <kreve at sdfe.dk> wrote:
>
>> Robb,
>>
>> /Kristian
>>
>> On 29 Oct 2018, at 17:30, Robb Main <rmain.mws at gmail.com> wrote:
>>
>> When converting many lat,long coordinates to UTM, is there some way to
>> setup cs2cs to calculate the UTM zone based on the longitude of the sour=
ce
>> cordinate system, rather than having to specify the zone on the command
>> line?
>>
>>
>> No. You can probably do something clever in a shell script if you want,
>> but it is not possible with any PROJ tool. See [0] for an overview of ho=
w
>> to determine the nearest UTM zone of a coordinate.
>>
>>
>> What I'm looking for is something like: instead of this:
>>   cs2cs +proj=3Dlatlong +data=3DNAD83 +to +proj=3Dutm +zone=3D10 +datum=
=3DNAD27
>> ./input.data
>> you could instead specify:
>>   cs2cs +proj=3Dlatlong +data=3DNAD83 +to +proj=3Dutm +zone=3Dauto +datu=
m=3DNAD27
>> ./input.data
>> where 'zone=3Dauto' might tell the algorithm to figure the zone out base=
d
>> on longitude of the input coordinate. This would ensure the output data
>> would be correct, even if the input data file contains coordinates that
>> span multiple UTM zones.
>>
>>
>> What you call correct, I regard as potentially incompatible coordinates.
>> What you are proposing here is fundamentally breaking the promise that y=
ou
>> are given by the cs2cs application: cs2cs transform coordinates from one
>> coordinate reference system to another. With your proposed auto-zoned UT=
M
>> the output crs would not be properly defined and your output coordinates
>> would be incompatible in the case that they span several UTM zones. You =
are
>> much better of just sticking to one zone - cs2cs will deliver numericall=
y
>> stable coordinates several thousands of kilometers outside the chosen zo=
ne.
>>
>> /Kristian
>>
>> [0]
>> https://stackoverflow.com/questions/9186496/determining-utm-zone-to-conv=
ert-from-longitude-latitude
>>
>>
>> _______________________________________________
>> Proj mailing list
>> Proj at lists.maptools.org
>> http://lists.maptools.org/mailman/listinfo/proj
>>
>>
>> _______________________________________________
>> Proj mailing list
>> Proj at lists.maptools.org
>> http://lists.maptools.org/mailman/listinfo/proj
>
> _______________________________________________
> Proj mailing list
> Proj at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/proj
>
>
> _______________________________________________
> Proj mailing list
> Proj at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/proj

--000000000000f2d1d70579620030
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">One final question, and I&#39;ll stop beating this to deat=
h:<div>From my naive viewpoint, I want to supply a lat &amp; long coordinat=
e, and receive a UTM coordinate (i.e, zone, easting, northing).</div><div>O=
bviously, determining a zone is the first step required in the process, but=
 it would seem to be something that cs2cs could (/should?) handle.</div><di=
v>The zone IS determined from the longitude (even if it is supplied on the =
command line).</div><div><br></div><div>Is there some philosophical reason =
PROJ tools don&#39;t currently do this?</div><div>Would there be any point =
in me coding up a patch to support this &amp; submitting a pull request?</d=
iv><div>(I guess that&#39;s really two questions...).</div><div>Thanks agai=
n,</div><div>Robb.</div><div><br></div></div><br><div class=3D"gmail_quote"=
><div dir=3D"ltr">On Mon, Oct 29, 2018 at 1:55 PM Kristian Evers &lt;<a hre=
f=3D"mailto:kreve at sdfe.dk">kreve at sdfe.dk</a>&gt; wrote:<br></div><blockquot=
e class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc sol=
id;padding-left:1ex">



<div style=3D"word-wrap:break-word;line-break:after-white-space">
Robb,<br>
<div><br>
<blockquote type=3D"cite">
<div>On 29 Oct 2018, at 18:34, Robb Main &lt;<a href=3D"mailto:rmain.mws at gm=
ail.com" target=3D"_blank">rmain.mws at gmail.com</a>&gt; wrote:</div>
<br class=3D"m_1530492544232109511Apple-interchange-newline">
<div>
<div dir=3D"ltr">Thanks for the link, Kristian.
<div><br>
</div>
<div>
<div>It seemed to me that the source code (specifically proj_etmerc.c:338 -=
 354) looked like it would calculate the zone if one wasn&#39;t supplied (a=
lthough it also doesn&#39;t handle the &#39;exception&#39; cases mentioned =
in your link), though I was surprised when
 I could not find a way to request conversion without specifying a zone.</d=
iv>
<div><br>
</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>In that part of the code it tries to determine the zone from the centr=
al meridian set with +lon_0. If neither +zone or +lon_0 is set PROJ default=
s to zone 30 (based on the default value of +lon_0 which is 0 when not spec=
ified).</div>
<div><br>
</div>
<blockquote type=3D"cite">
<div>
<div dir=3D"ltr">
<div>
<div>As I understand your statement though, there is no way to do this with=
 the current implementation of PROJ tools.=C2=A0</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>Correct.=C2=A0</div>
<br>
<blockquote type=3D"cite">
<div>
<div dir=3D"ltr">
<div>
<div>On the subject of &#39;correctness&#39;, doesn&#39;t using a &#39;clev=
er shell script&#39; like you suggest amount to doing what I was requesting=
, just doing it outside the PROJ framework?</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
Yes. I am not saying that it is a smart thing to do, but if you really want=
 to, there=E2=80=99s a way to do it.</div>
<div><br>
</div>
<div>/Kristian<br>
<br>
<blockquote type=3D"cite">
<div>
<div dir=3D"ltr">
<div>
<div>
<div>Regards,</div>
</div>
<div>Robb.</div>
</div>
</div>
<br>
<div class=3D"gmail_quote">
<div dir=3D"ltr">On Mon, Oct 29, 2018 at 1:07 PM Kristian Evers &lt;<a href=
=3D"mailto:kreve at sdfe.dk" target=3D"_blank">kreve at sdfe.dk</a>&gt; wrote:<br=
>
</div>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
<div style=3D"word-wrap:break-word;line-break:after-white-space">Robb,
<div><br>
</div>
<div>/Kristian<br>
<div><br>
</div>
<div>
<div>
<blockquote type=3D"cite">
<div>On 29 Oct 2018, at 17:30, Robb Main &lt;<a href=3D"mailto:rmain.mws at gm=
ail.com" target=3D"_blank">rmain.mws at gmail.com</a>&gt; wrote:</div>
<br class=3D"m_1530492544232109511m_6088843805229460402Apple-interchange-ne=
wline">
<div>
<div dir=3D"ltr">When converting many lat,long coordinates to UTM, is there=
 some way to setup cs2cs to calculate the UTM zone based on the longitude o=
f the source cordinate system, rather than having to specify the zone on th=
e command line?</div>
</div>
</blockquote>
<div><br>
</div>
No. You can probably do something clever in a shell script if you want, but=
 it is not possible with any PROJ tool. See [0] for an overview of how to d=
etermine the nearest UTM zone of a coordinate.</div>
<div><br>
<blockquote type=3D"cite">
<div>
<div dir=3D"ltr">
<div><br>
</div>
<div>What I&#39;m looking for is something like: instead of this:</div>
<div>=C2=A0 cs2cs=C2=A0+proj=3Dlatlong=C2=A0+data=3DNAD83=C2=A0+to +proj=3D=
utm=C2=A0+zone=3D10=C2=A0+datum=3DNAD27 ./input.data</div>
<div>you could instead specify:</div>
<div>
<div>=C2=A0 cs2cs=C2=A0+proj=3Dlatlong=C2=A0+data=3DNAD83=C2=A0+to +proj=3D=
utm=C2=A0+zone=3Dauto +datum=3DNAD27 ./input.data</div>
where &#39;zone=3Dauto&#39; might tell the algorithm to figure the zone out=
 based on longitude of the input coordinate. This would ensure the output d=
ata would be correct, even if the input data file contains coordinates that=
 span multiple UTM zones.</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>
<div>What you call correct, I regard as potentially incompatible coordinate=
s. What you are proposing here is fundamentally breaking the promise that y=
ou are given by the cs2cs application: cs2cs transform coordinates from one=
 coordinate reference system
 to another. With your proposed auto-zoned UTM the output crs would not be =
properly defined and your output coordinates would be incompatible in the c=
ase that they span several UTM zones. You are much better of just sticking =
to one zone - cs2cs will deliver
 numerically stable coordinates several thousands of kilometers outside the=
 chosen zone.</div>
<div><br>
</div>
<div>/Kristian</div>
<div><br>
</div>
<div>[0]=C2=A0<a href=3D"https://stackoverflow.com/questions/9186496/determ=
ining-utm-zone-to-convert-from-longitude-latitude" target=3D"_blank">https:=
//stackoverflow.com/questions/9186496/determining-utm-zone-to-convert-from-=
longitude-latitude</a>=C2=A0</div>
</div>
<br>
<blockquote type=3D"cite">
<div>_______________________________________________<br>
Proj mailing list<br>
<a href=3D"mailto:Proj at lists.maptools.org" target=3D"_blank">Proj at lists.map=
tools.org</a><br>
<a href=3D"http://lists.maptools.org/mailman/listinfo/proj" target=3D"_blan=
k">http://lists.maptools.org/mailman/listinfo/proj</a></div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
_______________________________________________<br>
Proj mailing list<br>
<a href=3D"mailto:Proj at lists.maptools.org" target=3D"_blank">Proj at lists.map=
tools.org</a><br>
<a href=3D"http://lists.maptools.org/mailman/listinfo/proj" rel=3D"noreferr=
er" target=3D"_blank">http://lists.maptools.org/mailman/listinfo/proj</a></=
blockquote>
</div>
_______________________________________________<br>
Proj mailing list<br>
<a href=3D"mailto:Proj at lists.maptools.org" target=3D"_blank">Proj at lists.map=
tools.org</a><br>
<a href=3D"http://lists.maptools.org/mailman/listinfo/proj" target=3D"_blan=
k">http://lists.maptools.org/mailman/listinfo/proj</a></div>
</blockquote>
</div>
<br>
</div>

_______________________________________________<br>
Proj mailing list<br>
<a href=3D"mailto:Proj at lists.maptools.org" target=3D"_blank">Proj at lists.map=
tools.org</a><br>
<a href=3D"http://lists.maptools.org/mailman/listinfo/proj" rel=3D"noreferr=
er" target=3D"_blank">http://lists.maptools.org/mailman/listinfo/proj</a></=
blockquote></div>

--000000000000f2d1d70579620030--


More information about the Proj mailing list