GetMap function taking more time

Nov 9, 2011 at 4:16 AM

We are working on shaprMap 0.9.0.0 version. GetMap function taking more time to execute the functionality. So our application becoming slow. Pl give any idea to resolve this. Thanks in advance.

regards,

subrahmanyam

Coordinator
Nov 9, 2011 at 6:16 AM

Slower than what? It used to be quicker? Or is it just slow from the beginning?

To aid you with that question, we need to know more about the kinds of layers, dataproviders you are using.

A good place to start is probably to filter out some features in regard to your Zoom factor.

Hth FObermaier

Nov 9, 2011 at 6:50 AM

Thanks for immediate response.

We are running the application with two layers one for Bing tiles and another for countries. When we debug the application GetMap function actually taking nearly 3 to 5 seconds to execute the functionality and other code run fast as expected.

regards,

subrahmanyam

Coordinator
Nov 9, 2011 at 6:53 AM

Try this:

Open your Internet Explorer settings and under Connection  uncheck "Automatcially detect proxy settings".

This is an issue that is fixed in newer versions of Brutile that will be updated in SharpMap soon.

Nov 12, 2011 at 8:22 AM

We unchecked the "Automatcially detect proxy settings" but still no improvement.

we are developing a product for oil wells using shaprMap 0.9.0.0 version. Our application reads data from the database about the oil wells (contains latitude and logitude of each well point) and plots the information along with differnt shape files on map using sharpMap dll with the following operations zoomin,zoomout,zoomfit,pan, selection etc.

we are using the following code

System.Drawing.Image img = _map.GetMap();

where _map is the sharpmap object.

Example: we are getting the following values while debugging the application with four layers  Bing Tiles,country shape file ,Argentina shape file and Brazil shape file.

a) _Center = {POINT (-5601394.37764329 -1830699.6258639)}

b) _Zoom = 6220735.5446022246

c) Envelope = {-8711762.14994441,-4335388.16871253 -2491026.60534218,673988.916984723}

d) PixelHeight = 9107.9583376313676

e) PixelSize = 9107.9583376313676

f) PixelWidth = 9107.9583376313676

g) MapHeight = 5009377.0856972523

h) _Size = {Width = 683 Height = 550}

We are also facing another problem frequently. Some times map not displying in our canvas. after multiple refreshes or zoomfit only map coming.

Please give idea to resolve this issue. Thanks in advanse.

Thanks and regards,

subrahmanyam

Coordinator
Nov 14, 2011 at 8:30 AM

Could you try to evaluate which of your layers is causing the performance hit by e.g. introducing a stopwatch to the rendering cycle?

Once you've identified the layer(s) in question, we can help you speed it up.

Cheers FObermaier

Nov 14, 2011 at 9:02 AM

Bing Tile layer taking more time, next country layer taking more time

Coordinator
Nov 14, 2011 at 9:51 AM

Now, if BingTileLayer is running slow, this can have two causes:

  1. Internet connection is slow
  2. There is something wrong with the proxy settings.

If it is case 2, please try disableing proxy for the Bing tile url.

For the shapefile, do you use/create a spatial index for it? If it has many features, it might be a good choice to divide it into sections for different zoom levels to speed up the rendering. Also it does matter how complex the polygons are, so you may want to simplify them for a broader view.

Hth FObermaier

Nov 21, 2011 at 6:53 PM
MSsubrahmanyam wrote:

Thanks for immediate response.

We are running the application with two layers one for Bing tiles and another for countries. When we debug the application GetMap function actually taking nearly 3 to 5 seconds to execute the functionality and other code run fast as expected.

regards,

subrahmanyam

3-5 seconds don't seems to me too much... 

I see this: h) _Size = {Width = 683 Height = 550} that means something like 1 MB (in bitmap) - per operation! Application have to download 1 MB (or whatever is the image weight) in each one of your operation

Reading "We are also facing another problem frequently. Some times map not displying in our canvas. after multiple refreshes or zoomfit only map coming." seems like a bandwidth problem

Try to navigate in bing site and do a performance test

Dec 1, 2011 at 11:52 AM

 Application wroking very fast (neary 3sec) under development server. But when we run the application using IIS 7.5 and IE9 in Win7 x64 Enterprise it seems to be very very slow (taking neary 40seconds). Pl give any idea to resolve this. Thanks in advance.

Coordinator
Dec 1, 2011 at 2:47 PM

Please make sure you have disabled "Automatcially detect proxy settings" as petlof suggested.

BruTile's next release will circumvent this necessity. For the time being, you can use one of the forks of BruTile, compile that yourself and use that instead of the one supplied by NuGet.

Hth FObermaier