[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [udig-devel] Question: how to clone uDig Layer?
|
On Tuesday 09 December 2008 17:25:59 Stephen Kilburn wrote:
> uDig 1.1 doesn't seem to like sharing an instance of Layer between
> instances of Map. If I create multiple instances of Map and assign the
> same Layers to them (using Map.getLayersInternal().add(Layer) ) , only the
> last Map any given Layer has been assigned to has that Layer. I conclude
> that I need to clone the shared Layers and assign a clone to each map.
You are right.
>
>
>
> Is there an easy way to do this? I don't see a deep copy constructor in
> the Layer interface. I also don't see anything in LayerFactory that looks
> like it will clone a layer.
The layers are views of persistent object (Features) then you should create a
new store (shape file or table,..) and insert the feature copies in the new
store.
Perhaps, you could find if there is any utility class in Geotools, or take a
look at es.axios.udig.extensions (ex: buffer spatial operation), and develop
the a "Copy or Clone Spatial Operation".
To download the source files
- http://www.axios.es/
- In Download page select es.axios.udig.extensions-1.1.9-rc10-src.zip
cheers
>
> _____________________________________________________________
> Stephen Kilburn
> GeoPraxis Inc.
Mauricio Pazos
Director
www.axios.es