Issue with Geog image map shader / georeferencing mismatch?

Started by terp, November 03, 2021, 08:18:09 PM

Previous topic - Next topic

WAS

By reprojected you mean changing the coordinate system / units right? That's what I thought the problem was. It always seems to be the issue with files I find, and I actually don't understand why corresponding files would have different coordinate ssytems when they're supposed to be bundled. Maybe there is software that handles colour differently then elevation data?

aknight0

I believe there's an open bug from earlier this year with the geog image shader.  It wasn't respecting the coordinates when I tried it in June.  I don't know if that ever got resolved.

terp

A bug would make sense, as The Geog Image Map Shader doesn't seem move anything via georeferencing, no matter what coordinate system (reprojection) I throw at it, while the Geog Heightfield Load always does.

Would be lovely to see that bit of existing code brought over from the heightfield load to the image map shader node.

How do I go about finding open bugs, or reporting what I think to be bugs?


sboerner

QuoteThe Geog Image Map Shader node is behaving as though Position Explicitly is on no matter what buttons are clicked, or what data exists in the 4 corner slots.



QuoteYes, the colormap is still at the origin (when imported with Geog Image Map Shader node)


Can confirm that this is a bug in newer versions of TG (at least on Windows, not sure about Mac). It's been reported but I don't think it's been fixed yet.

Geopositioning does work as expected (AFAIK) on versions 4.5.13 and earlier.

WAS

Little frustrating that you already have a hard time understanding these file formats and their positions, to also know you've been just fighting a bug too with the software. Explains a lot though.

Roberts

Well, I downloaded the same image from Earth explorer as you Terp (the one showing the west rim of the crater). When I load that into TG using the geog image map shader it lines up nicely with the underlying terrain. I didn´t have to reproject it first in QGIS. So TG seems to recognize and place it correctly. Perhaps this is because I´m using an older version of TG (4.3.23)

On the other hand, I´m having trouble restricting the image. I have to use a simple shape to mask the layer, otherwise the whole terrain outside the image turns black. I don´t know why, maybe I´m doing something wrong or there is supposed to be an accompanying alpha or something.

Anyway, I hope your project is coming along Terp, and let´s hope that Planetside can get rid of the possible bug in the more recent versions.

Robert

terp

Quote from: WAS on November 06, 2021, 04:28:57 PMLittle frustrating that you already have a hard time understanding these file formats and their positions, to also know you've been just fighting a bug too with the software. Explains a lot though.
Yeah - I'm more of an artist-type...these worlds of data I've been been navigating would be enough for me to crack, given new/old image formats, projection conversions, coordinate systems, etc.  Bugs add a whole new layer of complexity.

Quote from: Roberts on November 08, 2021, 06:48:19 AMSo TG seems to recognize and place it correctly. Perhaps this is because I´m using an older version of TG (4.3.23)

I bet that's it, Robert.

Quote from: Roberts on November 08, 2021, 06:48:19 AMOn the other hand, I´m having trouble restricting the image. I have to use a simple shape to mask the layer, otherwise the whole terrain outside the image turns black. I don´t know why, maybe I´m doing something wrong or there is supposed to be an accompanying alpha or something.
Strange behavior.  Not having your version, it's harder for me to diagnose.

Have you tried changing the NoDATA (under the tab) to transparent or to some other color?
Maybe in TG's "compositing" of the layers, there are negative values being applied?
I see below-zero values messing stuff up all the time in Nuke over the years.  ;)

Roberts

Quote from: terp on November 08, 2021, 12:21:00 PMHave you tried changing the NoDATA (under the tab) to transparent or to some other color?
Yes, I have tried that as well as the different alpha/transparency setting under the effects tab. Unfortunately none seem to do the trick, all still makes the whole terrain surrounding the image map completely black.

But something struck me just now and that is that I connected the geog image map shader to the color input of a surface layer. Maybe it's better (or I'm supposed) to just use the geog image map on it's own? I'll try that when I'm back at the computer.

Robert

terp

Quote from: Roberts on November 09, 2021, 12:31:47 PMYes, I have tried that as well as the different alpha/transparency setting under the effects tab. Unfortunately none seem to do the trick, all still makes the whole terrain surrounding the image map completely black.

But something struck me just now and that is that I connected the geog image map shader to the color input of a surface layer. Maybe it's better (or I'm supposed) to just use the geog image map on it's own? I'll try that when I'm back at the computer.

Hey Robert.
I'm running the shader directly under a compute terrain (or even the heightfield shader).
I ran into black pixels this morning too.  I couldn't figure out a way around it in 4.5.56.

....

I did some more reading about QGIS this morning and found out how to connect the Google Satellite dataset as a layer within it.
So, now, I can import a heightfield (from USGS website) and they match in space.

I position the viewer window to the area I want, and export both heightmap and google satellite imagery using "Map Canvas Extent" option to make sure both are registered to the same 4 corners.  This gets me two images which line up in TG4.5.56, BUT I got some black pixels (as you are getting) when there is empty data somewhere in my export region (Canvas Extent).  In QGIS, I'm unable to effect NODATA parameters so far.

Again, learning a lot.

WAS

Quote from: terp on November 09, 2021, 03:50:07 PMThis gets me two images which line up in TG4.5.56, BUT I got some black pixels (as you are getting) when there is empty data somewhere in my export region (Canvas Extent). 

Maybe try Unpremultiply in colour tab, or run the colour through a Clamp colour 0 shader (or even Clamp colour 0 1).

Roberts

Glad you seem to have found a good solution terp! I don´t have a lot of experience with QGIS, but it has some really useful and fun tools for handling real world terrain and analysis.
Regarding the black pixels/NoData you get in QGIS, I know there are a ways to interpolate rasters in QGIS. I have the swedish language version, but if you look under "raster" and go down to "analysis", it should open a new list of tools. One of them should be something like "fill holes through interpolation". I have not done this myself though, but perhaps you can try that? If WAS suggestion doesn´t work of course.

I managed to get the geog image maps to display correctly in TG as well! :)  As you can see in the screenshot there are several ways to connect it to a surface layer that works (no black void outside the image). So, the way I connected the geog image map shader before was wrong. Now I know better ;)

Robert

Matt

I've found the cause of the Geog Image Map Shader bug which was introduced in v4.5, and I've got it working correctly in development builds. We'll release a fix to 4.5 soon.
Just because milk is white doesn't mean that clouds are made of milk.

Roberts


terp

Hey all - I was away on Holiday for a few days.

Robert: Glad to see you've got things working!
Matt:  Thanks for tracking that down.  I know you're a busy guy.  I'll be on the lookout for your next version push.

Thanks again to you all for helping track down/puzzle out these issues, I appreciate your time.

terp

As a followup, by adjusting the export output resolution of the color maps (via google maps) inside of QGIS, I am able to get some really helpful, higher-resolution maps onto the DEMs. 

Bigger maps increase render time more than I was expecting, but it's good to know this option exists for whatever use-case you find this workflow helpful for.