About raster query tool

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

About raster query tool

iomeneandrei
Dear all,
the raster query tool of GRASS and JGrass gives me different result for the same map. You can see it in action here:
http://www.screencast.com/t/VQ7j9genla6

I click in a sea zone, with "0" pixel value, and I have in JGrass "-9999"

I'm attaching my location.

Thank you,

a
Andrea Borruso

----------------------------------------------------
email: aborruso@tin.it
website: http://blog.spaziogis.it
my 2.0 life: http://aborruso.spaziogis.it
feed: http://feeds2.feedburner.com/Tanto
38° 7' 48" N, 13° 21' 9" E
----------------------------------------------------
Reply | Threaded
Open this post in threaded view
|

Re: About raster query tool

Andrea Antonello
Hi Andrea,
here we get into GRASS-JGrass format internals.

> the raster query tool of GRASS and JGrass gives me different result for the
> same map. You can see it in action here:
> http://www.screencast.com/t/VQ7j9genla6
>
> I click in a sea zone, with "0" pixel value, and I have in JGrass "-9999"
>
> I'm attaching my  http://n2.nabble.com/file/n2274439/qtool.zip location .

This happens for one reason. The map you are viewing is an integer
map. GRASS has different integer formats and the 0 for some of them is
defined as the novalue.

I can not say for sure what is going on right now, but that is for
sure the problem.
JGrass interpretes the map as an old integer format and gives the
value -9999.0, which in this version is the novalue.

I am pretty sure that if you do a r.mapcalc map=map*1.0 and then try
again on that everything works.

Andrea



>
> Thank you,
>
> a
>
> -----
> Andrea Borruso
>
> ----------------------------------------------------
> email: [hidden email]
> website: http://blog.spaziogis.it
> my 2.0 life: http://aborruso.storytlr.com/
> feed: http://feeds2.feedburner.com/Tanto
> 38° 7' 48" N, 13° 21' 9" E
> ----------------------------------------------------
> --
> View this message in context: http://n2.nabble.com/About-raster-query-tool-tp2274439p2274439.html
> Sent from the JGrass-devel -- Developer list for jgrass mailing list archive at Nabble.com.
>
> _______________________________________________
> JGrass-devel mailing list
> [hidden email]
> https://dev.fsc.bz.it/cgi-bin/mailman/listinfo/jgrass-devel
>
_______________________________________________
JGrass-devel mailing list
[hidden email]
https://dev.fsc.bz.it/cgi-bin/mailman/listinfo/jgrass-devel
Reply | Threaded
Open this post in threaded view
|

Re: About raster query tool

iomeneandrei
Hi Andrea,
thank you.
Andrea Antonello wrote
Hi Andrea,
here we get into GRASS-JGrass format internals.

This happens for one reason. The map you are viewing is an integer
map. GRASS has different integer formats and the 0 for some of them is
defined as the novalue.
I am pretty sure that if you do a r.mapcalc map=map*1.0 and then try
again on that everything works.
I know I have a solution for it ;-) I wanted only to alert about this inconsistency.

Then in some way JGrass does not read the real data, but it interprets it. Would not it be better to read the actual value, and play with null data in rendering context?

Ciao,

a
Andrea Borruso

----------------------------------------------------
email: aborruso@tin.it
website: http://blog.spaziogis.it
my 2.0 life: http://aborruso.spaziogis.it
feed: http://feeds2.feedburner.com/Tanto
38° 7' 48" N, 13° 21' 9" E
----------------------------------------------------
Reply | Threaded
Open this post in threaded view
|

Re: About raster query tool

Andrea Antonello
>> here we get into GRASS-JGrass format internals.
>>
>> This happens for one reason. The map you are viewing is an integer
>> map. GRASS has different integer formats and the 0 for some of them is
>> defined as the novalue.
>> I am pretty sure that if you do a r.mapcalc map=map*1.0 and then try
>> again on that everything works.
>>
>
> I know I have a solution for it ;-) I wanted only to alert about this
> inconsistency.

It is an inconsistency if you confirm me

> Then in some way JGrass does not read the real data, but it interprets it.

That is wrong.

> Would not it be better to read the actual value, and play with null data in
> rendering context?

It is a bit more complex than it seems. Every GRASS raster has a
cell_misc/mapname/null file, inside which it there is a bitmap of 0/1
that defines the null pixels against the valid ones.
When you visualize data it is different than reading data for analysis
use. The optimizations for the first are not usable for the second.
Also we always used to use -9999.0 as the default novalue, thing that
we are dropping for the JGrass 1.2 (let's start call it like that :))
and using NaN.

The more I think about it and the more your problem would need some
investigation (which right now I am not able to do). I imagine the map
was produced with a recent GRASS version, right? Then this could
indeed be a bug, since JGrass is dealing with it as an old GRASS
integer raster format.

Andrea


>
> Ciao,
>
> a
>
> -----
> Andrea Borruso
>
> ----------------------------------------------------
> email: [hidden email]
> website: http://blog.spaziogis.it
> my 2.0 life: http://aborruso.storytlr.com/
> feed: http://feeds2.feedburner.com/Tanto
> 38° 7' 48" N, 13° 21' 9" E
> ----------------------------------------------------
> --
> View this message in context: http://n2.nabble.com/About-raster-query-tool-tp2274439p2274521.html
> Sent from the JGrass-devel -- Developer list for jgrass mailing list archive at Nabble.com.
>
> _______________________________________________
> JGrass-devel mailing list
> [hidden email]
> https://dev.fsc.bz.it/cgi-bin/mailman/listinfo/jgrass-devel
>
_______________________________________________
JGrass-devel mailing list
[hidden email]
https://dev.fsc.bz.it/cgi-bin/mailman/listinfo/jgrass-devel