[mapserver-users] SV: Clipping out unprojectable area?

paalkr pal.kristensen at statkart.no
Mon May 25 05:12:25 PDT 2009


Hi, thanks for the help!

I tried your suggestion, but I didn't manage to get it to work correctly,
this is what I did:

Entered the following DATA statement:

DATA "geometri from ( select geometri, * from general.country where
ST_Intersection(geometri,GeomFromText('POLYGON((12 0,18 0,18 84,12 84,12
0))',4326)) ) AS country USING UNIQUE ogc_fid USING SRID=4326" 

but I then got the following error in the MapServer logfile:

[Mon May 25 14:03:08 2009].185400 msPostGISLayerWhichShapes query: select
encode(AsBinary(force_collection(force_2d("geometri")),'NDR'),'base64') as
geom,"ogc_fid" from ( select geometri, * from general.country where
ST_Intersection(geometri,GeomFromText('POLYGON((12 0,18 0,18 84,12 84,12
0))',4326)) ) AS country where geometri &&
GeomFromText('POLYGON((-5.89995617157446 59.7658748898858,-5.89995617157446
75.1604740311875,44.7675433183202 75.1604740311875,44.7675433183202
59.7658748898858,-5.89995617157446 59.7658748898858))',4326)

[Mon May 25 14:03:08 2009].187786 msPostGISLayerWhichShapes query status: 7

[Mon May 25 14:03:08 2009].187807 msPostGISLayerWhichShapes(): Query error.
Error (ERROR:  argument of WHERE must be type boolean, not type geometry

Anyone that can help with this?

Regards,
Pål Kristensen


Espen.Messel wrote:
> 
> Hi.
> 
> You could try something like this:
> 
> DATA "geometri from ( select geometri, * from general.country where
> ST_Intersection(geometri,GeomFromText('POLYGON((12 0,18 0,18 84,12 84,12
> 0))',4326)) ) AS FOO USING UNIQUE ogc_fid USING SRID=4326"
> 
> It's not very nice, but it works.
> 
> Regards,
> Espen
> 
> ----------------------------------------------------------------------
> Espen Messel
>  
> 
>> -----Opprinnelig melding-----
>> Fra: mapserver-users-bounces at lists.osgeo.org 
>> [mailto:mapserver-users-bounces at lists.osgeo.org] På vegne av paalkr
>> Sendt: 12. mai 2009 16:19
>> Til: mapserver-users at lists.osgeo.org
>> Emne: Re: [mapserver-users] Clipping out unprojectable area?
>> 
>> 
>> Hi!
>> 
>> I'm trying to achieve the same thing, but I need some hints 
>> on how to incorporate the spatial filter in the DATA 
>> statement. This is a snippet from my mapfile
>> 
>>       DATA "geometri from general.country USING UNIQUE 
>> ogc_fid USING SRID=4326"
>> 
>> and this is the spatial filter i try to apply
>> 
>>       ST_Intersection(geometri,GeomFromText('POLYGON((12 0,18 
>> 0,18 84,12
>> 84,12 0))',4326))
>> 
>> but I don't manage build the right the DATA statement!
>> 
>> Can someone please help with the DATA statement?
>> 
>> Regards,
>> Pål Kristensen 
>> 
>> 
>> Gregor at HostGIS wrote:
>> > 
>> > With some SQL know-how I did get the EPSG database merged 
>> with our own 
>> > spatial_ref_sys table (it has other mods for our uses, so this was
>> > trivial) and our program generating 
>> ST_Intersection(the_geom) statements.
>> > 
>> > This does work as expected, which is great. Thanks for 
>> another simple 
>> > and elegant solution, Christopher.
>> > 
>> > Now to cope with some of our data having self-intersecting polygons 
>> > which break such operators...
>> > 
>> > -- 
>> > Gregor Mosheh / Greg Allensworth    BS, A+, Network+, 
>> Security+, Server+
>> > System Administrator, Lead Programmer
>> > HostGIS development & hosting services, http://www.HostGIS.com/
>> > 
>> > "Remember that no one cares if you can back up,
>> >   only if you can restore." - AMANDA
>> > _______________________________________________
>> > mapserver-users mailing list
>> > mapserver-users at lists.osgeo.org
>> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
>> > 
>> > 
>> 
>> 
>> -----
>> 
>> Regards,
>> Pål Kristensen
>> --
>> View this message in context: 
>> http://n2.nabble.com/Clipping-out-unprojectable-area--tp229984
> 7p2869427.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
>> 
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
> 


-----

Regards,
Pål Kristensen
-- 
View this message in context: http://n2.nabble.com/Clipping-out-unprojectable-area--tp2299847p2969326.html
Sent from the Mapserver - User mailing list archive at Nabble.com.




More information about the MapServer-users mailing list