This project is read-only.

Geometry performance

Sep 3, 2010 at 6:54 PM
Edited Sep 3, 2010 at 7:29 PM

I just started using DeepEarth and I already have a question.

I used LocalMaps example, placed a Geometry Layer in map, and added 50-70 polygons each with many points. It works and they are displayed with the right format and in the right place. The problem is with performance during pan and zoom. These operations are very slow and the layer I have added lags behind the background layer in LocalMap example. I have set UpdateMode to ElementUpdate.

Here is what I basically do:

  • new GeometryLayer(map)
  • map.Layers.Add(newLayer)
  • for each polygon
    • new ObservableCollection<Point>
    • add points to ObservableCollection<Point>
    • new Polyg(color, color, width)
    • newPoly.points = new ObservableCollection<Point>
    • newLayer.Add(newPoly)

 

Am I doing something wrong? Is there a tutorial or example for what I am doing?

Sep 3, 2010 at 8:42 PM

I'm not an expert, but I think that if you set the layer to TransformUpdate it will instead pan and scale your lines to match the map, instead of recalculating the line positions every time from latitude and longitude which is expensive in terms of performance. I've tried it with 4000 points and it keeps up.

However make sure all the lines on your layer shows at all zoom levels. Mine don't... See one of my other posts for a YouTube video. If you get it working let us know!

Andy

Sep 3, 2010 at 8:55 PM

Thanks Andy for your quick response.

Do I still need to create the point in lat and long if I use TransformUpdate? I just changed it to TransformUpdate and the polygons are not displayed at all. At least the performance is very good :)

Sep 3, 2010 at 9:13 PM
Edited Sep 3, 2010 at 9:15 PM

I think the ElementUpdate vs TransformUpdate is only for DeepEarth to know how to manipulate the geometry layer. The data input format should be the same.

Are your polygons small? Try creating a single large (i.e. the size of France) polygon and see if that works. I would suspect that you are running into the same issues I did with short lines not being shown at close in zoom levels.

Andy

Sep 3, 2010 at 9:30 PM

Thanks again Andy.

I found the problem. I did not explain the workflow completely. I added a  layer on the map but then added more layers to the first layer and added polygons to secondary layers. I set TransforMode to all layers but I should have set it only on those that have polygons. It is much faster now. Great stuff.

Sep 3, 2010 at 9:36 PM

It works at all zoom levels?

Would you mind posting your exact layer init code and polygon data so I can try it? You can contact me through britishideas dot com if you don't want to make it public.

Are you using the SVN trunk, SL4 branch or the last released stable version from 2009?

thanks, Andy

Sep 3, 2010 at 10:30 PM

As far as I can tell, it works for all zoom level. I am using the 2009 release.

Any idea if something similar exists in Bing map control? Sorry to ask this in this forum.

 

Andy,

I sent you a message using your forum profile contact.

Sep 4, 2010 at 12:22 AM

I've only been using the current SVN version so I went back and tested the Jan 2009 release with my line.

Sorry, but it is still broken. See this video I just made: http://www.youtube.com/watch?v=xRRHP3iu0zo

I am at a loss to understand why some people have no problems, but for me everything that I try is broken. If someone would post a geometry layer that uses a LineString (or LineStringControl) that works then at least I could see what the difference might be and maybe I can fix it in my code or Deep Earth...

Andy

Sep 4, 2010 at 6:33 AM

Solved. See: http://deepearth.codeplex.com/Thread/View.aspx?ThreadId=224876&ANCHOR#Post489156