Using invproj to get back the inputs to proj

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Using invproj to get back the inputs to proj

Dean Schulze
Following the example in the man page if I do

    proj +proj=utm +lon_0=112w +ellps=clrk66 -r man.page.lat.lon.txt

where the file man.page.lat.lon.txt contains

    45d15'33.1"   111.5W
    45d15.551666667N   -111d30
    +45.25919444444    111d30'000w

I get the 3 lines of output shown in the man page:

   460769.27 5011648.45
   460769.27 5011648.45
   460769.27 5011648.45

So far, so good.  But when I try to use invproj to get back the original inputs the results are not even close to the inputs:

    proj +proj=utm +lon_0=112w +ellps=clrk66 -r man.page.lat.lon.txt | invproj +proj=utm +lon_0=112w +ellps=clrk66 -r

gives

    73d25'28.89"W 3d18'2.678"N
    73d25'28.89"W 3d18'2.678"N
    73d25'28.89"W 3d18'2.678"N

What is invproj giving me?  How do I run invproj to get back my original inputs?  

Apparently invproj doesn't use command line parameters the same way that proj does.  Is this documented somewhere?  I've read the 3 .pdfs provides as users manuals, but they say nothing about how to use invproj to get back the original inputs.

Thanks.
_______________________________________________
Proj mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/proj
Reply | Threaded
Open this post in threaded view
|

Re: Using invproj to get back the inputs to proj

Thomas Knudsen

Try to leave out the -r option in invproj: the output of proj, that you feed into invproj is not in reverse order.

Also, do not expect identical output, especially not for data points far off the central meridian.

/Thomas

Den 16. maj 2016 19.26 skrev "Dean Schulze" <[hidden email]>:
Following the example in the man page if I do

    proj +proj=utm +lon_0=112w +ellps=clrk66 -r man.page.lat.lon.txt

where the file man.page.lat.lon.txt contains

    45d15'33.1"   111.5W
    45d15.551666667N   -111d30
    +45.25919444444    111d30'000w

I get the 3 lines of output shown in the man page:

   460769.27    5011648.45
   460769.27    5011648.45
   460769.27    5011648.45

So far, so good.  But when I try to use invproj to get back the original inputs the results are not even close to the inputs:

    proj +proj=utm +lon_0=112w +ellps=clrk66 -r man.page.lat.lon.txt | invproj +proj=utm +lon_0=112w +ellps=clrk66 -r

gives

    73d25'28.89"W       3d18'2.678"N
    73d25'28.89"W       3d18'2.678"N
    73d25'28.89"W       3d18'2.678"N

What is invproj giving me?  How do I run invproj to get back my original inputs?

Apparently invproj doesn't use command line parameters the same way that proj does.  Is this documented somewhere?  I've read the 3 .pdfs provides as users manuals, but they say nothing about how to use invproj to get back the original inputs.

Thanks.
_______________________________________________
Proj mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/proj

_______________________________________________
Proj mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/proj
Reply | Threaded
Open this post in threaded view
|

Re: Using invproj to get back the inputs to proj

Dean Schulze
Leaving off the -r on invproj gives me back the correct latitude, but the longitude is even worse:

$ proj +proj=utm +lon_0=112w +ellps=clrk66 -r man.page.lat.lon.txt | invproj +proj=utm  +ellps=clrk66
# proj +proj=utm +lon_0=112w +ellps=clrk66 -r man.page.lat.lon.txt
# Should give
# 460769.27     5011648.45
3d30'W 45d15'33.1"N
3d30'W 45d15'33.1"N
3d30'W 45d15'33.1"N


________________________________________
From: [hidden email] [[hidden email]] on behalf of Thomas Knudsen [[hidden email]]
Sent: Monday, May 16, 2016 11:59 PM
To: PROJ. 4 and general Projections Discussions
Subject: Re: [Proj] Using invproj to get back the inputs to proj

Try to leave out the -r option in invproj: the output of proj, that you feed into invproj is not in reverse order.

Also, do not expect identical output, especially not for data points far off the central meridian.

/Thomas

Den 16. maj 2016 19.26 skrev "Dean Schulze" <[hidden email]<mailto:[hidden email]>>:
Following the example in the man page if I do

    proj +proj=utm +lon_0=112w +ellps=clrk66 -r man.page.lat.lon.txt

where the file man.page.lat.lon.txt contains

    45d15'33.1"   111.5W
    45d15.551666667N   -111d30
    +45.25919444444    111d30'000w

I get the 3 lines of output shown in the man page:

   460769.27    5011648.45
   460769.27    5011648.45
   460769.27    5011648.45

So far, so good.  But when I try to use invproj to get back the original inputs the results are not even close to the inputs:

    proj +proj=utm +lon_0=112w +ellps=clrk66 -r man.page.lat.lon.txt | invproj +proj=utm +lon_0=112w +ellps=clrk66 -r

gives

    73d25'28.89"W       3d18'2.678"N
    73d25'28.89"W       3d18'2.678"N
    73d25'28.89"W       3d18'2.678"N

What is invproj giving me?  How do I run invproj to get back my original inputs?

Apparently invproj doesn't use command line parameters the same way that proj does.  Is this documented somewhere?  I've read the 3 .pdfs provides as users manuals, but they say nothing about how to use invproj to get back the original inputs.

Thanks.
_______________________________________________
Proj mailing list
[hidden email]<mailto:[hidden email]>
http://lists.maptools.org/mailman/listinfo/proj
_______________________________________________
Proj mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/proj
Reply | Threaded
Open this post in threaded view
|

Re: Using invproj to get back the inputs to proj

Andre Joost
Am 17.05.2016 um 16:54 schrieb Dean Schulze:

> Leaving off the -r on invproj gives me back the correct latitude, but the longitude is even worse:
>
> $ proj +proj=utm +lon_0=112w +ellps=clrk66 -r man.page.lat.lon.txt | invproj +proj=utm  +ellps=clrk66
> # proj +proj=utm +lon_0=112w +ellps=clrk66 -r man.page.lat.lon.txt
> # Should give
> # 460769.27     5011648.45
> 3d30'W 45d15'33.1"N
> 3d30'W 45d15'33.1"N
> 3d30'W 45d15'33.1"N
>
>
> ________________________________________
> From: [hidden email] [[hidden email]] on behalf of Thomas Knudsen [[hidden email]]
> Sent: Monday, May 16, 2016 11:59 PM
> To: PROJ. 4 and general Projections Discussions
> Subject: Re: [Proj] Using invproj to get back the inputs to proj
>
> Try to leave out the -r option in invproj: the output of proj, that you feed into invproj is not in reverse order.
>
> Also, do not expect identical output, especially not for data points far off the central meridian.
>
> /Thomas
>
> Den 16. maj 2016 19.26 skrev "Dean Schulze" <[hidden email]<mailto:[hidden email]>>:
> Following the example in the man page if I do
>
>      proj +proj=utm +lon_0=112w +ellps=clrk66 -r man.page.lat.lon.txt
>
> where the file man.page.lat.lon.txt contains
>
>      45d15'33.1"   111.5W
>      45d15.551666667N   -111d30
>      +45.25919444444    111d30'000w
>
> I get the 3 lines of output shown in the man page:
>
>     460769.27    5011648.45
>     460769.27    5011648.45
>     460769.27    5011648.45
>
> So far, so good.  But when I try to use invproj to get back the original inputs the results are not even close to the inputs:
>
>      proj +proj=utm +lon_0=112w +ellps=clrk66 -r man.page.lat.lon.txt | invproj +proj=utm +lon_0=112w +ellps=clrk66 -r
>
> gives
>
>      73d25'28.89"W       3d18'2.678"N
>      73d25'28.89"W       3d18'2.678"N
>      73d25'28.89"W       3d18'2.678"N
>
> What is invproj giving me?  How do I run invproj to get back my original inputs?
>

You have missed the lon_0 in invproj, so it takes it to Greenwich.

HTH,
André Joost


_______________________________________________
Proj mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/proj
Reply | Threaded
Open this post in threaded view
|

Re: Using invproj to get back the inputs to proj

Dean Schulze

Thanks Andre.  Leaving off the lon_0 was the problem.

________________________________________
From: [hidden email] [[hidden email]] on behalf of Andre Joost [[hidden email]]
Sent: Tuesday, May 17, 2016 12:09 PM
To: [hidden email]
Subject: Re: [Proj] Using invproj to get back the inputs to proj

Am 17.05.2016 um 16:54 schrieb Dean Schulze:

> Leaving off the -r on invproj gives me back the correct latitude, but the longitude is even worse:
>
> $ proj +proj=utm +lon_0=112w +ellps=clrk66 -r man.page.lat.lon.txt | invproj +proj=utm  +ellps=clrk66
> #     proj +proj=utm +lon_0=112w +ellps=clrk66 -r man.page.lat.lon.txt
> #     Should give
> #             460769.27     5011648.45
> 3d30'W        45d15'33.1"N
> 3d30'W        45d15'33.1"N
> 3d30'W        45d15'33.1"N
>
>
> ________________________________________
> From: [hidden email] [[hidden email]] on behalf of Thomas Knudsen [[hidden email]]
> Sent: Monday, May 16, 2016 11:59 PM
> To: PROJ. 4 and general Projections Discussions
> Subject: Re: [Proj] Using invproj to get back the inputs to proj
>
> Try to leave out the -r option in invproj: the output of proj, that you feed into invproj is not in reverse order.
>
> Also, do not expect identical output, especially not for data points far off the central meridian.
>
> /Thomas
>
> Den 16. maj 2016 19.26 skrev "Dean Schulze" <[hidden email]<mailto:[hidden email]>>:
> Following the example in the man page if I do
>
>      proj +proj=utm +lon_0=112w +ellps=clrk66 -r man.page.lat.lon.txt
>
> where the file man.page.lat.lon.txt contains
>
>      45d15'33.1"   111.5W
>      45d15.551666667N   -111d30
>      +45.25919444444    111d30'000w
>
> I get the 3 lines of output shown in the man page:
>
>     460769.27    5011648.45
>     460769.27    5011648.45
>     460769.27    5011648.45
>
> So far, so good.  But when I try to use invproj to get back the original inputs the results are not even close to the inputs:
>
>      proj +proj=utm +lon_0=112w +ellps=clrk66 -r man.page.lat.lon.txt | invproj +proj=utm +lon_0=112w +ellps=clrk66 -r
>
> gives
>
>      73d25'28.89"W       3d18'2.678"N
>      73d25'28.89"W       3d18'2.678"N
>      73d25'28.89"W       3d18'2.678"N
>
> What is invproj giving me?  How do I run invproj to get back my original inputs?
>

You have missed the lon_0 in invproj, so it takes it to Greenwich.

HTH,
André Joost


_______________________________________________
Proj mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/proj
_______________________________________________
Proj mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/proj
Reply | Threaded
Open this post in threaded view
|

Re: Using invproj to get back the inputs to proj

José Alberto Gonçalves
Hi
When you chose the UTM projection with +proj=utm you should define the zone with +zone=..., and avoid +lon_0.
The correct lon_0 of zone 12 is 111w.
Regards

José Gonçalves

2016-05-17 23:15 GMT+01:00 Dean Schulze <[hidden email]>:

Thanks Andre.  Leaving off the lon_0 was the problem.

________________________________________
From: [hidden email] [[hidden email]] on behalf of Andre Joost [[hidden email]]
Sent: Tuesday, May 17, 2016 12:09 PM
To: [hidden email]
Subject: Re: [Proj] Using invproj to get back the inputs to proj

Am 17.05.2016 um 16:54 schrieb Dean Schulze:
> Leaving off the -r on invproj gives me back the correct latitude, but the longitude is even worse:
>
> $ proj +proj=utm +lon_0=112w +ellps=clrk66 -r man.page.lat.lon.txt | invproj +proj=utm  +ellps=clrk66
> #     proj +proj=utm +lon_0=112w +ellps=clrk66 -r man.page.lat.lon.txt
> #     Should give
> #             460769.27     5011648.45
> 3d30'W        45d15'33.1"N
> 3d30'W        45d15'33.1"N
> 3d30'W        45d15'33.1"N
>
>
> ________________________________________
> From: [hidden email] [[hidden email]] on behalf of Thomas Knudsen [[hidden email]]
> Sent: Monday, May 16, 2016 11:59 PM
> To: PROJ. 4 and general Projections Discussions
> Subject: Re: [Proj] Using invproj to get back the inputs to proj
>
> Try to leave out the -r option in invproj: the output of proj, that you feed into invproj is not in reverse order.
>
> Also, do not expect identical output, especially not for data points far off the central meridian.
>
> /Thomas
>
> Den 16. maj 2016 19.26 skrev "Dean Schulze" <[hidden email]<mailto:[hidden email]>>:
> Following the example in the man page if I do
>
>      proj +proj=utm +lon_0=112w +ellps=clrk66 -r man.page.lat.lon.txt
>
> where the file man.page.lat.lon.txt contains
>
>      45d15'33.1"   111.5W
>      45d15.551666667N   -111d30
>      +45.25919444444    111d30'000w
>
> I get the 3 lines of output shown in the man page:
>
>     460769.27    5011648.45
>     460769.27    5011648.45
>     460769.27    5011648.45
>
> So far, so good.  But when I try to use invproj to get back the original inputs the results are not even close to the inputs:
>
>      proj +proj=utm +lon_0=112w +ellps=clrk66 -r man.page.lat.lon.txt | invproj +proj=utm +lon_0=112w +ellps=clrk66 -r
>
> gives
>
>      73d25'28.89"W       3d18'2.678"N
>      73d25'28.89"W       3d18'2.678"N
>      73d25'28.89"W       3d18'2.678"N
>
> What is invproj giving me?  How do I run invproj to get back my original inputs?
>

You have missed the lon_0 in invproj, so it takes it to Greenwich.

HTH,
André Joost


_______________________________________________
Proj mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/proj
_______________________________________________
Proj mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/proj


_______________________________________________
Proj mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/proj
Reply | Threaded
Open this post in threaded view
|

Re: Using invproj to get back the inputs to proj

Melita Kennedy
In reply to this post by Dean Schulze
Your last test is missing the +lon_0=112w parameter so the command is either assuming zone 30 or 31 or that the central meridian/longitude of origin is zero. (I don't have a working copy to check)
_______________________________________________
Proj mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/proj
Reply | Threaded
Open this post in threaded view
|

Re: Using invproj to get back the inputs to proj

Davide Cesari
In reply to this post by Dean Schulze
Hello Dean, it seems you forgot "+lon_0=112w" in the invproj string, I
get the correct result with the following command:

echo "45.25919444444 -111.5" | \
  proj +proj=utm +lon_0=112w +ellps=clrk66 -r | \
  invproj +proj=utm +lon_0=112w  +ellps=clrk66

111d30'W 45d15'33.1"N

        Davide

On 17/05/2016 16:54, Dean Schulze wrote:

> Leaving off the -r on invproj gives me back the correct latitude, but the longitude is even worse:
>
> $ proj +proj=m +lon_02w +ellps=clrk66 -r man.page.lat.lon.txt | invproj +proj=utm  +ellps=clrk66
> # proj +proj=m +lon_02w +ellps=clrk66 -r man.page.lat.lon.txt
> # Should give
> # 460769.27     5011648.45
> 3d30'W 45d15'33.1"N
> 3d30'W 45d15'33.1"N
> 3d30'W 45d15'33.1"N
>
>
> ________________________________________
> From: [hidden email] [[hidden email]] on behalf of Thomas Knudsen [[hidden email]]
> Sent: Monday, May 16, 2016 11:59 PM
> To: PROJ. 4 and general Projections Discussions
> Subject: Re: [Proj] Using invproj to get back the inputs to proj
>
> Try to leave out the -r option in invproj: the output of proj, that you feed into invproj is not in reverse order.
>
> Also, do not expect identical output, especially not for data points far off the central meridian.
>
> /Thomas
>
> Den 16. maj 2016 19.26 skrev "Dean Schulze" <[hidden email]<mailto:[hidden email]>>:
> Following the example in the man page if I do
>
>      proj +proj=m +lon_02w +ellps=clrk66 -r man.page.lat.lon.txt
>
> where the file man.page.lat.lon.txt contains
>
>      45d15'33.1"   111.5W
>      45d15.551666667N   -111d30
>      +45.25919444444    111d30'000w
>
> I get the 3 lines of output shown in the man page:
>
>     460769.27    5011648.45
>     460769.27    5011648.45
>     460769.27    5011648.45
>
> So far, so good.  But when I try to use invproj to get back the original inputs the results are not even close to the inputs:
>
>      proj +proj=m +lon_02w +ellps=clrk66 -r man.page.lat.lon.txt | invproj +proj=utm +lon_02w +ellps=clrk66 -r
>
> gives
>
>      73d25'28.89"W       3d18'2.678"N
>      73d25'28.89"W       3d18'2.678"N
>      73d25'28.89"W       3d18'2.678"N
>
> What is invproj giving me?  How do I run invproj to get back my original inputs?
>
> Apparently invproj doesn't use command line parameters the same way that proj does.  Is this documented somewhere?  I've read the 3 .pdfs provides as users manuals, but they say nothing about how to use invproj to get back the original inputs.
>
> Thanks.
> _______________________________________________
> Proj mailing list
> [hidden email]<mailto:[hidden email]>
> http://lists.maptools.org/mailman/listinfo/proj
>


--
============================= Davide Cesari ============================
Dott**(0.5) Davide Cesari
Arpæ Emilia Romagna, Servizio IdroMeteoClima
NWP modelling - Modellistica numerica previsionale
Tel. +39 051525926
========================================================================
_______________________________________________
Proj mailing list
[hidden email]
http://lists.maptools.org/mailman/listinfo/proj