Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] What happens after layer.setfilter(filter)

Thank you all for the patch :)

I have a flight in a couple of hours and I wont be back until the 24th, but I cant wait to try it :)

Jody, one more question related to this subject... when we set a filter in a layer using layer.setFilter(filter) (Using a Select command), then the renderer is invoked, a wfs request is sent to the server, and finally the selected features are highlighted over the others.  Do you know who is responsible for highlighting the features? is the geotools renderer? or is it udig applying styles? I thought that uDig would add a new rule to the styleblackboard for highlighting features coming from that filter... but I cant see it when debugging.

Thanks!!

Joaquín 

________________________________________
De: Jody Garnett [jody.garnett@xxxxxxxxx]
Enviado el: viernes, 15 de abril de 2011 6:14
Para: User-friendly Desktop Internet GIS
CC: Joaquín Rodriguez-Guerra Urcelay; Patrick Jessup
Asunto: Re: [udig-devel] What happens after layer.setfilter(filter)

Okay we got our patch into GeoTools trunk. So next up we need to wait for the nightly build to deploy the 8-SNAPSHOT; and then try it out.
I am not sure if one of the other developers has changed net.refractions.udig.libs to use 8-SNAPSHOT yet; but we can find out.

To try things out you can use the generic geotools datastore wizard it will give you access to two new parameters; the parameters are documented here:
- http://docs.geotools.org/latest/userguide/guide/library/data/wfs.html

- wfs strategy - we can change this to force the system to use "mapserver" strategy; your server initially did not work because your executable is called *mywfs*; and the automatic code was looking for "mapserver" :-) You can now override this setting using this new parameter; and that may be enough for things to work out for you.

- filter compliance; we hooked up direct control of the filter compliance setting - but only for WFS 1.0 - so you can tell us if this is needed or not. If it is not useful we will remove it.

Related issue:
- https://jira.codehaus.org/browse/GEOT-3151
- https://jira.codehaus.org/browse/UDIG-1673

--
Jody Garnett


On Friday, 8 April 2011 at 7:09 PM, Joaquín Rodriguez-Guerra Urcelay wrote:

Thank you Jody!

I signed up in github and checked-out udig-platform in case you find the time to do any modification that I can test :)

I installed a mapserver and set up a layer connected to a mysql server in a test machine that we have:

http://212.0.113.22:8080/cgi-bin/mywfs?WIDTH=512&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities

I am now going to write to the geotools-user list to discuss the FilterEncodingPreProcessor

Joaquín

________________________________________
De: udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx<mailto:udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx> [udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx<mailto:udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx>] En nombre de Jody Garnett [jody.garnett@xxxxxxxxx<mailto:jody.garnett@xxxxxxxxx>]
Enviado el: viernes, 08 de abril de 2011 1:45
Para: User-friendly Desktop Internet GIS
Asunto: Re: [udig-devel] What happens after layer.setfilter(filter)

I went through the udig basic renderer code trying to find where the bbox filter (screen box) is added to initial fid filter, but it seems to me like this is done in the geotool's streaming renderer, does it make any sense??

Yes; we use the geotools rendering engine to draw wfs. It combines any filters we have in our style; with the current screen bounds to request features.

I don't think the problem is with the filter; it is with how we encode it (ie write out the xml request).

I will try and add a configuration property for you on the weekend I guess; it is the best I can do without being hired :-)

For your part can you test from the udig trunk code base (ie do you have a checkout or are you just working from the SDK?) Also do you have a mapserver URL we can test against?
I have tried to understand the FilterEncodingPreProcessor, but I am having some dificulties. I have created a filter composed by a fid filter and a comparation filter. My goal is to have them encoded on the same xml filter, but no luck. I have tried the 3 compliance levels, hoping that after accepting each visitor (one for each level) in the filter, I would be able to invoke visitor.getFilter and obtain the new filter, hopefully one of them encoded as I want, but I guess I didnt unerstand this correctly, right?
Thanks for looking at it; please take your example code and output to the geotools-user list and we can take up discussion there.

I suspect we will need a two part solution:
- a parameter to set compliance level for WFSDataStoreFactory
- an understanding of what FilterEncodingPreProcessor is doing


CODE:

org.geotools.xml.Configuration conf2 = new org.geotools.filter.v1_1.OGCConfiguration();

FilterFactory2 factory = CommonFactoryFinder.getFilterFactory2(null);
String fid1 = "FID.1";
Filter fidFilter= createFidFilter("FID.1");
Filter normalFilter = CQL.toFilter("id = 1");
FFilter filter = factory.and( fidFilter, normalFilter);

FilterEncodingPreProcessor visitor1 = new FilterEncodingPreProcessor(XMLHandlerHints.VALUE_FILTER_COMPLIANCE_LOW);
FilterEncodingPreProcessor visitor2 = new FilterEncodingPreProcessor(XMLHandlerHints.VALUE_FILTER_COMPLIANCE_MEDIUM);
FFilterEncodingPreProcessor visitor3 = new FilterEncodingPreProcessor(XMLHandlerHints.VALUE_FILTER_COMPLIANCE_HIGH);

System.out.println(""LOW");
Filters.accept(filter, visitor1);
org.geotools.xml.Encoder encoder = new org.geotools.xml.Encoder(conf2);
encoder.setIndenting(true);
encoder.setIndentSize(2);
encoder.encode(visitor1.getFilter(), org.geotools.filter.v1_1.OGC.Filter, System.out );
encoder = new org.geotools.xml.Encoder(conf2);
encoder.setIndenting(true);
encoder.setIndentSize(2);
encoder.encode( visitor1.getFFidFilter(), org.geotools.filter.v1_1.OGC.Filter, System.out );

System.out.println("MEDIUM");
Filters.accept(filter, visitor2);
encoder =D new org.geotools.xml.Encoder(conf2);
encoder.setIndenting(true);
encoder.setIndentSize(2);
encoder.encode( visitor2.getFilter(), org.geotools.filter.v1_1.OGC.Filter, System.out );
encoder = new org.geotools.xml.Encoder(conf2);
encoder.setIndenting(true);
encoder.setIndentSize(2);
encoder.encode( visitor2.getFidFilter(), org.geotools.filter.v1_1.OGC.Filter, System.out );

System.out.println(""HIGH");
Filters.accept(filter, visitor3);
encoder = new org.geotools.xml.Encoder(conf2);
encoder.setIndenting(true);
encoder.setIndentSize(2);
encoder.encode( visitor3.getFilter(), org.geotools.filter.v1_0.OGC.Filter, System.out );
encoder = new org.geotools.xml.Encoder(conf2);
encoder.setIndenting(true);
encoder.setIndentSize(2);
encoder.encode( visitor3.getFFidFilter(), org.geotools.filter.v1_1.OGC.Filter, System.out );

OUTPUT:


LOW
<?xml version="1.0" encoding="UTF-8"?>
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"; xmlns:gml="http://www.opengis.net/gml";>
<ogc:And>
<ogc:PropertyIsEqualTo matchCase="true">
<ogc:PropertyName>id</ogc:PropertyName>
<ogc:Literal>1</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:And>
</ogc:Filter>
<?xml version="1.0" encoding="UTF-8"?>
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"; xmlns:gml="http://www.opengis.net/gml"/>
MEDIUM
<?xml version="1.0" encoding="UTF-8"?>
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"; xmlns:gml="http://www.opengis.net/gml"/>
<?xml version="1.0" encoding="UTF-8"?>
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"; xmlns:gml="http://www.opengis.net/gml";>
<ogc:FeatureId fid="FID.1"/>
</ogc:Filter>
HIGH
<?xml version="1.0" encoding="UTF-8"?>
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"; xmlns:gml="http://www.opengis.net/gml"/>
<?xml version="1.0" encoding="UTF-8"?>
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"; xmlns:gml="http://www.opengis.net/gml";>
<ogc:FeatureId fid="FID.1"/>
</ogc:Filter>

Maybe I can ask questions about this visitor in the geotools list?
Anyways thanks for helping because this looks like it is what I need to fix my problem with mapserver requests :)

Joaquín
________________________________________
De: udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx<mailto:udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx> [udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx<mailto:udig-devel-bounces@xxxxxxxxxxxxxxxxxxxxx>] En nombre de Jody Garnett [jody.garnett@xxxxxxxxx<mailto:jody.garnett@xxxxxxxxx>]
Enviado el: jueves, 07 de abril de 2011 12:07
Para: User-friendly Desktop Internet GIS
Asunto: Re: [udig-devel] What happens after layer.setfilter(filter)

Hi Joaquín:

We may have more luck of lenient is set to false (ie we do not want to be lenient on how requests are constructed). Truth be told I dived right into the GeoTools code to see how the requests were constructed; and did not pay attention if there is an easy way to get from here to there.

We may end up writing one?

--
Jody Garnett


On Thursday, 7 April 2011 at 7:53 PM, Joaquín Rodriguez-Guerra Urcelay wrote:

Hi Jody,

I am sorry, but I get a bit lost with the strict setting, is it a connection parameter? if so, the one that looks more similar to strict might be lenient, but it is already set to true by default....

I played with this code for a while (adding strict=true to the url, I really dont know where else to put it), trying to create a filter composed by a fid filter and normal filters, but they never get mixed up in the same filter :( , I dont know how you managed to do it uDig.
Perhaps stepping through the code will help answer that question?

Let us try a different track and look at where the filter / xml code takes place:
- http://svn.osgeo.org/geotools/trunk/modules/library/xml/src/test/java/org/geotools/xml/filter/FilterEncodingPreProcessorTest.java

Do those test cases line up with your expectations?

It seems to come down to configuration line such as:


visitor = new FilterEncodingPreProcessor(XMLHandlerHints.VALUE_FILTER_COMPLIANCE_MEDIUM);


So if you can sort out what compliance level you would like we can add a connection parameter to allow it to be configured in that manner?

You could also take this up on the geotools users list, where Gabriel who looks after this module on occasion may be able to help?

Jody


______________________
This message including any attachments may contain confidential
information, according to our Information Security Management System,
and intended solely for a specific individual to whom they are addressed.
Any unauthorised copy, disclosure or distribution of this message
is strictly forbidden. If you have received this transmission in error,
please notify the sender immediately and delete it.

______________________
Este mensaje, y en su caso, cualquier fichero anexo al mismo,
puede contener informacion clasificada por su emisor como confidencial
en el marco de su Sistema de Gestion de Seguridad de la
Informacion siendo para uso exclusivo del destinatario, quedando
prohibida su divulgacion copia o distribucion a terceros sin la
autorizacion expresa del remitente. Si Vd. ha recibido este mensaje
erroneamente, se ruega lo notifique al remitente y proceda a su borrado.
Gracias por su colaboracion.

______________________

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel


______________________
This message including any attachments may contain confidential
information, according to our Information Security Management System,
and intended solely for a specific individual to whom they are addressed.
Any unauthorised copy, disclosure or distribution of this message
is strictly forbidden. If you have received this transmission in error,
please notify the sender immediately and delete it.

______________________
Este mensaje, y en su caso, cualquier fichero anexo al mismo,
puede contener informacion clasificada por su emisor como confidencial
en el marco de su Sistema de Gestion de Seguridad de la
Informacion siendo para uso exclusivo del destinatario, quedando
prohibida su divulgacion copia o distribucion a terceros sin la
autorizacion expresa del remitente. Si Vd. ha recibido este mensaje
erroneamente, se ruega lo notifique al remitente y proceda a su borrado.
Gracias por su colaboracion.

______________________

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel


______________________
This message including any attachments may contain confidential 
information, according to our Information Security Management System,
 and intended solely for a specific individual to whom they are addressed.
 Any unauthorised copy, disclosure or distribution of this message
 is strictly forbidden. If you have received this transmission in error,
 please notify the sender immediately and delete it.

______________________
Este mensaje, y en su caso, cualquier fichero anexo al mismo,
 puede contener informacion clasificada por su emisor como confidencial
 en el marco de su Sistema de Gestion de Seguridad de la 
Informacion siendo para uso exclusivo del destinatario, quedando 
prohibida su divulgacion copia o distribucion a terceros sin la 
autorizacion expresa del remitente. Si Vd. ha recibido este mensaje 
 erroneamente, se ruega lo notifique al remitente y proceda a su borrado. 
Gracias por su colaboracion.

______________________



Back to the top