[postgis-users] help needed - cygwin problem ??

ujunge at pmcentral.com ujunge at pmcentral.com
Fri Apr 16 14:13:11 PDT 2004


hi,

could somebody with cygwin and proj4-enabled postgis (0.8.0 or 0.8.1)
execute the following statement (Sample I):

select transform(GeometryFromText('POLYGON(
(-100 40,-95 35,-90 40,-100 40),
(-90 40,-85 35,-80 40,-90 40),
(-80 40,-75 35,-70 40,-80 40)
',4326),102008)


you should get this result  :

"SRID=102008;POLYGON((-321422.376139526
6782.16004346922,86576.5464327124 -587173.095684438,481954.732587098
15257.0301726444,-321422.376139526 6782.16004346922),(481954.732587098
15257.0301726444,950223.985284901 -532438.02513163,1279973.89353734
108273.27 (..)"


and than execute the following statement  (Sample II):

select transform(GeometryFromText('POLYGON(
(-100 40,-95 35,-90 40,-100 40),
(-90 40,-85 35,-80 40,-90 40)
',4326),102008)


what is your result ?


 - i get this :

"SRID=102008;POLYGON((3.71641966749079e+113
40.0000077724644,3.71641966749079e+113
35.0000077724644,3.71641966749079e+113
40.0000077724644,3.71641966749079e+113
40.0000077724644),(3.71641966749079e+113
40.0000077724644,3.71641966749079e+113 35.0000077724644 (..)"



is it my installation or is there a memory-misalignment in the code of
postgis_transform.c ?


later on, i added some debugging code to the function in order to list the
point-values,
it lists the point values before (Verbose I)  this c-statement

line 395 in 0.8.1>    poly_pts = (POINT3D *) ( (char
*)&(poly->npoints[poly->nrings] )  );

and afterwards (Verbose II).


I get follwoing results:

Sample I, Verbose I:

Rings: 3 Points total: 12
Ring:0 I:0 X:8.48798e-314  Y:-100 Z:40
Ring:0 I:1 X:0  Y:-95 Z:35
Ring:0 I:2 X:0  Y:-90 Z:40
Ring:0 I:3 X:0  Y:-100 Z:40
Ring:1 I:0 X:8.48798e-314  Y:-100 Z:40
Ring:1 I:1 X:0  Y:-95 Z:35
Ring:1 I:2 X:0  Y:-90 Z:40
Ring:1 I:3 X:0  Y:-100 Z:40
Ring:2 I:0 X:8.48798e-314  Y:-100 Z:40
Ring:2 I:1 X:0  Y:-95 Z:35
Ring:2 I:2 X:0  Y:-90 Z:40
Ring:2 I:3 X:0  Y:-100 Z:40

Sample I, Verbose 2:

I:0 X:-100  Y:40 Z:0
I:1 X:-95  Y:35 Z:0
I:2 X:-90  Y:40 Z:0
I:3 X:-100  Y:40 Z:0
I:4 X:-90  Y:40 Z:0
I:5 X:-85  Y:35 Z:0
I:6 X:-80  Y:40 Z:0
I:7 X:-90  Y:40 Z:0
I:8 X:-80  Y:40 Z:0
I:9 X:-75  Y:35 Z:0
I:10 X:-70  Y:40 Z:0
I:11 X:-80  Y:40 Z:0


Sample II, Verbose 1:

Rings: 2 Points total: 8
Ring:0 I:0 X:1.97626e-323  Y:-100 Z:40
Ring:0 I:1 X:0  Y:-95 Z:35
Ring:0 I:2 X:0  Y:-90 Z:40
Ring:0 I:3 X:0  Y:-100 Z:40
Ring:1 I:0 X:1.97626e-323  Y:-100 Z:40
Ring:1 I:1 X:0  Y:-95 Z:35
Ring:1 I:2 X:0  Y:-90 Z:40
Ring:1 I:3 X:0  Y:-100 Z:40

Sample II, Verbose 2:

I:0 X:0  Y:1.59438e-314 Z:5.32701e-315
I:1 X:0  Y:1.59434e-314 Z:5.3262e-315
I:2 X:0  Y:-9.25597e+61 Z:5.32702e-315
I:3 X:0  Y:1.59438e-314 Z:5.32701e-315
I:4 X:0  Y:1.5943e-314 Z:5.32701e-315
I:5 X:0  Y:1.59426e-314 Z:5.3262e-315
I:6 X:0  Y:1.59422e-314 Z:5.32701e-315
I:7 X:0  Y:1.5943e-314 Z:5.32701e-315


Conclusion

1) the points have a meainingful value for Sample I
    both before and after the c-statement

2) for Sample II the points do not have a meaningfull value after the
c-statement.
    Of cource, the re-projections fails than very often and is anyway
meaningless.

What is actually happening here ?



Uwe Junge
PMCentral Systems, Inc.
4201 Pinefield Court
Fairfax, Virginia 22033

Tel: +1 (703) 378-0952




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.656 / Virus Database: 421 - Release Date: 4/9/2004




More information about the postgis-users mailing list