Welcome, Guest
Username: Password: Remember me

TOPIC: Map Objects with ascii grid: interpolation method?

Map Objects with ascii grid: interpolation method? 7 years 11 months ago #24612

  • pilou1253
  • pilou1253's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 584
  • Thank you received: 106
Hello,

I have a question to Blue Kenue developpers.
I would like to know how is the interpolation performed when mapping bathymetry using a ascii grid (.asc) onto the mesh (t3s)?

I made a comparison in GIS between a DEM created from the bottom elevation at each mesh nodes and my original DEM. You can see the comparison below. I am surprised since I would have expected to have almost no bathymetry difference between the two DEMs AT EACH NODE LOCATION.

My mesh has a resolution varying between 3 and 10 m and the original DEM has a 1 m resolution. When looking at the global comparison, I can see that the difference between the two models is almost nill on plane surfaces (roads) but is almost always positive on sloping terrain. And it seems to be rather negative at the bottom of the rivers. Once more, to obtain differences BETWEEN my mesh nodes is normal, but I would have expected a better result around each node. It some case is the difference very important (0,5 to 1 m).

Can someone explain how is the spatial interpolation performed when using Map Objects? I need to try a comparison with a model bathymetry created with a classical interpolation from xyz points to see how it behaves.

Thanks in advance for your help!

Best regards
PL

globalview.png


detailviewwithmeshnodes.png
The administrator has disabled public write access.

Map Objects with ascii grid: interpolation method? 7 years 11 months ago #24643

  • pilou1253
  • pilou1253's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 584
  • Thank you received: 106
Hello,

I did investigate this issue a bit deeper and came to the conclusion that Blue Kenue links the elevation information to each cell's lower left corner whereas in GIS system like ArcGIS (I can't speak for other systems at the moment) the elevation information is linked to the cell's center.

When generating a ascii raster in ArcGIS there is a translation of -Cellsize/2 in both X and Y directions to "center" the elevation on each cell. So the trick I found was to shift back the ascii grid with +Cellsize/2 in the .asc file to keep the same geographic datum reference in BK. My pictures correspond to a domain where the terrain slopes can be as high as 30 degrees. In such a configuration there can be potentially large differences in bathymetry due to this datum shift. One needs to be aware of that...

Otherwise I also noticed that BK performs a spatial interpolation between ascii grid nodes which means that it is normal to observe differences at each mesh node when comparing with the original DEM.

Please correct me if I misunderstood something.

Best regards
Pierre-Louis
The administrator has disabled public write access.

Map Objects with ascii grid: interpolation method? 7 years 11 months ago #24664

  • Serrer
  • Serrer's Avatar
  • OFFLINE
  • Moderator
  • Posts: 720
  • Thank you received: 304
Hi Pierre-Louis,

You have reached the proper conclusion.

The values of a rectangular grid object are considered to be point values by Blue Kenue. (as opposed to "average values of a cell" in a raster based system such as ArcGIS) In other words, it's a continuous surface.

When mapping from a rectangular grid to any destination object the value at a destination point is determined by performing a bilinear interpolation using the 4 nodes of the enclosing rectangle (grid).

The 1/2 cellSize shift is the appropriate technique to apply in your case.

Cheers... Martin
The administrator has disabled public write access.
The following user(s) said Thank You: pilou1253

Map Objects with ascii grid: interpolation method? 5 years 11 months ago #32282

  • a.barton
  • a.barton's Avatar
  • OFFLINE
  • Moderator
  • Posts: 683
  • Thank you received: 178
Hi Pierre-Louis,

I have added this suggestion to a ticket on CHyMS... thanks for pointing me to this discussion thread. I will probably add a little something to Blue Kenue that will pop up a prompt to select what should be done during the mapping process...

If you have any suggestions about what you'd like to go in the prompt, please let me know. Also, if you could create a very small example file that I can use for testing purposes, that would speed up my ability to do this for you more quickly... ;)

Kindly,
Alan
The administrator has disabled public write access.

Map Objects with ascii grid: interpolation method? 5 years 11 months ago #32314

  • pilou1253
  • pilou1253's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 584
  • Thank you received: 106
Hi Alan,

By chance I still had my testing files on my PC!
In the attached zip you will find:
- the outline I used to create a test mesh (shp)
- the base ascii grid I created from shapefiles in ArcGIS (can't find them anymore though, but you do have the rasters)
- the shifted ascii grid (+Cellsize/2) allowing to perform an spatial interpolation in a similar manner than GIS systems.

Let me know if you need more info!

Regarding the prompt info, maybe a bullet list with the following choices:
- Assign raster value to cell's center (default) => shift of +Cellsize/2
- Assign raster value to cell's lower left corner => no shift


Thanks in advance,
Kind regards
PL


File Attachment:

File Name: Test_BlueKenue_ascii_grid.zip
File Size: 2 KB
The administrator has disabled public write access.

Map Objects with ascii grid: interpolation method? 5 years 11 months ago #32348

  • a.barton
  • a.barton's Avatar
  • OFFLINE
  • Moderator
  • Posts: 683
  • Thank you received: 178
One wrinkle I need to consider is the case of missing data

- it looks like your example does not have any missing data so I may simply throw a warning in the case of interpolating values that may have one or more "missings"...

hhmmm... do you use ascii grids that have missing data in them?
The administrator has disabled public write access.

Map Objects with ascii grid: interpolation method? 5 years 11 months ago #32355

  • pilou1253
  • pilou1253's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 584
  • Thank you received: 106
Hi,

Yes, I ALWAYS have missing data in real world applications :-)
There is already a warning message prompted when importing an ascii raster.

What is important is to make sure that the raster covers a larger area than the mesh to be mapped. If it's not the case then nodes located outside of raster's enveloppe get value 0. I honestly think this should be managable by user - the warning message on import is sufficient in my opinion.

Kind regards
PL
The administrator has disabled public write access.

Map Objects with ascii grid: interpolation method? 5 years 5 months ago #33628

  • pilou1253
  • pilou1253's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 584
  • Thank you received: 106
Hello Alan,

I was just wondering if you made these changes into a released alpha version yet? I looked at the change logs from vesions 3.11.6 and 3.11.7 and the answer seems to be no.

I am not in a rush at all, I just need to know whether I still have to make the manual conversion prior to Map Object interpolation or not ;-)

Kind regards
PL
The administrator has disabled public write access.

Map Objects with ascii grid: interpolation method? 5 years 5 months ago #33633

  • a.barton
  • a.barton's Avatar
  • OFFLINE
  • Moderator
  • Posts: 683
  • Thank you received: 178
Sorry for slow response; was out of the office

And thank you for reminding me about this... still on my TODO list. Please; keep reminding me about it once in a while ;)

Kindly,
Alan
The administrator has disabled public write access.

Map Objects with ascii grid: interpolation method? 3 years 2 months ago #39051

  • Aurélien
  • Aurélien's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
  • Thank you received: 1
Good day everybody,

I wanted to know if the problem (the shifting) had eventually been solved ??

Thank you !
The administrator has disabled public write access.
The following user(s) said Thank You: a.barton
Moderators: Serrer, a.barton

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.