On Fri, Feb 8, 2013 at 7:59 AM, Piotr Zduńczyk <[email protected]> wrote:
> I implement selection tool and to have better performance I cached
> features rendered on map ( because only this can be selected by user) .
> This functionality is also used with snapping it is faster to filter on
> features in cache than looking into database especially when multilayer
> snapping is on.
>
You have to clone the features before returning them to the renderer, or
setup a FeatureSource reporting
that it does not support detached features in its capabilities. Here is the
test done by the streaming
renderer to avoid feature/geometry cloning:
private boolean isCloningRequired(MapLayer layer, LiteFeatureTypeStyle[]
lfts) {
// check if the features are detached, we can thus modify the
geometries in place
final Set<Key> hints = layer.getFeatureSource().getSupportedHints();
if(!hints.contains(Hints.FEATURE_DETACHED))
return true;
...
Cheers
Andrea
>
> Peter
>
> W dniu 2013-02-08 03:39, Jody Garnett pisze:
>
> Can I ask what you are trying to accomplish with a list of features
> already on the map? Perhaps there is another way to accomplish what you are
> after?
>
> --
> Jody Garnett
>
> On Thursday, 7 February 2013 at 8:06 PM, Piotr Zduńczyk wrote:
>
> Thanks for Your replay.
> It sheds some light on reasons why it is done in such a way.
>
> Peter
>
> W dniu 2013-02-06 23:36, Jody Garnett pisze:
>
> We do not as a rule cache any features - in part so we can work with
> massive content.
>
> As a framework we want to be as light on resources as possible, and
> leave it up to applications that use uDig to choose when (and what) to
> cache.
>
> There is a cache checkbox in the style editor you can tick as an
> experimental option, it keeps the features in a spatial index (and pull
> features in as needed as your scroll around. It is very effective when
> working with things like WFS.
>
> The second question is a bit more interesting, wanting features in world
> coordinates.
>
> If you want to do that make a request of the feature source and fill in
> the viewport CRS in the Query object. The features will be reprojected as
> they come out of the database or shapefile. Indeed in some cases the data
> sources supports native reproduction allowing us to do less work in uDig.
>
> Note that the features that are drawn on screen are subject to
> "decimation" by the rendering engine, we throw out coordinates on the fly,
> based on the math transform constructed between the original data, the
> world CRS and the affine transformation to the screen. The earlier we can
> throw out coordinates the less information involved in drawing, and the
> faster we can update the screen.
>
> Jody
>
>
>
>
> On Wed, Feb 6, 2013 at 10:33 PM, Piotr Zduńczyk <[email protected]> wrote:
>
> Hi,
>
> Is any possibility in uDig to get all features rendered on map?
> Is there any cache or something like that?
> I was previously collect features in BasicFeatureRenderer by caching
> features in BasicRenderListener but from uDig 1.3 features have coordinates
> recalculated from work to pixel, and I want features with word coordinates..
> Any ideas how to do that?
>
> Thanks,
> Peter
>
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel
>
>
>
>
> _______________________________________________
> User-friendly Desktop Internet GIS
> (uDig)http://udig.refractions.nethttp://lists.refractions.net/mailman/listinfo/udig-devel
>
>
>
> --
> *Piotr Zduńczyk*
> Inżynier Oprogramowania
>
> Globema Sp. z o.o.
> ul. Wita Stwosza 22
> 02-661 Warszawa
> tel. (+48) 22 848 73 13 wew. 313
> fax (+48) 22 848 68 83
> www.globema.com/pl/
>
>
> "Treść tej wiadomości może zawierać prawnie chronione informacje poufne.
> Jeśli otrzymaliście ją Państwo przez pomyłkę, prosimy o niezwłoczne
> powiadomienie o tym nadawcy oraz jej usunięcie z Państwa komputera, bez
> wykonywania dystrybuowania lub zatrzymywania jakiejkolwiek jej kopii.
>
> This message may contain confidential information protected by law. If you
> have received this message by mistake, please immediately inform the sender
> of the mistake and delete this message from your system without making,
> distributing or retaining any copies of it."
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel
>
>
>
>
> _______________________________________________
> User-friendly Desktop Internet GIS
> (uDig)http://udig.refractions.nethttp://lists.refractions.net/mailman/listinfo/udig-devel
>
>
>
> --
> *Piotr Zduńczyk*
> Inżynier Oprogramowania
>
> Globema Sp. z o.o.
> ul. Wita Stwosza 22
> 02-661 Warszawa
> tel. (+48) 22 848 73 13 wew. 313
> fax (+48) 22 848 68 83
> www.globema.com/pl/
>
>
> "Treść tej wiadomości może zawierać prawnie chronione informacje poufne.
> Jeśli otrzymaliście ją Państwo przez pomyłkę, prosimy o niezwłoczne
> powiadomienie o tym nadawcy oraz jej usunięcie z Państwa komputera, bez
> wykonywania dystrybuowania lub zatrzymywania jakiejkolwiek jej kopii.
>
> This message may contain confidential information protected by law. If you
> have received this message by mistake, please immediately inform the sender
> of the mistake and delete this message from your system without making,
> distributing or retaining any copies of it."
>
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel
>
>
--
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.
==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel