1

It is better to show than tell:

enter image description here

On this image, the layer below the colorful shape is a trivial heat map in raster format.
The colorful shape is the product of the skimage.graph.MCP_Geometric method.

In order to find the cell indexes for the start and end points, I am using the calculation shown in the second answer of this thread: How to extract value from a raster based on lat and lon? (I have used the first one also as a test, ending in the same results.).

The problem:

As you can see from the arrows on the resulting image, the start/end points seem to be displaced in accordance to the starting points of the corridor.
The points' coordinates are in srid 4326.

UPDATE:

The Point coordinates are taken by Cesium with 3d tile rendering. When checking the same rasters and the corresponding points in QGIS I see an even greater displacement: enter image description here

  • It seems you are not properly converting your starting points to get the correct row, col, and it looks systematic as both your displacements look the same. It's hard to help without seeing what you've done. One thing you might be able to do is find the expected row,col for the starting points via plotting with imshow; that at least gives you a target for knowing when your code is correct. – Jon Sep 5 '18 at 16:12
  • @Jon The problem may be how I receive the coordinates from Cesium. I made an update in the question which you can check. – John Moutafis Sep 6 '18 at 11:14
  • I have never used Cesium so I doubt I'll be much help. The only advice I can offer based on what you've shown is to make sure your raster is also in 4326 coordinates. I'm guessing it's not based on the discrepancy between the QGIS display and your first image. – Jon Sep 6 '18 at 13:54
  • @Jon The raster is in epsg:4326 (double checked) – John Moutafis Sep 6 '18 at 13:55
  • Is the QGIS map displaying 4326 too (lower right where it says EPSG:XXXX)? There's definitely some distortion between the raster images. – Jon Sep 6 '18 at 14:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.