ImageOverlay does not render correctly if polygon is not North-South aligned

classic Classic list List threaded Threaded
5 messages Options
Hannes Naude Hannes Naude
Reply | Threaded
Open this post in threaded view
|

ImageOverlay does not render correctly if polygon is not North-South aligned

Hi all

I've been trying to use ImageOverlay to overlay an aerial image on my terrain. I first aligned the image with the terrain in Google Earth to obtain the coordinates for the corner points. I include a screen shot of the result here: https://drive.google.com/open?id=0BxFJunbfwjckQ3Q0V1dfeDlvN00 . But when I modify the annotation.earth example file to use these corner points and this image for the ImageOverlay, I end up with this : https://drive.google.com/open?id=0BxFJunbfwjckNVRFLW9oTUY0NTg . This looks like a bug to me and I have also reproduced it by simply rotating the original image overlay that was in annotation.earth by 45 degrees. Can someone confirm whether this is a known limitation of the ImageOverlay class or whether a workaround exists?

Regards
Hannes Naude
Hannes Naude Hannes Naude
Reply | Threaded
Open this post in threaded view
|

Re: ImageOverlay does not render correctly if polygon is not North-South aligned

Incidentally I've found that an easy way to demonstrate this issue is to run the osgearth_imageoverlay app with the vert command line option.

So for example from your tests folder run:  
osgearth_imageoverlay gdal_tiff.earth --image ../data/fractal.png 0 0 1 1 --vert

As soon as you switch into edit mode and drag one of the vertices of the overlay, the problem becomes apparent.

Regards
Hannes Naude
jasonbeverage jasonbeverage
Reply | Threaded
Open this post in threaded view
|

Re: ImageOverlay does not render correctly if polygon is not North-South aligned

Thanks for reporting this, I pushed a fix for this here:  https://github.com/gwaldron/osgearth/commit/f07f37fff3e3aac6839e106e95e6ef32aeb1917e

I added some code to attempt to support splitting image overlays across the dateline and the texture coordinate logic isn't quite perfect, so I disabled it for now.

On Mon, Aug 7, 2017 at 9:56 AM Hannes Naude [via osgEarth] <[hidden email]> wrote:
Incidentally I've found that an easy way to demonstrate this issue is to run the osgearth_imageoverlay app with the vert command line option.

So for example from your tests folder run:  
osgearth_imageoverlay gdal_tiff.earth --image ../data/fractal.png 0 0 1 1 --vert

As soon as you switch into edit mode and drag one of the vertices of the overlay, the problem becomes apparent.

Regards
Hannes Naude



If you reply to this email, your message will be added to the discussion below:
To start a new topic under osgEarth, email [hidden email]
To unsubscribe from osgEarth, click here.
NAML
Hannes Naude Hannes Naude
Reply | Threaded
Open this post in threaded view
|

Re: ImageOverlay does not render correctly if polygon is not North-South aligned

Thanks so much Jason.

That appears to have solved the problem.

Regards
Hannes Naude
Mr Woo Mr Woo
Reply | Threaded
Open this post in threaded view
|

Re: ImageOverlay does not render correctly if polygon is not North-South aligned

Hi Hannes, and Jason,

I noticed that the patch does not work when the map is in projected mode (plate-carre). Indeed, the image is west-east oriented instead of north-south. I think the texture of the coordinates in the ImageOverlay are flipped too many times.

Any idea?