[MAPSERVER-USERS] [Postgis] Intersection on requested data

G. Tiemens Gerben.Tiemens at grontmij.nl
Thu Oct 30 06:19:29 EDT 2008


For some reason the copy paste didn't  work, so here a repost of the error of
Mapserver:

<?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
<!DOCTYPE ServiceExceptionReport SYSTEM
"http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd">
<ServiceExceptionReport version="1.1.1">
<ServiceException>
msDrawMap(): Image handling error. Failed to draw layer named
&#39;KLLine&#39;.
prepare_database(): Query error. Error declaring cursor: ERROR:  syntax
error at or near &quot;POLYGON&quot;
LINE 1: ...ST_Intersection(kl_l.the_geom , ST_GeomFromText(&#39;
POLYGON((1...
                                                             ^

With query string: DECLARE mycursor BINARY CURSOR FOR SELECT
&quot;ck_6thmklc&quot;::text,&quot;ct_6dkel00&quot;::text,asbinary(force_collection(force_2d(ST_Intersection(kl_l.the_geom
, ST_GeomFromText(&#39; POLYGON((165607  387820 , 165651  387813 , 165672 
387759 , 165598  387800 , 165607  387820 )) &#39;  , 28992)
))),&#39;NDR&#39;),gid::text from kl_l WHERE (ST_Intersects(kl_l.the_geom ,
ST_GeomFromText(&#39;POLYGON((165607  387820 , 165651  387813 , 165672 
387759 , 165598  387800 , 165607  387820 ))&#39; , 28992) )) and
(ST_Intersection(kl_l.the_geom , ST_GeomFromText(&#39; POLYGON((165607 
387820 , 165651  387813 , 165672  387759 , 165598  387800 , 165607  387820
)) &#39;  , 28992) ) &amp;&amp; setSRID( &#39;BOX3D(165700 387800,165800
387900)&#39;::BOX3D,find_srid(&#39;&#39;,&#39;kl_l&#39;,&#39;ST_Intersection(kl_l.the_geom
, ST_GeomFromText(&#39; POLYGON((165607  387820 , 165651  387813 , 165672 
387759 , 165598  387800 , 165607  387820 )) &#39;  , 28992) )&#39;) ))

</ServiceException>
</ServiceExceptionReport>



G. Tiemens wrote:
> 
> To add to my previous post:
> 
> This is the error given by MapServer:
> 
> 
> 
> Greetings
> 
> Gerben
> 
> -----Oorspronkelijk bericht-----
> Van: mapserver-users-bounces at lists.osgeo.org
> [mailto:mapserver-users-bounces at lists.osgeo.org] Namens G. Tiemens
> Verzonden: Wednesday, October 29, 2008 4:12 PM
> Aan: mapserver-users at lists.osgeo.org
> Onderwerp: [MAPSERVER-USERS] [Postgis] Intersection on requested data
> 
> 
> Hello all,
> 
> Is it possible to do an intersection on the requested data?
> 
> I want to make a data query to the postgis, where the data will be
> intersected and delivered to mapserver for display process.
> 
> Here is what i already reached:
> 
> CONNECTIONTYPE postgis
> CONNECTION 'host=127.0.0.1 user=postgres password=postgres dbname=OM'
> DATA  "the_geom FROM kl_l  USING UNIQUE gid USING SRID = 28992"
> FILTER "ST_Intersects(kl_l.the_geom , ST_GeomFromText('POLYGON((165607
> 387820 , 165651  387813 , 165672  387759 , 165598  387800 , 165607  387820
> ))' , 28992) )"
> 
> This works fine. The data returned is the features that intersect. But
> this returns the whole feature, instead of the intersection part itself.
> 
> So i tried to get the intersection:
> 
> CONNECTIONTYPE postgis
> CONNECTION 'host=127.0.0.1 user=postgres password=postgres dbname=OM'
> DATA  "ST_Intersection(kl_l.the_geom , ST_GeomFromText('POLYGON((165607
> 387820 , 165651  387813 , 165672  387759 , 165598  387800 , 165607  387820
> ))' , 28992) ) FROM kl_l USING UNIQUE gid USING SRID = 28992"
> FILTER "ST_Intersects(kl_l.the_geom , ST_GeomFromText('POLYGON((165607
> 387820 , 165651  387813 , 165672  387759 , 165598  387800 , 165607  387820
> ))' , 28992) )"
> 
> 
> The full query works fine on the postgis database:
> 
> select ST_Intersection(kl_l.the_geom , ST_GeomFromText('POLYGON((165607
> 387820 , 165651  387813 , 165672  387759 , 165598  387800 , 165607  387820
> ))' , 28992) ) FROM kl_l where ST_Intersects(kl_l.the_geom ,
> ST_GeomFromText('POLYGON((165607  387820 , 165651  387813 , 165672  387759
> ,
> 165598  387800 , 165607  387820 ))' , 28992) )
> 
> 
> The part where mapserver is complaining is the single quote just before
> POLYGON in the DATA statement.
> I tried single quotes inside double quotes, tried double quotes inside
> single quotes,  both give the same error.
> 
> Is there any way of retrieving the intersected features?
> 
> Greets
> 
> Gerben
> 
> --
> View this message in context:
> http://www.nabble.com/-Postgis--Intersection-on-requested-data-tp20229230p20229230.html
> Sent from the Mapserver - User mailing list archive at Nabble.com.
> 
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
> << Please read our E-mail Disclaimer at the Grontmij Corporate website >>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
> 

-- 
View this message in context: http://www.nabble.com/-Postgis--Intersection-on-requested-data-tp20229230p20243971.html
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the mapserver-users mailing list