[mapserver-users] srid dropped at postgis request

Laurent BAEY laurent.baey at free.fr
Fri Feb 4 09:18:07 EST 2011


Hello

I found the problem causing the error :
There was another condition in the request, from a layer filter I thought
was irrelevent to my problem.

select
encode(AsBinary(force_collection(force_2d("the_geom")),'NDR'),'hex') as
geom,"id_zc" from zones where the_geom &&
GeomFromText('POLYGON((259333.658097445 1733700,259333.658097445
2015600.125,682466.310652555 2015600.125,682466.310652555
1733700,259333.658097445 1733700))',27572) and (id_psl =
get_psl_zone(126378) AND level=55)

everything was back to normal when I changed it to 

select
encode(AsBinary(force_collection(force_2d("the_geom")),'NDR'),'hex') as
geom,"id_zc" from zones where the_geom &&
GeomFromText('POLYGON((259333.658097445 1733700,259333.658097445
2015600.125,682466.310652555 2015600.125,682466.310652555
1733700,259333.658097445 1733700))',27572) and id_zc=16686

I believe the problem is now postgis related : if there's a function in
the where clause, postgis seems to be lost with srids.

Regards.

Laurent



On Fri, 04 Feb 2011 10:08:01 +0100, Laurent BAEY <laurent.baey at free.fr>
wrote:
> Hello
> 
> I was playing with the viewer to try to get out of the shape extent, to
> see if it was drawing related. The bbox wasn't the good one, sorry.
> I've the same result with the original one :
> 
> [MapServer Error]: msPostGISLayerWhichShapes(): Error (ERROR: Operation
on
> two geometries with different SRIDs ) executing query: select
> encode(AsBinary(force_collection(force_2d("the_geom")),'NDR'),'hex') as
> geom,"id_zc" from zones where the_geom &&
> GeomFromText('POLYGON((259333.658097445 1733700,259333.658097445
> 2015600.125,682466.310652555 2015600.125,682466.310652555
> 1733700,259333.658097445 1733700))',27572)
> 
> I also have :
> SELECT srid(the_geom) FROM zones WHERE "it's the one i want to draw",
> returns 27572.
> 
> I also found that when the AsBinary function comes, the srid is lost and
> becomes -1.
> 
> SELECT sr_id(AsBinary(force_collection(force_2d("the_geom")),'NDR'))
FROM
> zones WHERE "it's the one i want to draw", returns -1
> 
> and postgis doesn't want to execute the request.
> 
> Any idea ?
> 
> Regards
> 
> Laurent
> 
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users


More information about the mapserver-users mailing list