john star | 1 Jun 15:19 2005
Picon

bug in PJ_tmerc.c ?


Hi,

I think that if lat < 0, then there is a bug in PJ_tmerc.c:
INVERSE(s_inverse); /* sphere */
	double h, g;

	h = exp(xy.x / aks0);
	g = .5 * (h - 1. / h);
	h = cos(P->phi0 + xy.y / aks0);
	lp.phi = asin(sqrt((1. - h * h) / (1. + g * g)));
	if ((xy.y + P->phi0) < 0.) lp.phi = -lp.phi; /* instead of if ((xy.y) < 0.) 
lp.phi = -lp.phi;*/
	lp.lam = (g || h) ? atan2(g, h) : 0.;
	return (lp);
}

You can see it like: (flips between southern and northern hemisphere around 
the center)
D:\geotiffBin>proj.exe +proj=tmerc +lat_0=53.119651794 +lon_0=11.067049026 
+k=1.000000 +x_0=0.000 +y_0=0.000 +a=6378137.000 +b=6378137.000 
+to_meter=1.0000000000 -I
0.0 -35583
11d4'1.376"E    52d48'0.015"S
0.0 35583
11d4'1.376"E    53d26'21.478"N

and see it also on
http://modules.geotools.org/main/xref/org/geotools/referencing/operation/projection/TransverseMercator.html

(Continue reading)

Gerald Evenden | 1 Jun 16:42 2005
Picon
Picon

Re: bug in PJ_tmerc.c ?

I think you have a point.

I can't think of any case where a negative grid value was ever used as
a test point.  Interesting.

For the test data of

0.0 -35583
0. 0.
0.0 35583

should output:

11d4'1.376"E    52d48'0.015"N
11d4'1.376"E    53d7'10.746"N
11d4'1.376"E    53d26'21.478"N

but the N-S sign of the first value is incorrectly output as S in the  
current
version.  The sign of northing is incorrectly filtering through to the  
output latitude.

Will be fixed.

On Jun 1, 2005, at 9:19 AM, john star wrote:

>
> Hi,
>
> I think that if lat < 0, then there is a bug in PJ_tmerc.c:
(Continue reading)

Gerald Evenden | 1 Jun 23:02 2005
Picon
Picon

Re: bug in PJ_tmerc.c ?

For quick fix see below.  The test line does not belong there at all 
since the
correction for lat_0 offset is done two lines earlier.  I will do more 
elaborate
tests later.

What took me a minute to figure things out was your specifying both
+a and +b which caused me to assume you were doing an ellipsoid
which does not seem to have this problem.  +R= makes things clearer.  
:-)
Yes, your code below shows spherical forms but sometimes I do not
read too good.  :-(

On Jun 1, 2005, at 9:19 AM, john star wrote:

>
> Hi,
>
> I think that if lat < 0, then there is a bug in PJ_tmerc.c:
> INVERSE(s_inverse); /* sphere */
> 	double h, g;
>
> 	h = exp(xy.x / aks0);
> 	g = .5 * (h - 1. / h);
> 	h = cos(P->phi0 + xy.y / aks0);
> 	lp.phi = asin(sqrt((1. - h * h) / (1. + g * g)));

> //	if ((xy.y + P->phi0) < 0.) lp.phi = -lp.phi; /* instead of if 
> ((xy.y) < 0.) lp.phi = -lp.phi;*/  <-------

(Continue reading)

Gerald Evenden | 2 Jun 03:26 2005
Picon
Picon

Re: bug in PJ_tmerc.c ?

Ignore my previous correction to the spherical tmerc inverse.

Current spherical inverse code now contains (from PP1395):

     double D = xy.y / aks0 + P->phi0, xp = xy.x / aks0;

     lp.phi = asin(sin(D) / cosh(xp));
     lp.lam = atan2(sinh(xp), cos(D));

The above is what will be in the next release of libproj4.  Sign of phi
carries through automatically.  The problem code must have been a
messed up carry over from GCTP as I have not touched  the
spherical stuff in years.  Obviously, no one else has been using it.

For pre C99 compilers that cannot handle hyperbolic functions:
it is time to update.  :-)

Thanks for the error report.  And I apologize for the previous
erroneous quicky correction.
_____________________________________
Jerry and the low riders: Daisy Mae and Joshua.
"The whole religious complexion of the modern world is due to the
absence from Jerusalem of a lunatic asylum." Havelock Ellis, 1914

_______________________________________________
Proj mailing list
Proj <at> xserve.flids.com
http://xserve.flids.com/mailman/listinfo/proj

(Continue reading)

john | 2 Jun 21:20 2005
Picon

Re: bug in PJ_tmerc.c ?


Thanks a lot for confirming the problem and the fix! I will try it at work
next week. 

p.s. I doubt if people still use C99 compilers :)

Best Regards

> Date: Wed, 01 Jun 2005 21:26:29 -0400
> From: Gerald Evenden <gerald.evenden <at> verizon.net>
> Subject: Re: [Proj] bug in PJ_tmerc.c ?
> To: "PROJ.4 and general Projections Discussions"
> <proj <at> xserve.flids.com>
> Message-ID: <dea42dd2d62aaaaffad81ebebbe215f1 <at> verizon.net>
> Content-Type: text/plain; charset=US-ASCII; format=flowed
> 
> Ignore my previous correction to the spherical tmerc inverse.
> 
> Current spherical inverse code now contains (from PP1395):
> 
>     double D = xy.y / aks0 + P->phi0, xp = xy.x / aks0;
> 
>     lp.phi = asin(sin(D) / cosh(xp));
>     lp.lam = atan2(sinh(xp), cos(D));
> 
> The above is what will be in the next release of libproj4.  Sign of phi
> carries through automatically.  The problem code must have been a
> messed up carry over from GCTP as I have not touched  the
> spherical stuff in years.  Obviously, no one else has been using it.
> 
(Continue reading)

skoehler | 8 Jun 09:54 2005
Picon

JNI support under windows

Hello,

I have download the proj 4.4.9 source and compiled under cygwin. I plane 
to use the JNI-support, but I have no dynamic linked library (jproj.dll).
Under .libs I found the libproj.a only.
How can I create the dll, is there an precompiled proj 4.4.9 for windows 
with jni support?

with best regards
Steffen Köhler

_______________________________________________
Proj mailing list
Proj <at> xserve.flids.com
http://xserve.flids.com/mailman/listinfo/proj

Frank Warmerdam | 8 Jun 14:10 2005
Picon

Re: JNI support under windows

On 6/8/05, skoehler <at> buschjena.de <skoehler <at> buschjena.de> wrote:
> Hello,
> 
> I have download the proj 4.4.9 source and compiled under cygwin. I plane
> to use the JNI-support, but I have no dynamic linked library (jproj.dll).
> Under .libs I found the libproj.a only.
> How can I create the dll, is there an precompiled proj 4.4.9 for windows
> with jni support?

Steffen,

I looked in proj/src/makefile.vc, and I see that jniproj.c is not built into
the normal DLL but it likely ought to be.  However, the makefile would
also have to be altered to include the JNI includes directives. 

I don't have a version of the DLL built this way, but it shouldn't be too
hard to alter things to do this.  

Note that it should be sufficient to build proj.dll (including the JNI
support) rather than have a separate jproj.dll. 

Best regards,
--

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam <at> pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent
_______________________________________________
Proj mailing list
Proj <at> xserve.flids.com
(Continue reading)

imteyaz | 20 Jun 12:13 2005
Picon

proj problem

Dear all, 
I am new to proj. I have a raster map projected in
"init=epsg:27585"on which I 
am placing points in latitude and longitude using 
PROJECTION
  "init=epsg:4326"
END
Everything works well. Now for search purposes, I need
to convert these lat 
long coordinates into meters. Which projection do I
use? I have tried to 
convert my lat long with proj +init=epsg:4326  <<EOF
> 10 20
> EOF
Rel. 4.4.9, 29 Oct 2004
<proj>:
+proj=latlong unsuitable for use with proj program.
program abnormally terminated

This is what I get.
CAn anyone please help?

Thanks

Imteyaz Khodabux
Consultant
Life Science section
Division of Basic and Engineering Sciences
UNESCO
1,Rue Miollis
(Continue reading)

Craig Miller | 20 Jun 15:56 2005
Picon

RE: proj problem

EPSG 4326 is Geographic Coordinates, or the equivalent of a globe (spherical
coordinates).  In order to measure something in meters you will need to
project your data into planar coordinates.  In order to decide which
projection formula to use you will need to first answer a few questions
about the data and what you intend to use it for.

Why do you need to convert to meters?  Are you measuring the area of a land
feature?  Are you using the map to navigate with a compass?

What part of the world does the data you are using cover (E.g. Seattle, WA /
State of Oklahoma / United States / All of Europe)?

--Craig

-----Original Message-----
From: imteyaz [mailto:imteyaz <at> yahoo.com] 
Sent: Monday, June 20, 2005 3:13 AM
To: proj <at> xserve.flids.com
Subject: [Proj] proj problem

Dear all, 
I am new to proj. I have a raster map projected in
"init=epsg:27585"on which I 
am placing points in latitude and longitude using 
PROJECTION
  "init=epsg:4326"
END
Everything works well. Now for search purposes, I need
to convert these lat 
long coordinates into meters. Which projection do I
(Continue reading)

mahsa takapoomanesh | 29 Jun 09:59 2005
Picon

Using proj with VC++

Dear All,
 
I'm a new proj user, I downloaded a proj.dll and it does not work with VC++.
 
Please help
 
Regards
Mahsa

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

_______________________________________________
Proj mailing list
Proj <at> xserve.flids.com
http://xserve.flids.com/mailman/listinfo/proj

Gmane