Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 156093 - sci_libs/proj-4.4.9 gives wrong results
Summary: sci_libs/proj-4.4.9 gives wrong results
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Tom Payne (RETIRED)
URL:
Whiteboard:
Keywords:
: 156094 156095 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-11-23 23:54 UTC by Jean-Claude Repetto
Modified: 2006-11-24 13:59 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Claude Repetto 2006-11-23 23:54:29 UTC
I want to convert WGS geographical coordinates to Lambert II projection in the NTF cs.
For example the data long=6.91873807,lat=43.64479385 should give the result X=970000, Y=1860000

With proj-4.4.9 installed, I type the command :
cs2cs +proj=longlat +datum=WGS84 +towgs84=168,60,-320 +to +proj=lcc +lat_1=46.8000 +lon_0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +ellps=clrk80 +pm=paris
Input data : 6.91873807 43.64479385
Output Data : 969694.45       7574379.68 -40.90                  WRONG !!!!!

In proj-4.5.0 , the bug has been corrected :
Output Data : 970000.00       1859999.98 -40.90                  CORRECT !!!!

I strongly recommand to put proj-4.5.0 in portage and to switch to the new version ASAP.
Comment 1 Christian Faulhammer (RETIRED) gentoo-dev 2006-11-24 00:08:01 UTC
*** Bug 156095 has been marked as a duplicate of this bug. ***
Comment 2 Christian Faulhammer (RETIRED) gentoo-dev 2006-11-24 00:08:04 UTC
*** Bug 156094 has been marked as a duplicate of this bug. ***
Comment 3 FENOY Gérald (RETIRED) gentoo-dev 2006-11-24 12:11:36 UTC
Hi,
as Frank Wamerdam said : "The problem is that /usr/share/proj/proj_def.dat gives a default value for lat_2 with projection lcc. Either give an explicit +lat_2=0 or add +no_defs to your lcc definition." 

So, for exemple if you use the command line bellow, you'll obtain the right result :
echo "6.91873807 43.64479385" | cs2cs +proj=longlat +datum=WGS84 +towgs84=168,60,-320 +to +proj=lcc +no_defs +lat_1=46.8000 +lon_0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +ellps=clrk80 +pm=paris .

So the ebuild was not the problem here.

Furtheremore, the same happen ,when using the proj-4.5 ebuild I've made.

I'll post proj-4.5.0 into portage as soon as possible.
Comment 4 Jean-Claude Repetto 2006-11-24 12:35:25 UTC
Hi G
Comment 5 Jean-Claude Repetto 2006-11-24 12:35:25 UTC
Hi Gérald,

Thank you very much for the explanation of the problem.

> So the ebuild was not the problem here.
I agree.

> Furthermore, the same happen ,when using the proj-4.5 ebuild I've made.

Strange. I have installed prog-4.5.0 from the source tarball, run ./configure and make, and the result was correct.

This is the verbose output from proj-4.5.0 (without the +nodefs ditrective) :
echo "6.91873807 43.64479385" | ./cs2cs -v +proj=longlat +datum=WGS84 +towgs84=168,60,-320 +to +proj=lcc +lat_1=46.8000 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +ellps=clrk80 +pm=paris
# ---- From Coordinate System ----
#Lat/long (Geodetic)
#
# +proj=longlat +datum=WGS84 +towgs84=168,60,-320 +ellps=WGS84
#--- following specified but NOT used
# +towgs84=0,0,0
# ---- To Coordinate System ----
#Lambert Conformal Conic
#       Conic, Sph&Ell
#       lat_1= and lat_2= or lat_0
# +proj=lcc +lat_1=46.8000 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000
# +ellps=clrk80 +pm=paris
970000.00       1859999.98 -40.90


With proj-4.4.9, I get :
echo "6.91873807 43.64479385" | cs2cs -v +proj=longlat +datum=WGS84 +towgs84=168,60,-320 +to +proj=lcc +lat_1=46.8000 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +ellps=clrk80 +pm=paris
# ---- From Coordinate System ----
#Lat/long (Geodetic)
#
# +proj=longlat +datum=WGS84 +towgs84=168,60,-320 +ellps=WGS84
#--- following specified but NOT used
# +towgs84=0,0,0
# ---- To Coordinate System ----
#Lambert Conformal Conic
#       Conic, Sph&Ell
#       lat_1= and lat_2= or lat_0
# +proj=lcc +lat_1=46.8000 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000
# +ellps=clrk80 +pm=paris +lat_2=45
#--- following specified but NOT used
# +lat_1=33
969694.45       7574379.68 -40.90

(I have noticed that +lat_2=45, that causes the wrong result).

I think there is really a difference between prog-4.4.9 and proj-4.5.0.

Regards,
Jean-Claude
Comment 6 FENOY Gérald (RETIRED) gentoo-dev 2006-11-24 13:11:52 UTC
Just take care about the fact that if you run only make and not make install then I suppose that the file proj_def.dat was not used and then default value for lat_2 was not set. This could be an explanation, you could maybe try the same way with proj-4.4.9 and give use feedback. HTH

Note that proj-4.5.0 was now synced on cvs.
Comment 7 Tom Payne (RETIRED) gentoo-dev 2006-11-24 13:43:24 UTC
Hi djay,

Would you be interested in taking over maintainership of proj?  I'm not actively using it at the moment.  If so, just commit a new metadata.xml.

You should also assign this bug to yourself so that you get credit for fixing it :-)

Note that you can remove proj-4.4.7-r1 and proj-4.4.8 from the tree: 4.4.9 and 4.5.0 are the most recent versions for all ARCHes.

Cheers,
Tom
Comment 8 Jean-Claude Repetto 2006-11-24 13:56:09 UTC
G
Comment 9 Jean-Claude Repetto 2006-11-24 13:56:09 UTC
Gérald, you are right. I have compiled proj-4.4.9 without running "make install", and it is working.

Thanks for the hint about the +nodefs parameter (BTW I have not found it in the documentation at http://proj.maptools.org/gen_parms.html)

Jean-Claude

Comment 10 FENOY Gérald (RETIRED) gentoo-dev 2006-11-24 13:59:17 UTC
Hi twp,
I've just synced the metadata, I remove yourself from it and set myself as the maintainer, I hope that waht you want, else just correct the metadata :)

I appologize for closing this bug even if I'm not the assignee for it :]