On Tue, 22 Jul 2008, Jana K. wrote:


I've already posted this a couple of days ago, but I am afraid somehow it got
lost in other questions.
I believe someone must know an answer, so please, HELP me :-(:

I need to transform a map from LAEA coordinates into UTM. I created a new
location with UTM projection. I used r.proj from within the new location,
but  running it,  I received the following error message:

Input Projection Parameters: +proj=laea +lat_0=52.0000000000
+lon_0=10.0000000000 +x_0=4321000.0000000000 +y_0=3210000.0000000000
+a=6378137 +rf=298.257222101 +no_defs +towgs84=0.000,0.000,0.000
Input Unit Factor: 1

Output Projection Parameters: +proj=utm +zone=34 +a=6378137
+rf=298.257223563 +no_defs +towgs84=0.000,0.000,0.000
Output Unit Factor: 1

Can't work with xy data

I don't understand it as the data are clearly georeferenced.

Well it looks like your current (output) location is broken in some way. How was it originally created? Does
g.region -p
show an XY Location? Or a UTM location? Maybe you could try recreating the projection information by running g.setproj, or g.proj -c with an appropriate input source.

Now question 2:

My raster data are categorical (landuse), and during the projection
transformation I want to go from high resolution (100m) to rather crude
resolution (2500m). How GRASS handles such operation? I would expect that It
assigns the highest frequency value to the new cell (I mean if one new cell
contains 625 old pixels, it will be assigned the value which occurs most
frequently). Am I right?

If you read the r.proj manpage, it says:
"The projected data is resampled with one of three different methods: nearest neighbor, bilinear and cubic convolution.

The nearest option, which performs a nearest neighbor assignment is the fastest of the three resampling methods. It is primarily used for categorical data such as a land use classification, since it will not change the values of the data cells. The bilinear option determines the new value of the cell based on a weighted distance average of the 4 surrounding cells in the input map. The cubic option determines the new value of the cell based on a weighted distance average of the 16 surrounding cells in the input map.

The bilinear and cubic interpolation methods are most appropriate for continuous data and cause some smoothing. Both options should not be used with categorical data, since the cell values will be altered. If nearest neighbor assignment is used, the output map has the same raster format as the input map. If any of the both interpolations is used, the output map is written as floating point. "

So I think this clearly suggests that with categorical data your only option is nearest neighbor, which doesn't do what you want. Perhaps you could resample with r.resamp.stats in the original location before reprojecting.

Paul
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to