|
View:
New views
18 Messages
—
Rating Filter:
Alert me
|
|
|
how to refresh a layerHi all,
I have tried to render GPS data in udig: I save the GPS position data in gml file and then render it as a point on udig map. So it requires refreshing this layer again and again. Howerver, after refreshing 5 times(the GPS point moves 5 times on map), the point disappeared. I have to restart udig, and then it moves 5 times and disappeared again. What on earth is the matter? thanks, redstar _______________________________________________ User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net http://lists.refractions.net/mailman/listinfo/udig-devel |
|
|
Re: how to refresh a layerHi redstar,
you do not tell us how you do the drawing. I guess you do it on a mapgraphic and the refresh the region drawn? Is it possible that some imprecision makes the bounding box to refresh be not in line with the symbol of the gps? In BeeGIS I do the exactly same thing from a NMEA file (or GPS direct obviously). To draw the GPS position I use a draw command. You can see it here: https://svn.dev.cocos.bz/svnroot/jgrass/jgrass3.0/community/moovida/beegisplugins/eu.hydrologis.jgrass.gpsnmea/src/eu/hydrologis/jgrass/gpsnmea/animation/GpsPositionDrawCommand.java Ciao Andrea On Sat, Nov 7, 2009 at 9:09 AM, redstar <redstarfx@...> wrote: > Hi all, > > I have tried to render GPS data in udig: I save the GPS position data in > gml file and then render it as a point on udig map. > So it requires refreshing this layer again and again. Howerver, after > refreshing 5 times(the GPS point moves 5 times on map), > the point disappeared. I have to restart udig, and then it moves 5 times > and disappeared again. What on earth is the matter? > > thanks, redstar > > > _______________________________________________ > 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.net http://lists.refractions.net/mailman/listinfo/udig-devel |
|
|
Re: how to refresh a layerThanks, Andrea.
I render the point by gml datasource in udig, and it displayed as a image defined by geotool PointSymbolizer _______________________________________________ User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net http://lists.refractions.net/mailman/listinfo/udig-devel |
|
|
Re: how to refresh a layerIs it caused by udig cache mechanism?
2009/11/7 redstar <redstarfx@...> Thanks, Andrea. _______________________________________________ User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net http://lists.refractions.net/mailman/listinfo/udig-devel |
|
|
Re: how to refresh a layerHmmm, I think I remember when I started I used a mapgraphic and the
continuos redraw of the layer or parts of it at some point always broke. I guess it is dues to the fact that if it doesn't finish to refresh and the next event comes, it is queued and at some point it stalls and discard stuff. Andrea On Sat, Nov 7, 2009 at 9:43 AM, redstar <redstarfx@...> wrote: > Is it caused by udig cache mechanism? > > 2009/11/7 redstar <redstarfx@...> >> >> Thanks, Andrea. >> I render the point by gml datasource in udig, and it displayed as a image >> defined by geotool PointSymbolizer > > > _______________________________________________ > 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.net http://lists.refractions.net/mailman/listinfo/udig-devel |
|
|
Re: how to refresh a layerbut it woud disappear even i refresh the layer every 1min. it's long enough for udig to finish.
2009/11/7 andrea antonello <andrea.antonello@...> Hmmm, I think I remember when I started I used a mapgraphic and the _______________________________________________ User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net http://lists.refractions.net/mailman/listinfo/udig-devel |
|
|
Re: how to refresh a layerThe layer method refresh should schedule the layer to be redrawn; it
takes either null or the region of the screen to be redrawn. Is this how you are asking the layer to redraw? Jody On Sun, Nov 8, 2009 at 12:01 AM, redstar <redstarfx@...> wrote: > but it woud disappear even i refresh the layer every 1min. it's long enough > for udig to finish. > > 2009/11/7 andrea antonello <andrea.antonello@...> >> >> Hmmm, I think I remember when I started I used a mapgraphic and the >> continuos redraw of the layer or parts of it at some point always >> broke. I guess it is dues to the fact that if it doesn't finish to >> refresh and the next event comes, it is queued and at some point it >> stalls and discard stuff. >> >> Andrea >> >> On Sat, Nov 7, 2009 at 9:43 AM, redstar <redstarfx@...> wrote: >> > Is it caused by udig cache mechanism? >> > >> > 2009/11/7 redstar <redstarfx@...> >> >> >> >> Thanks, Andrea. >> >> I render the point by gml datasource in udig, and it displayed as a >> >> image >> >> defined by geotool PointSymbolizer >> > >> > >> > _______________________________________________ >> > 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.net >> http://lists.refractions.net/mailman/listinfo/udig-devel > > > _______________________________________________ > 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.net http://lists.refractions.net/mailman/listinfo/udig-devel |
|
|
Re: how to refresh a layerI used these cod to refresh the layer:
ILayer layer = LayerUtil.getLayerByName("GPS"); layer.refresh(ApplicationGIS.getActiveMap().getBounds(null)); However, I can see the point moved and moved out of a box bound(quite samll bound than map bound), and then disappeared. 2009/11/8 Jody Garnett <jody.garnett@...>
The layer method refresh should schedule the layer to be redrawn; it _______________________________________________ User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net http://lists.refractions.net/mailman/listinfo/udig-devel |
|
|
Re: how to refresh a layer> I used these cod to refresh the layer:
> > ILayer layer = LayerUtil.getLayerByName("GPS"); > layer.refresh(ApplicationGIS.getActiveMap().getBounds(null)); By memory (don't have my environment up yet) the following should refresh the whole layer: layer.refresh(null); > However, I can see the point moved and moved out of a box bound(quite samll > bound than map bound), and then disappeared. The best would be if you could supply the real bounding box you need to refresh. Ciao Andrea > > > > 2009/11/8 Jody Garnett <jody.garnett@...> >> >> The layer method refresh should schedule the layer to be redrawn; it >> takes either null or the region of the screen to be redrawn. Is this >> how you are asking the layer to redraw? >> >> Jody >> > > _______________________________________________ > 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.net http://lists.refractions.net/mailman/listinfo/udig-devel |
|
|
Re: how to refresh a layeryeah, i have tried that and it dont work as well.
And i also tried these code and got the same result: ILayer layer = LayerUtil.getLayerByName("GPS"); Envelope env = new Envelope(x-100,x+100,y-100,y+100); layer.refresh(env); 2009/11/9 andrea antonello <andrea.antonello@...>
_______________________________________________ User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net http://lists.refractions.net/mailman/listinfo/udig-devel |
|
|
Re: how to refresh a layerThe gps.bmp shows the point is moving out of a bound.
2009/11/9 andrea antonello <andrea.antonello@...>
_______________________________________________ User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net http://lists.refractions.net/mailman/listinfo/udig-devel |
|
|
Re: how to refresh a layerhi redstar,
this really seems to be that the wrong bounding box is passed. Are you sur you are passing it in the proper coordinate system? I remember it being inworld coordinates and it has to have the proper crs, so it has to be a referencedenvelope (this all comes from memory, so doublecheck it) Andrea On Mon, Nov 9, 2009 at 9:27 AM, redstar <redstarfx@...> wrote: > The gps.bmp shows the point is moving out of a bound. > > > > > > 2009/11/9 andrea antonello <andrea.antonello@...> >> >> > I used these cod to refresh the layer: >> > >> > ILayer layer = LayerUtil.getLayerByName("GPS"); >> > layer.refresh(ApplicationGIS.getActiveMap().getBounds(null)); >> >> By memory (don't have my environment up yet) the following should >> refresh the whole layer: >> layer.refresh(null); >> >> > However, I can see the point moved and moved out of a box bound(quite >> > samll >> > bound than map bound), and then disappeared. >> >> The best would be if you could supply the real bounding box you need to >> refresh. >> >> Ciao >> Andrea >> >> >> >> > >> > >> > >> > 2009/11/8 Jody Garnett <jody.garnett@...> >> >> >> >> The layer method refresh should schedule the layer to be redrawn; it >> >> takes either null or the region of the screen to be redrawn. Is this >> >> how you are asking the layer to redraw? >> >> >> >> Jody >> >> >> > >> > _______________________________________________ >> > 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.net >> http://lists.refractions.net/mailman/listinfo/udig-devel > > > _______________________________________________ > 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.net http://lists.refractions.net/mailman/listinfo/udig-devel |
|
|
Re: how to refresh a layerHi,
andrea antonello wrote: > hi redstar, > this really seems to be that the wrong bounding box is passed. > Are you sur you are passing it in the proper coordinate system? I > remember it being inworld coordinates and it has to have the proper > crs, so it has to be a referencedenvelope (this all comes from memory, > so doublecheck it) how about forcing a complete refresh (no bbox?): ILayer layer = LayerUtil.getLayerByName("GPS"); layer.refresh( null ); > > Andrea > > > > On Mon, Nov 9, 2009 at 9:27 AM, redstar <redstarfx@...> wrote: >> The gps.bmp shows the point is moving out of a bound. >> >> >> >> >> >> 2009/11/9 andrea antonello <andrea.antonello@...> >>>> I used these cod to refresh the layer: >>>> >>>> ILayer layer = LayerUtil.getLayerByName("GPS"); >>>> layer.refresh(ApplicationGIS.getActiveMap().getBounds(null)); >>> By memory (don't have my environment up yet) the following should >>> refresh the whole layer: >>> layer.refresh(null); >>> >>>> However, I can see the point moved and moved out of a box bound(quite >>>> samll >>>> bound than map bound), and then disappeared. >>> The best would be if you could supply the real bounding box you need to >>> refresh. >>> >>> Ciao >>> Andrea >>> >>> >>> >>>> >>>> >>>> 2009/11/8 Jody Garnett <jody.garnett@...> >>>>> The layer method refresh should schedule the layer to be redrawn; it >>>>> takes either null or the region of the screen to be redrawn. Is this >>>>> how you are asking the layer to redraw? >>>>> >>>>> Jody >>>>> >>>> _______________________________________________ >>>> 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.net >>> http://lists.refractions.net/mailman/listinfo/udig-devel >> >> _______________________________________________ >> 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.net > http://lists.refractions.net/mailman/listinfo/udig-devel > > > User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net http://lists.refractions.net/mailman/listinfo/udig-devel |
|
|
Re: how to refresh a layerI get the same result.
2009/11/9 Ugo Taddei <ugo.taddei@...>
how about forcing a complete refresh (no bbox?): _______________________________________________ User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net http://lists.refractions.net/mailman/listinfo/udig-devel |
|
|
Re: how to refresh a layerI'm sure i have the proper crs. and i have tried these code: ReferencedEnvelope re = new ReferencedEnvelope(env,layer.getCRS()); layer.refresh(re); But the problem is not solved. 2009/11/9 andrea antonello <andrea.antonello@...> hi redstar, _______________________________________________ User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net http://lists.refractions.net/mailman/listinfo/udig-devel |
|
|
Re: how to refresh a layerOn Monday 09 November 2009 07:31:57 am redstar wrote:
> I used these cod to refresh the layer: > > ILayer layer = LayerUtil.getLayerByName("GPS"); > layer.refresh(ApplicationGIS.getActiveMap().getBounds(null)); > > > However, I can see the point moved and moved out of a box bound(quite samll > bound than map bound), and then disappeared. We are using the following code to refresh the entire layer. ILayer target = ... IMap map = ... map.getRenderManager().refresh(target, map.getBounds(new NullProgressMonitor())); Also, it could be interesting to have a look in MapImpl.getBounds method, please pay attention in the following line bbox = layer.getBounds(null, getViewportModel().getCRS()) cheers -- Mauricio Pazos www.axios.es _______________________________________________ User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net http://lists.refractions.net/mailman/listinfo/udig-devel |
|
|
Re: how to refresh a layerThank you very much.
I have solved the problem, and I'd like to share it. The problem is caused by bouds. I use gml datasource to render map. And in gml datasource, there are some code like: Envelope temp = new Envelope(); CoordinateReferenceSystem crs=ft.getDefaultGeometry().getCoordinateSystem(); FeatureIterator iter = source.getFeatures().features(); try{ while( iter.hasNext() ) { Feature element = iter.next(); if( temp.isNull() ) temp.init(element.getBounds()); else temp.expandToInclude(element.getBounds()); } }finally{ iter.close(); } bounds=new ReferencedEnvelope(temp,crs); So, if you don't set the bounds in GML, udig would calculate it for you. As a result, every layer have diffrent bounds and the layer which contains only one point have very small bounds. And then, when the point move, it will move out of the bounds quickly. 2009/11/10 Mauricio Pazos <mauricio.pazos@...>
_______________________________________________ User-friendly Desktop Internet GIS (uDig) http://udig.refractions.net http://lists.refractions.net/mailman/listinfo/udig-devel |
|
|
Re: how to refresh a layerAn alternate we could do is to guess the bounds based on the extent of
the CRS used; this would result in "extra" draw requests when nothing is on the screen. Thank you for explaining the issue. jody On Wed, Nov 11, 2009 at 12:03 PM, redstar <redstarfx@...> wrote: > Thank you very much. > I have solved the problem, and I'd like to share it. > > The problem is caused by bouds. I use gml datasource to render map. And in > gml datasource, there are some code like: > > Envelope temp = new Envelope(); > CoordinateReferenceSystem > crs=ft.getDefaultGeometry().getCoordinateSystem(); > FeatureIterator iter = > source.getFeatures().features(); > try{ > while( iter.hasNext() ) { > Feature element = iter.next(); > if( temp.isNull() ) > temp.init(element.getBounds()); > else > temp.expandToInclude(element.getBounds()); > } > }finally{ > iter.close(); > } > bounds=new ReferencedEnvelope(temp,crs); > > So, if you don't set the bounds in GML, udig would calculate it for you. As > a result, every layer have diffrent bounds and the layer which contains only > one point have very small bounds. And then, when the point move, it will > move out of the bounds quickly. > > > > > 2009/11/10 Mauricio Pazos <mauricio.pazos@...> >> >> On Monday 09 November 2009 07:31:57 am redstar wrote: >> > I used these cod to refresh the layer: >> > >> > ILayer layer = LayerUtil.getLayerByName("GPS"); >> > layer.refresh(ApplicationGIS.getActiveMap().getBounds(null)); >> > >> > >> > However, I can see the point moved and moved out of a box bound(quite >> > samll >> > bound than map bound), and then disappeared. >> We are using the following code to refresh the entire layer. >> >> ILayer target = ... >> IMap map = ... >> map.getRenderManager().refresh(target, map.getBounds(new >> NullProgressMonitor())); >> >> Also, it could be interesting to have a look in MapImpl.getBounds method, >> please pay attention in the following line >> bbox = layer.getBounds(null, getViewportModel().getCRS()) >> >> >> cheers >> >> >> -- >> Mauricio Pazos >> www.axios.es >> > > > _______________________________________________ > 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.net http://lists.refractions.net/mailman/listinfo/udig-devel |
| Free embeddable forum powered by Nabble | Forum Help |