[postgis-users] Postgis Transform Problem

Vincent Schut schut at sarvision.com
Wed Jun 25 02:10:26 PDT 2003


On Wednesday 25 June 2003 07:35, Benjamin Wragg wrote:
> I'm having a problem with the transform function in Postgis. If I run
> the following query:
>
> select transform(GeometryFromText('MULTIPOLYGON(((112 -45 ,112 -10 ,155
> -10 ,155 -45,112 -45)))',4326),54004)
>
> I get:
>
> SRID=54004;MULTIPOLYGON(((12467782.9688466
> -5591295.91855339,12467782.9688466 -1111475.10285223,17254521.0729574
> -1111475.10285223,17254521.0729574 -5591295.91855339,12467782.9688466
> -5591295.91855339)))
>
> But if I do:
>
> select transform(GeometryFromText('MULTIPOLYGON(((-180 -90 ,-180 90 ,180
> 90 ,180 -90,-180 -90)))',4326),54004)
>
> I get:
>
> Error: transform: couldn't project polygon
> Warning: Error occurred while executing PL/pgSQL function transform
> Warning: line 2 at return
>
> Any ideas why? I turned the postgresql log level to debug5 to see if I
> could get more detailed errors, but it's exactly the same error. I'm
> running postgresql 7.3.2, postgis 0.7.5 and proj 4.4.7
>
> Thanks,
>
> Benjamin Wragg

Benjamin,
just my 2c but have you tried with numbers that are very close to but not 
exactly on the poles, like 179.999 instead of 180.0? I could imagine that 
reporjection has problems with theses extreme latlon coordinates, especially 
when projecting these to a real projection that smears out the poles. I think 
54004 is some Mercator projection, isn't it? Isn't the north/southpole 
actually in an arbitrary position in this projection, I mean, it is the mere 
upper line of the mercator rectangle that represents the exact northpole. 
Rather hard to project a point to an entire line....

Regards,

-- 
______________________________________
Vincent Schut
Sarvision B.V.
Wageningen, The Netherlands
www.sarvision.com



More information about the postgis-users mailing list