Hi,
I want to know that which parameters needs to taken into account to improve rendering speed at the time of zoomin, zoomout.
Thanks,
Goral
To improve rendering speed
Hi Goral,
I think it depends on the concrete case. In general, the rendering speed is accept unless you are using some network layers like worldmapkit, google layer etc which will request the images from network. Or there are a large date local shape file need to render.
I am wondering if you are facing any performance issue during zoomin and zoomout? if yes, would you let us know more details on it?
Thanks,
Troy
Hi,
In my application I am plotting features using inmemoryfeaturelayer. Along with this I am loading shapefiles also. After loading all these stuff whenever user click zoom in button the response comes from system is little slow. As per this scenario what to check to improve or to make rendering smooth,
Thanks,
Goral
Hi Goral,
Would you mind to attach a sample or any codes here to show what the performance looks like? Can you let us know how many layers and features you are using in the map and how large of the shape files are? We want to have a summary on your scenario.
Thanks,
Troy
Hi,
Below is the code for simple point layer.
InMemoryFeatureLayer impoint =
new
InMemoryFeatureLayer();
impoint.FeatureSource.Open();
impoint.FeatureSource.BeginTransaction();
impoint.Columns.Add(
new
FeatureSourceColumn(
"Name"
));
impoint.ZoomLevelSet.ZoomLevel01.DefaultPointStyle =
new
PointStyle(PointSymbolType.Circle,
new
GeoSolidBrush(GeoColor.SimpleColors.Black), 1);
impoint.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
impoint.ZoomLevelSet.ZoomLevel05.DefaultTextStyle =
new
TextStyle(
"Name"
,
new
GeoFont(
"Arial"
, 8),
new
GeoSolidBrush(GeoColor.SimpleColors.LightYellow));
impoint.ZoomLevelSet.ZoomLevel05.DefaultTextStyle.XOffsetInPixel = 10;
impoint.ZoomLevelSet.ZoomLevel05.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
for
(
int
i = 0; i < dt.Rows.Count; i++)
{
Feature fpoint =
new
Feature(BaseShape.CreateShapeFromWellKnownData(
"POINT("
+ dt.Rows[
"Lon"
].ToString() +
" "
+ dt.Rows[
"Lat"
].ToString() +
")"
));
fpoint.ColumnValues.Add(
"Name"
, dt.Rows[
"Name"
].ToString());
impoint.InternalFeatures.Add(fpoint);
}
LayerOverlay lpoint =
new
LayerOverlay();
lpoint .Layers.Add(
"PointLayer"
, impoint);
wfMap.Overlays.Add(
"PointOverlay"
, lpoint);
This is one of the methods we are using to plot features like line,polygon with respective changes. Along with this we are loading terrain data shapefiles.
One more my doubt is if we are assigning different colors using valuestyle will it affect performance. And also throw lights on other aspects.
Thanks,
Goral
Goral,
The code looks fine and I test the InMemoryFeatureLayer with 3000 points and 3000 polygons but seems the performance is good. The attach is my test code based on yours.
Could you let me know how many points and line or polygons feature from the datatable? and how large are the terrain shape files?
If necessary, the whole codes on how you define the layers and add the features is appreciate. Or a video is better to show the performance. Here is a smart and useful tool which might helps on this. techsmith.com/jing.html
Thanks,
Troy
CreateAnInMemoryFeatureLayer.zip (1.84 KB)
Hi,
Thanks for reply. I will upload detail things and if possible vedio using suggested link in short time.
Thanks & Regards,
Goral
Okay, Goral, We will wait for your updates.
Troy
Hi,
I have attached code file. In that I have loaded only terrain file using value style. Please go through it and guide to improve.
Thanks & Regards,
Goral
001_frmContourlines.cs (15.4 KB)
Hi Goral,
Thanks for the sample codes and it is very useful.
We generate a new shapefile based on your codes and insert 3000 features into it. During our test, if we comment out the TextStyle, or set the default textstyle for each valueItem rather than apply the text style on all the feature, then seems the performance is much better. Would you please do a verify to see if the text style affect the performance?
If yes, I think this is because we apply this style from zoomlevel 01 to 20 which means the map will render all the text for all the features when the zoomlevel is high. It’s a good practice that we only display the label within a low level like from 10 to 20. But this depends on what’s your case.
If any questions or I am misunderstanding, please feel free to let me know.
Thanks,
Troy
Hi Goral,
Thanks for the sample codes and it is very useful.
We generate a new shapefile based on your codes and insert 3000 features into it. During our test, if we comment out the TextStyle, or set the default textstyle for each valueItem rather than apply the text style on all the feature, then seems the performance is much better. Would you please do a verify to see if the text style affect the performance?
If yes, I think this is because we apply this style from zoomlevel 01 to 20 which means the map will render all the text for all the features when the zoomlevel is high. It’s a good practice that we only display the label within a low level like from 10 to 20. But this depends on what’s your case.
If any questions or I am misunderstanding, please feel free to let me know.
Thanks,
Troy
Hi,
Thanks for reply. Ok I will try to remove textstyle from lower zoomlevels and check it.
Thanks & Regards,
Goral
Okay Goral,
Any question please let us know.
Troy
Hi,
I have tried to do performance check by removing textstyle for the layer. But not significance change is in performance. I think because of more number of color style applied rendering become slow.
Thanks & Regards,
Goral
Hi Groral,
After checking the code, following are some possible reasons that I can imagine, please take a check.
1. A big list of ValueItems is added to the ValueStyle, to some extent, it may slow down the performance a bit. Is it possible for your apply the Server Cache to some Overlays? which you don’t need to update the data in them. It will improve the performance a lot.
2. Can you try comments out the following data, and then rebuild the app to have a try.
tc.TextLineSegmentRatio = double.MaxValue;
tc.SplineType = SplineType.StandardSplining;
3. How many features loaded in the InMemoryFeatureLayer? Is there any complicated styles applied? Can you comment out to have a try to see if that’s the reason?
4. Please try commenting out all the Adornment related code, such as “GraticuleAdornmentLayer” in the demo code, to see if you got any improvement?
5. Can you try SingleTile to see if there is any improvement?
Regards,
Johnny
Hi,
Thanks for reply. I have gone through the points you have suggested.
1) Ya its required to give big list of value items. But can you suggest example of Server Cache because I have no idea about it.
2) In text style I want terrain related lables come aligned with lines thats why I have written given splinetype in text style. If any other thing can help please suggest.
3) In Inmemoryfeaturelayer features are loaded as per requirement. Its true sometime it has some complected style.
4) Ok. Its required to load Adornmentlayer along with other layers.
5) To apply tiling concept I am loading data block or regionwise.
Conclusion from all this point I got is, if more style and different types of layers together required then it will create little loss in performance.
Thanks & Regards,
Goral
Hi Goral,
1):For the cache Johnny mentioned, we can add cache support simply to assign the TileCache property for Overlays. For instance,
LayerOverlay layerOverlay = new LayerOverlay();
layerOverlay.TileCache = new FileBitmapTileCache(“D:\Cache”,“Desktop”);
2):We suggest you to comment the Splinetype is we want to narrow down if there are some potential properties to affect the performance. So, It should be worth to try and then roll back to see if the performance improve because of those properties.
3):Would you please try to comment out all the layers but the InMemoryFeatureLayer to see if we can narrow down the issue on InMemoryFeatureLayer ?
4): like the above way, comment out the adornment layer to see if any performance improve.
5): Sorry I didn’t got it, would you please give more details.
Btw, I am wondering if you are using the Iso line layer? I ask this question is because I noticed you are asking the Isoline question from other threads.
Thanks,
Troy
Hi,
I have observed main difference in performance when simple style is applied to layer.
Ya In other thread I am asking isoline questions to find out how to inherit different algorithm to draw contours. But to meet my current requirement I am loading shape files.
Thanks & Regards,
Goral
Hi Coral,
Okay, we know it is not related with Isoline layer now.
But as for your feedback, I am afraid it is hard for us to obtain any useful information in it. I am wondering did you get any useful information or test your app with my previous suggestions? would you mind to send us your sample or a test video?
I really hope we can have a big progress on this thread.
Regards,
Troy
Hi,
I dont know weather I am able to explain or not so again I am explaining. I am loading contour (elevation) lines shapefile. In that I am applying different color to all levels of contours. For that I am using valuestyle. To show related height I amusing text style. Due to more number of feature and valuestyle rendering speed got affected.( I feel from my experience).
I have gone through your suggested point for improvement. I found relative improvement mainly on two points.
1) Enabling textstyle on higher zoomlevel made a difference.
2) I have tried to apply single colors to all level. I think due to this rendering become easy so it has given improved result.
I will try to send it. Otherwise before also I have attached one cs file in which I have written code for applying valuestyle. For time being it can be useful.
Thanks & Regards,
Goral