[GRASS-user] problem on vectorizing a float point raster

Roger Bivand Roger.Bivand at nhh.no
Wed Jun 10 03:27:38 EDT 2009


The other thread was on the openspace list and was concerned with calculating
local Moran's Ii. My comments there copied here for completeness:

"In your case, temperature will be being driven by altitude at least, and
possibly other important omitted variables. I also think that you will find
exploratory variography on the (detrended) data, or perhaps rather a sample
of the data (about 4M observations), might give some information. But I
don't think that squeezing your data into an inappropriate methods
setting is going to help much, and I'm pretty certain that just comparing
the output of a function of your input data and GRASS r.neighbors average
values for increasing values of the size parameter would be sufficient to
display the local dependence, most of which will still be driven by the
trend.

For example in spearfish:

g.region rast=elevation.dem
r.univar -g map=elevation.dem
# to get the mean and variance values
r.mapcalc 'demean_elev=elevation.dem-1353.66931789804'
r.neighbors -c input=demean_elev output=demean_elev3 method=average size=3
r.mapcalc 'Ii=(demean_elev*demean_elev3)/31343.402316476'

Then compare histograms and displays of Ii for increasing values of size."

Roger


Roger Bivand wrote:
> 
> I think that r.to.vect wants to build a line structure, like river
> channels, but sees all the raster cells occupied, so no linear structure,
> and the advice to thin first is then appropriate. If this is connected to
> your question about calculating a measure of spatial autocorrelation for
> the raster data, then I suspect that you do not need polygons but rather
> points, where r.out.xyz may be helpful, followed by v.in.ascii if you will
> be using GRASS downstream, or if you want to emit a shapefile for GeoDa
> (another posting).
> 
> If you really want to calculate a measure of spatial autocorrelation for
> your raster, I suggest copying the raster to R with readRAST6, creating
> the neighbour list with dnearneigh() with max. distance the greater of
> ewres and nsres, and proceeding from there in the usual way. But please
> consider the inevitable fact that unless the resolution of your raster
> matches the "natural" support of the phenomenon of interest, the observed
> autocorrelation will certainly be driven by your having multiple
> neighbouring "observations" of each "entity", in addition to not having
> demeaned (detrended) the data. This means that any results will almost
> certainly be spurious.
> 
> Hope this helps,
> 
> Roger
> 
> 
> Milton Cezar Ribeiro wrote:
>> 
>> Dear Grass-Gurus,
>> 
>> I have a 2400x2200 raster image with values ranging
>> from 0.1 to 42, in float format. Now I need
>> vetororize the image, on the way that each pixel
>> come to be a polygon and the pixel value be stored as
>> attribute.
>> 
>> I am trying to do this using:
>> r.to.vect input=temp71.img output=temp71_img_integer_vect_200m --o -b
>> 
>> but grass return the following error messages:
>> 
>> GRASS 6.4.0svn (newLocation):C:/GRASS-6-SVN/msys/home/mjfortin >
>> r.to.vect
>> inpu
>> t=temp71.img output=temp71_img_integer_vect_200m --o -b
>> WARNING: Vector map <temp71_img_integer_vect_200m> already exists and
>> will
>>          be overwritten
>> WARNING: Table <temp71_img_integer_vect_200m> linked to vector map
>>          <temp71_img_integer_vect_200m> does not exist
>> Extracting lines...
>> ERROR: Raster map is not thinned properly.
>>        Please run r.thin.
>> By the way, I am running grass under a WinXp 64bit.
>> Any help are welcome.
>> 
>> Cheers
>> 
>> milton
>> brazil=toronto
>> 
>> _______________________________________________
>> grass-user mailing list
>> grass-user at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/grass-user
>> 
>> 
> 
> 


-----
Roger Bivand
Economic Geography Section
Department of Economics
Norwegian School of Economics and Business Administration
Helleveien 30
N-5045 Bergen, Norway

-- 
View this message in context: http://n2.nabble.com/problem-on-vectorizing-a-float-point-raster-tp3052124p3054112.html
Sent from the Grass - Users mailing list archive at Nabble.com.



More information about the grass-user mailing list