RPF / CADRG: slow performance - 412 tiles RPF files

198
3
Jump to solution
12-11-2020 10:41 AM
JohnCartse
New Contributor II

Hello,

I am loading a A.TOC (CADRG) file. To be more precise, I am reading the A.TOC and it points me to 412 RPF  files located in a sub-folder.

I load each of these RPF files in a RasterLayer.

 

GroupLayer groupLayer = new GroupLayer();
for(File frame : frames) {
  RasterLayer r = new RasterLayer(new Raster(frame.path));
  groupLayer.add(r);
}

 

When I display this groupLayer on the map, it is very slow when all the 412 layers are visible on the map. It is very laggy and struggle to manipulate (zoom, move) the map.

As I zoom into the tiles so that some tiles are out of the sight, it gets a bit better.

Is there a way to improve this performance issue?

Thanks in advance!

JC

Tags (3)
Reply
0 Kudos
1 Solution

Accepted Solutions
MarkBaird
Esri Regular Contributor

Hi JC,

So to make  your app more usable you have some options to build upon the scale thresholds you've set up.

Probably the easiest improvement is to seek some data which works at a more zoomed out scale.  Is there some vector data you have access too which would provide you with an outline of country boundaries for example?  This could give your application some better spatial context whilst you are zoomed out.  A basemap would also potentially give you the same.

If the RPF data is the only thing you have, then building pyramids on the data will make it perform better when you are zoomed out.  Basically building pyramids on a raster dataset gives you lower resolution versions of the data which are displayed as you zoom out.  This reduces the amount of data we need to display and hence it will perform much faster.  Building Pyramids is something you can do in ArcGIS Pro or ArcMap.  Once you've got pyramids built, you will be able to view the data in a much wider range of scales without it working your app very hard to display the data.

Here is some background information to explain what pyramids are about: https://pro.arcgis.com/en/pro-app/latest/help/data/imagery/raster-pyramids.htm

The other thing you ask is what is a map scale?  In your code you've set the min scale to 1001.  This means you've set the scale to 1:1001.  It's never completely accurate on a monitor, but this basically means that something measure 1 metre on the screen represents something which in reality is 1001 metres.  

View solution in original post

3 Replies
MarkBaird
Esri Regular Contributor

Hi JC,

I've not reproduced your issue, but I can fully understand what is happening.  The data you are working with is very likely designed to be viewed at a specific scale.  It might be 1:25000 for example, and as you've seen the app will perform well at around this scale.

As you zoom out, the amount of data you are displaying will be huge with 400+ tiles.  All this needs to be loaded into memory which isn't going to perform very well with the CADRG raw data as you've seen.

Usually in this kind of instance, I'd say you should set scale thresholds on the group layer which contains the raster tiles you are displaying.  This will of course mean you need to switch to a more appropriate data set which works well for the scale you are viewing.  You might switch to using 1:50000 or 1:100000 scale data for example and set the scale thresholds so that layer doesn't cause you the same problem when you zoom out.

If you don't have access to data at different scales, then there are also options for "pre-processing" your raw CADRG data so it performs better at zoomed out scales.  Let me know if you need to consider this option as I'd need to look at this; its been a long time since I've worked on pyramids and raster data.

Does this help?

  

JohnCartse
New Contributor II

Hi Mark,
Thank you for your reply. You are describing very well my problem. That's exactly it.

For this map, I don't have a dataset for a larger scale (i.e. zoomed out), so I did what you suggested. I've set a scale limits as such:

groupLayer.setMaxScale(1001);
groupLayer.setMinScale(10000000);

[side question: what does these numbers means exactly, do you know? I couldn't find the meaning of the double values in these scale methods, please?]

So, with the scale limits, the titles are not visible until I zoom-in now. Which is a bit more acceptable, performance wise. However, the downside is when zoom-ed out, the user have no clue that there are tiles there.. until you zoom-in.

I would be very interested to know more about the pre-processing method you are suggesting, please.

Many thanks again Mark!

Reply
0 Kudos
MarkBaird
Esri Regular Contributor

Hi JC,

So to make  your app more usable you have some options to build upon the scale thresholds you've set up.

Probably the easiest improvement is to seek some data which works at a more zoomed out scale.  Is there some vector data you have access too which would provide you with an outline of country boundaries for example?  This could give your application some better spatial context whilst you are zoomed out.  A basemap would also potentially give you the same.

If the RPF data is the only thing you have, then building pyramids on the data will make it perform better when you are zoomed out.  Basically building pyramids on a raster dataset gives you lower resolution versions of the data which are displayed as you zoom out.  This reduces the amount of data we need to display and hence it will perform much faster.  Building Pyramids is something you can do in ArcGIS Pro or ArcMap.  Once you've got pyramids built, you will be able to view the data in a much wider range of scales without it working your app very hard to display the data.

Here is some background information to explain what pyramids are about: https://pro.arcgis.com/en/pro-app/latest/help/data/imagery/raster-pyramids.htm

The other thing you ask is what is a map scale?  In your code you've set the min scale to 1001.  This means you've set the scale to 1:1001.  It's never completely accurate on a monitor, but this basically means that something measure 1 metre on the screen represents something which in reality is 1001 metres.  

View solution in original post