Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] udig translations

--4dc92e8f_631f1690_2bc5
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

<div>
            <div>
                <span>There is a layer.refresh method=3F why remove/add g=
eoresource again=3F<br>
                </span>
                <span><br>--&nbsp;<br>Jody Garnett<br><br></span>
               =20
                <=21-- <p style=3D=22color: =23a0a0a0;=22>On Tuesday, 10 =
May 2011 at 9:44 PM, Joaqu=C3=ADn Rodriguez-Guerra Urcelay wrote:</p> -->=

                <p style=3D=22color: =23a0a0a0;=22>On Tuesday, 10 May 201=
1 at 9:44 PM, Joaqu=C3=ADn Rodriguez-Guerra Urcelay wrote:</p>
                <blockquote type=3D=22cite=22 style=3D=22border-left-styl=
e:solid;border-width:1px;margin-left:0px;padding-left:10px;=22>
                    <span><div><div>I have seen that removing/adding geor=
esource from layer is not the cause of the warning.<br>I think I finally =
understood that the warning comes from modifying the features in a new te=
mporary resource, and setting this resource in the layer, instead of modi=
fying the features directlr in the layers current georesource.<br>Then I =
can safely remove/add georesource in layer to force the refresh. :)<br>Ch=
eers,<br>Joaqu=C3=ADn <br>=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F<=
br>De: <a href=3D=22mailto:udig-devel-bounces=40lists.refractions.net=22>=
udig-devel-bounces=40lists.refractions.net</a> =5B<a href=3D=22mailto:udi=
g-devel-bounces=40lists.refractions.net=22>udig-devel-bounces=40lists.ref=
ractions.net</a>=5D En nombre de Joaqu=C3=ADn Rodriguez-Guerra Urcelay =5B=
<a href=3D=22mailto:jrguerra=40gmv.com=22>jrguerra=40gmv.com</a>=5D<br>En=
viado el: martes, 10 de mayo de 2011 12:52<br>Para: User-friendly Desktop=
 Internet GIS<br>Asunto: Re: =5Budig-devel=5D WARNING: Bounds crs not def=
ined; assuming bounds from schema<br><br>Thanks Jody,<br><br>I noticed th=
at If I add an empty temporaryResource to the map, I dont get any warning=
<br><br>                IGeoResource tempResource =3D catalog.createTempo=
raryResource(path=46eatureType);<br>                Layer layer=3D layer=46=
actory.createLayer(tempResource);<br>                layer.setBounds(new =
ReferencedEnvelope(new Envelope (-180, 180, -90, 90), DefaultGeographicCR=
S.WGS84));<br>                layer.setCRS(DefaultGeographicCRS.WGS84);<b=
r>                System.out.println(layer.getBounds(null, DefaultGeograp=
hicCRS.WGS84));<br>                System.out.println(layer.getGeoResourc=
e().getInfo(null).getBounds());<br><br>ReferencedEnvelope=5B-180.0 : 180.=
0, -90.0 : 90.0=5D<br>ReferencedEnvelope=5B0.0 : -1.0, 0.0 : -1.0=5D<br><=
br>and If I modify the feature in the temporary resource, then I dont get=
 the warning neither.<br><br>                                        // A=
dd new feature to a new igeoresource<br>                                 =
      IGeoResource newGeoresource ==3D layer.getGeoResource();<br>       =
                                F=46eatureStore fs =3DnewGeoresource.reso=
lve(=46eatureStore.class, null);<br>                                     =
  F=46eatureCollection features =3D =46eatureCollections.newCollection();=
<br>                                        features.add(feature);<br>   =
                                    fs.addF=46eatures(features);<br><br>T=
he problem was ocurring If I created a new temporary resource with new va=
lues, and then replace layer's georesource with the new one.<br><br>     =
                          IGeoResource newGeoresource ==3D catalog.create=
TemporaryResource(path=46eatureType);<br>                                =
System.out.println(=22CR =22 +newGeoresource.getInfo(null).getBounds().to=
String());<br>                                =46eatureStore fs =3DnewGeo=
resource.resolve(=46eatureStore.class, null);<br>                        =
       F=46eatureCollection features =3D =46eatureCollections.newCollecti=
on();<br>                                features.add(feature);<br>      =
                         fs.addF=46eatures(features);<br>                =
               System.out.println("=22CD =22 +newGeoresource.getInfo(null=
).getBounds().toString());<br>                                // Delete o=
ld georesources from layer and add the new one, then refresh<br>         =
                      List&lt;IGeoResource&gt; georesources==3Dlayer.getG=
eoResources();<br>                                while(georesources.size=
()&gt;0)=7B<br>                                        georesources.remov=
e(georesources.size()-1);<br>                                =7D<br>     =
                          layer.getGeoResources().add(newGeoresource);<br=
r><br><br>CR ReferencedEnvelope=5B0.0 : -1.0, 0.0 : -1.0=5D<br>CD Referen=
cedEnvelope=5B-6.0 : 14.0, -10.0 : 20.0=5D<br><br>Although bounds were be=
ing updated correctly from =5B0.0 : -1.0, 0.0 : -1.0=5D to =5B-6.0 : 14.0=
, -10.0 : 20.0=5D :) , I think the remove/add georesouce thing from layer=
 is not the best way to go. I had to do it this way because I needed to f=
orce the renderer to redraw the layer with the modifications, but right n=
ow it is working and refreshing just updating the features in the georeso=
uce, so problem solved by now :)<br><br>Cheers<br><br><br>=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F<br>De: <a href=3D=22mailto:udig-devel-boun=
ces=40lists.refractions.net=22>udig-devel-bounces=40lists.refractions.net=
</a> =5B<a href=3D=22mailto:udig-devel-bounces=40lists.refractions.net=22=
>udig-devel-bounces=40lists.refractions.net</a>=5D En nombre de Jody Garn=
ett =5B<a href=3D=22mailto:jody.garnett=40gmail.com=22>jody.garnett=40gma=
il.com</a>=5D<br>Enviado el: martes, 10 de mayo de 2011 10:57<br>Para: Us=
er-friendly Desktop Internet GIS<br>Asunto: Re: =5Budig-devel=5D WARNING:=
 Bounds crs not defined; assuming bounds from schema<br><br>Interesting; =
here is what the warning means.<br><br>- we keep a bounding box for the d=
ata as part of the IGeoResoruceInfo (so if you hit zoom to layer this is =
the bounds that it uses)<br>- if it cannot find a value there; it looks a=
t the CRS for the layer and makes a =22guess=22 - that is what this warni=
ng is about.<br><br>So perhaps our temporary resource code needs the abil=
ity to set the IGeoResourceInfo bounds=3F<br><br>--<br>Jody Garnett<br><b=
r><br>On Tuesday, 10 May 2011 at 4:13 PM, Joaqu=C3=ADn Rodriguez-Guerra U=
rcelay wrote:<br><br>Hello,<br><br>I was wondering if this warning is fam=
iliar to any of you...<br>I have created a layer containing a TemporaryRe=
source (code below) , and it works correctly, but everytime it needs to b=
e rendered, I get the following warning:<br><br>09-may-2011 12:55:35 org.=
geotools.map.=46eatureLayer getBounds<br>WARNING: Bounds crs not defined;=
 assuming bounds from schema are correct for AbstractDataStore.Abstract=46=
eatureLocking(PathType (4))<br><br>Is there any way to set the CRS so I d=
ont get the warning all the time=3F=3F I have tried setting CRS in the la=
yer, and also in the featureBuilder :S<br><br>IGeoResource newGeoresource=
 =3DD catalog.createTemporaryResource(path=46eatureType);<br>=46eatureSto=
re fs =3DnewGeoresource.resolve(=46eatureStore.class, null);<br>=46=46eat=
ureCollection features =3D =46eatureCollections.newCollection();<br>featu=
res.add(feature);<br>fs.add=46eatures(features);<br><br>// Delete old geo=
resources from layer and the new one<br>List&lt;IGeoResource&gt; georesou=
rces=3DpathLayer.getGeoResources();<br>while(georesources.size()&gt;0)=7B=
=7B<br>georesources.remove(georesources.size()-1);<br>=7D=7D<br>pathLayer=
.getGeoResources().add(newGeoresource);<br><br>pathLayer.setBounds(new Re=
ferencedEnvelope(new Envelope (-180, 180,, -90, 90), DefaultGeographicCRS=
.WGS84));<br>pathLayer.setCRS(DefaultGeographicCRS.WGS84);<br>pathLayer.r=
efresh(pathLayer.getBounds(null,DefaultGeographicCRRS.WGS84 ));<br><br>Th=
anks,<br><br>Joaqu=C3=ADn<br>=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
<br>De: udig-devel-bounces=40lists.refractions.net&lt;<a href=3D=22mailto=
:udig-devel-bounces=40lists.refractions.net=22>mailto:udig-devel-bounces=40=
lists.refractions.net</a>&gt; =5Budig-devel-bounces=40lists.refractions.n=
et&lt;<a href=3D=22mailto:udig-devel-bounces=40lists.refractions.net=22>m=
ailto:udig-devel-bounces=40lists.refractions.net</a>&gt;=5D En nombre de =
Joaqu=C3=ADn Rodriguez-Guerra Urcelay =5Bjrguerra=40gmv.com&lt;<a href=3D=
=22mailto:jrguerra=40gmv.com=22>mailto:jrguerra=40gmv.com</a>&gt;=5D<br>E=
nviado el: viernes, 06 de mayo de 2011 11:04<br>Para: User-friendly Deskt=
op Internet GIS<br>Asunto: Re: =5Budig-devel=5D Dynamic =46eatures Layer =
Refresh<br><br>I found a way around the problem, instead of using layer.s=
etGeoresource(..) for changing the georesource in the layer, I now remove=
 the old georesource and add the new one with the following code, and it =
seems to work correctly :)<br><br>layer.getGeoResources().remove(0);<br>l=
ayer.getGeoResources().add(newGeoresource);<br><br>cheers,<br><br>Joaqu=C3=
=ADn<br>=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F<br>De: udig-devel-=
bounces=40lists.refractions.net&lt;<a href=3D=22mailto:udig-devel-bounces=
=40lists.refractions.net=22>mailto:udig-devel-bounces=40lists.refractions=
.net</a>&gt; =5Budig-devel-bounces=40lists.refractions.net&lt;<a href=3D=22=
mailto:udig-devel-bounces=40lists.refractions.net=22>mailto:udig-devel-bo=
unces=40lists.refractions.net</a>&gt;=5D En nombre de Joaqu=C3=ADn Rodrig=
uez-Guerra Urcelay =5Bjrguerra=40gmv.com&lt;<a href=3D=22mailto:jrguerra=40=
gmv.com=22>mailto:jrguerra=40gmv.com</a>&gt;=5D<br>Enviado el: jueves, 05=
 de mayo de 2011 18:42<br>Para: udig-devel=40lists.refractions.net&lt;<a =
href=3D=22mailto:udig-devel=40lists.refractions.net=22>mailto:udig-devel=40=
lists.refractions.net</a>&gt;<br>Asunto: =5Budig-devel=5D Dynamic =46eatu=
res Layer Refresh<br><br>Hello,<br><br>I am having some troube with a vec=
tor layer I created which I would like to modify programatically, and I h=
ave wiritten some code that works sometimes, and some times not. I would =
appreciate if you could tell me if I am I following the right approach fo=
r doing this..<br><br>I have a table of points that changes over the time=
, and I want to have a layer representing a line following all the points=
. =46or this, I created a Temporary Resource, and I added it as a layer:<=
br><br>// Create path layer<br>List&lt;ILayer&amp;ggt; layers =3D new Arr=
ayList&lt;ILayer&gt;();<br>IGeoResource tempResource =3D catalog.createTe=
mporaryResource(path=46eatureType);<br>Layer layer=3D layer=46actory.crea=
teLayer(tempResource);<br>layer.setName(GEORESOURCE=5FPATH=5FREAL);<br>la=
yers.add(layer);<br>map.sendCommandASync(new AddLayersCommand(layers));<b=
r><br>TThen, every time some one inserts a point in the table, I would li=
ke to recalculate the feature (the line) in the temporary resource and re=
draw it.<br><br><br>Coordinate=5B=5D coords=3D new Coordinate=5Bpositions=
Coords.size()=5D;<br>....... calculate new line.........<br>LineString li=
ne =3DD geometry=46actory.createLineString(coords);<br><br>// Create =46e=
ature containing the line string<br>// add the attributes in order<br>fea=
tureBuilder.add(line);<br>featureBuilder.add(1);<br>featureBuilder.add(=22=
=22Path=22);<br>// build the feature<br>Simple=46=46eature feature =3D fe=
atureBuilder.build=46eature(=22Path=22);<br><br>// Remove all features fr=
om igeoresource and add thee new one<br>IGeoResource georesource =3D path=
Layer.getGeoResource();<br>=46eatureStore fs =3D null;<br>fs =3D georesou=
rce.resolve(=46eatureStore.class, null);<br>fs.remove=46eatures(=46ilter.=
INCLUDE);<br>=46eatureCollection features =3D =46eatureCollections.newCol=
lection();<br>features.add(feature);<br>fs.add=46=46eatures(features);<br=
>pathLayer.setGeoResource(georesource);<br>=7D=7D<br><br>This piece of co=
de works sometimes, and I can see the new line drawn whenever I execute t=
his (in a command or action), but most time the line is not redrawn. I ha=
ve tried using layer.refresh(bounds), but It does not fix it. Is there an=
y other way to force the redraw of the layer=3F I can debug and see that =
the feature was correcly updated in the georesource...<br><br>Is this the=
 right approach for doing this=3F=3F or maybe there are some other ways t=
o do it=3F<br><br>Thanks=21<br><br>=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F<br>This message including any attachments may=
 contain confidential<br>information, according to our Information Securi=
ty Management System,<br>and intended solely for a specific individual to=
 whom they are addressed.<br>Any unauthorised copy, disclosure or distrib=
ution of this message<br>is strictly forbidden. If you have received this=
 transmission in error,<br>please notify the sender immediately and delet=
e it.<br><br>=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F<br>Este mensaje, y en su caso, cualquier fichero anexo al mismo,<b=
r>puede contener informacion clasificada por su emisor como confidencial<=
br>en el marco de su Sistema de Gestion de Seguridad de la<br>Informacion=
 siendo para uso exclusivo del destinatario, quedando<br>prohibida su div=
ulgacion copia o distribucion a terceros sin la<br>autorizacion expresa d=
el remitente. Si Vd. ha recibido este mensaje<br>erroneamente, se ruega l=
o notifique al remitente y proceda a su borrado.<br>Gracias por su colabo=
racion.<br><br>=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F<br><br>=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F<br>User-friendly Desktop Internet GIS (uDig)<br><a href=3D=22http:=
//udig.refractions.net=22>http://udig.refractions.net</a><br><a href=3D=22=
http://lists.refractions.net/mailman/listinfo/udig-devel=22>http://lists.=
refractions.net/mailman/listinfo/udig-devel</a><br><br><br>=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F<br>This message inclu=
ding any attachments may contain confidential<br>information, according t=
o our Information Security Management System,<br> and intended solely for=
 a specific individual to whom they are addressed.<br> Any unauthorised c=
opy, disclosure or distribution of this message<br> is strictly forbidden=
. If you have received this transmission in error,<br> please notify the =
sender immediately and delete it.<br><br>=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F<br>Este mensaje, y en su caso, cualquie=
r fichero anexo al mismo,<br> puede contener informacion clasificada por =
su emisor como confidencial<br> en el marco de su Sistema de Gestion de S=
eguridad de la<br>Informacion siendo para uso exclusivo del destinatario,=
 quedando<br>prohibida su divulgacion copia o distribucion a terceros sin=
 la<br>autorizacion expresa del remitente. Si Vd. ha recibido este mensaj=
e<br> erroneamente, se ruega lo notifique al remitente y proceda a su bor=
rado.<br>Gracias por su colaboracion.<br><br>=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F<br><br>=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F<br>User-friendly Desktop Internet GI=
S (uDig)<br><a href=3D=22http://udig.refractions.net=22>http://udig.refra=
ctions.net</a><br><a href=3D=22http://lists.refractions.net/mailman/listi=
nfo/udig-devel=22>http://lists.refractions.net/mailman/listinfo/udig-deve=
l</a><br><br>=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F<br>This message including any attachments may contain confidential=
 <br>information, according to our Information Security Management System=
,<br> and intended solely for a specific individual to whom they are addr=
essed.<br> Any unauthorised copy, disclosure or distribution of this mess=
age<br> is strictly forbidden. If you have received this transmission in =
error,<br> please notify the sender immediately and delete it.<br><br>=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F<br>Este m=
ensaje, y en su caso, cualquier fichero anexo al mismo,<br> puede contene=
r informacion clasificada por su emisor como confidencial<br> en el marco=
 de su Sistema de Gestion de Seguridad de la <br>Informacion siendo para =
uso exclusivo del destinatario, quedando <br>prohibida su divulgacion cop=
ia o distribucion a terceros sin la <br>autorizacion expresa del remitent=
e. Si Vd. ha recibido este mensaje <br> erroneamente, se ruega lo notifiq=
ue al remitente y proceda a su borrado. <br>Gracias por su colaboracion.<=
br><br>=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
<br><br>=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
<br>User-friendly Desktop Internet GIS (uDig)<br><a href=3D=22http://udig=
.refractions.net=22>http://udig.refractions.net</a><br><a href=3D=22http:=
//lists.refractions.net/mailman/listinfo/udig-devel=22>http://lists.refra=
ctions.net/mailman/listinfo/udig-devel</a><br></div></div></span>
               =20
               =20
               =20
               =20
                </blockquote>
               =20
                <div>
                    <br>
                </div>
            </div>
        </div>
--4dc92e8f_631f1690_2bc5--



Back to the top