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.
*** Bug 156095 has been marked as a duplicate of this bug. ***
*** Bug 156094 has been marked as a duplicate of this bug. ***
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.
Hi G
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
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.
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
G
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
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 :]