[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[udig-devel] layer.getResource(FeatureSource.class, null) refreshing
|
Hello,
I am having a little problem retrieving features from a layer object, and I dont know if it is normal or not.
The following typical code is not returning up to date results in my udig app.
FeatureSource source = layer.getResource(FeatureSource.class, null);
if (source!=null){
FeatureCollection features = source.getFeatures();
System.out.println("SIZE "+ features.size());
}
The layer is a WFS layer from mapserver which access a mysql database, and as mapserver does not support WFS-T, I am inserting new features directly into the database.
INSERT INTO positionReal(id, msGeometry) VALUES (8, GeomFromText('POINT(-4 8.2)',4326));
I can see that after executing this sql insert, the new feature is displayed in the map as soon as I refresh the layer or I pan or do any getMap request, which is great :)
Also, the getFeature request to the server returns a list with the new feature : http://localhost:8080/cgi-bin/mywfs?SERVICE=WFS&VERSION=1.0.0&request=getfeature&typename=PositionReal :)
But the code above sometimes (most times) keeps returning the old list of features without the new point.
Do you have any idea why? Is there any way to update the FeatureSource? maybe it is using some kind of cache....
I wonder why rendering the wfs layer, which probably uses a similar code, detects the new feature, and this code does not...
Thank you!!!
______________________
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.
______________________