I have done that but i get the following error:
cvc-complex-type.2.4.a: Invalid content was found starting with element 'ogc:Filter'. One of '{"http://www.opengis.net/sld":Symbolizer\}' is expected.
I take the same error if i use <Filter> instead of <ogc:Filter> Next are both ways I have tried among athers.
<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
xmlns="http://www.opengis.net/sld"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<NamedLayer>
<Name>land</Name>
<UserStyle>
<FeatureTypeStyle>
<FeatureTypeName>Feature</FeatureTypeName>
<Rule>
<Name>land</Name>
<MaxScaleDenominator>5000000</MaxScaleDenominator>
<Filter>
<Not>
<Within>
<PropertyName>the_geom</PropertyName>
<gml:Box>
<gml:coordinates>18.25,25 26.2,39.54</gml:coordinates>
</gml:Box>
</Within>
</Not>
</Filter>
....
<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
xmlns="http://www.opengis.net/sld"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<NamedLayer>
<Name>land</Name>
<UserStyle>
<FeatureTypeStyle>
<FeatureTypeName>Feature</FeatureTypeName>
<Rule>
<Name>land</Name>
<MaxScaleDenominator>5000000</MaxScaleDenominator>
<ogc:Filter>
<ogc:Not>
<ogc:Within>
<ogc:PropertyName>the_geom</ogc:PropertyName>
<gml:Box>
<gml:coordinates>18.25,25 26.2,39.54</gml:coordinates>
</gml:Box>
</ogc:Within>
</ogc:Not>
</ogc:Filter>
...
I have also tried adding and removing some different namespaces in the root without any success.
Regards
George
From: Chris Holmes <cholmes@anonymised.com>
To: Mad Cloud <mad_cloud@anonymised.com>
CC: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] coordinate filter
Date: Tue, 23 May 2006 14:06:54 -0400
You need to define the namespace for your gml. xmlns:gml="http://www.opengis.net/gml"
You can put it just where you bind the gml:
> <Rule>
> <Name>land</Name>
> <MaxScaleDenominator>5000000</MaxScaleDenominator>
> <Filter>
> <Not>
> <Within>
> <PropertyName>the_geom</PropertyName>
> <gml:Box xmlns:gml="http://www.opengis.net/gml">
> <gml:coordinates>100,150 -10,10</gml:coordinates>
> </gml:Box>
> </Within>
> </Not>
> </Filter>
Or you can put it at the root SLD element:
<StyledLayerDescriptor version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
xmlns="http://www.opengis.net/sld"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<NamedLayer>
<Name>Simple Roads</Name>
....
Which puts it global, so you only have to put it in once.
best regards,
Chris
Mad Cloud wrote:
Hi Chris,
Thanks for all your help!! The thing I want to do is to check when the map shown is not between the coordinates. The following code throws a "gml not bound prefix element for Box" and when i remove the prefix i get a "Invalid content was found starting with element 'Filter'" error. I use the "Filter Encoding Implementation Specification" documentation version 1.0.0.
<Rule>
<Name>land</Name>
<MaxScaleDenominator>5000000</MaxScaleDenominator>
<Filter>
<Not>
<Within>
<PropertyName>the_geom</PropertyName>
<gml:Box>
<gml:coordinates>100,150 -10,10</gml:coordinates>
</gml:Box>
</Within>
</Not>
</Filter>
...
George
From: Chris Holmes <cholmes@anonymised.com>
To: Mad Cloud <mad_cloud@anonymised.com>
CC: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] coordinate filter
Date: Mon, 22 May 2006 12:42:46 -0400
There's a whole set of geometry filters, that probably does most everything you need to based on a set of coordinates. It's unclear in your examples a) what GreaterThan means and b) how the coordinates should be interpreted - are they a line, a box, ect? If you read the Filter specification it will tell you all about the various operations on geometries. You can pass in full geometry objects as literals, and compare them against attributes.
Chris
Mad Cloud wrote:
Hello!
Is there a way to filter depending on the coordinates? What I mean is something like the following:
<ogc:Filter>
<ogc:PropertyIsGreaterThan>
<gml:coord>
<gml:X>100</gml:X>
<gml:X>150</gml:X>
<gml:Y>-10</gml:Y>
<gml:Y>10</gml:Y>
</gml:coord>
</ogc:PropertyIsGreaterThan>
</ogc:Filter>
Regards
GK
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
--
Chris Holmes
The Open Planning Project
http://topp.openplans.org
<< cholmes.vcf >>
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
--
Chris Holmes
The Open Planning Project
http://topp.openplans.org
<< cholmes.vcf >>
_________________________________________________________________
Don't just search. Find. Check out the new MSN Search! http://search.msn.com/