[GRASSLIST:10217] Re: Problems with r.proj - grass 6.01

Helmut Kudrnovsky hellik at web.de
Thu Feb 9 02:22:28 EST 2006


hi Morten, hi Glynn and hello to others, 

there is no difference between the options "with region cropping" (look at 1) and "without region cropping" (look at 2)

i tried this procedure with different output-projections which are matching for germany/austria and different region-settings and different interpolation methods (cubic, bilinear).

there is always the same result: "Range of data:    min =  nan max = nan  "

v.proj with vector data in the same region like the input-raster does his job.

i use "proj Rel. 4.4.9, 29 Oct 2004".

greetings from the snowy austria
helli

p.s. with osgeo there is interesting and important thing growing up ....

(1)
the output of r.proj with region cropping and cubic interpolation

"r.proj input=comp location=salzburgepsg mapset=imagedate output=comp1 method=cubic resolution=1 

Input Projection Parameters: +proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1.000000 +x_0=450000 +y_0=0 +no_defs +a=6377397.155 +rf=299.1528128 +towgs84=577.326,90.129,463.919,5.1366,1.4742,5.2970,2.4232
Input Unit Factor: 1

Output Projection Parameters: +proj=tmerc +lat_0=0 +lon_0=12 +k=1.000000 +x_0=4500000 +y_0=0 +no_defs +a=6377397.155 +rf=299.1528128 +towgs84=597.1,71.4,412.1,0.894,0.068,-1.563,7.58
Output Unit Factor: 1
Input:
Cols:	2349 (2349)
Rows:	2347 (2347)
North: 5321295.600000 (5321295.600000)
South: 5318948.400000 (5318948.400000)
West:  4561644.000000 (4561644.000000)
East:  4563992.800000 (4563992.800000)
ew-res:	0.999915
ns-res:	1.000085

Output:
Cols:	4373 (2)
Rows:	3210 (4)
North: 5356212.272416 (5356212.272416)
South: 5353002.550472 (5353002.550472)
West:  8604787.256327 (8604787.256327)
East:  8609160.077374 (8609160.077374)
ew-res:	0.999959
ns-res:	0.999913
Allocating memory and reading input map... 

Projecting... " 

and the r.info-output

"r.info map=comp1 
 +----------------------------------------------------------------------------+
 | Layer:    comp1                          Date: Wed Feb  8 23:39:19 2006    |
 | Mapset:   images                         Login of Creator: helli           |
 | Location: bayern                                                           |
 | DataBase: //home/helli/grassdata                                           |
 | Title:     ( comp1 )                                                       |
 |----------------------------------------------------------------------------|
 |                                                                            |
 |   Type of Map:  raster              Number of Categories: 255              |
 |   Data Type:    FCELL                                                      |
 |   Rows:         3210                                                       |
 |   Columns:      4373                                                       |
 |   Total Cells:  14037330                                                   |
 |        Projection: Transverse Mercator (zone 0)                            |
 |            N: 5356212.27241587    S: 5353002.55047188   Res: 0.99991338    |
 |            E: 8609160.0773742    W: 8604787.25632747   Res: 0.99995908     |
 |   Range of data:    min =  nan max = nan                                   |
 |                                                                            |
 |   Data Source:                                                             |
 |                                                                            |
 |                                                                            |
 |                                                                            |
 |   Data Description:                                                        |
 |    generated by r.proj                                                     |
 |                                                                            |
 |                                                                            |
 +----------------------------------------------------------------------------+
"

(2)
the output of r.proj without region cropping and cubic interpolation

"r.proj input=comp location=salzburgepsg mapset=imagedate output=comp2 method=cubic resolution=1 -n 

Input Projection Parameters: +proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1.000000 +x_0=450000 +y_0=0 +no_defs +a=6377397.155 +rf=299.1528128 +towgs84=577.326,90.129,463.919,5.1366,1.4742,5.2970,2.4232
Input Unit Factor: 1

Output Projection Parameters: +proj=tmerc +lat_0=0 +lon_0=12 +k=1.000000 +x_0=4500000 +y_0=0 +no_defs +a=6377397.155 +rf=299.1528128 +towgs84=597.1,71.4,412.1,0.894,0.068,-1.563,7.58
Output Unit Factor: 1
Input:
Cols:	2349 (2349)
Rows:	2347 (2347)
North: 5321295.600000 (5321295.600000)
South: 5318948.400000 (5318948.400000)
West:  4561644.000000 (4561644.000000)
East:  4563992.800000 (4563992.800000)
ew-res:	0.999915
ns-res:	1.000085

Output:
Cols:	4373 (2)
Rows:	3210 (4)
North: 5356212.272416 (5356212.272416)
South: 5353002.550472 (5353002.550472)
West:  8604787.256327 (8604787.256327)
East:  8609160.077374 (8609160.077374)
ew-res:	0.999959
ns-res:	0.999913
Allocating memory and reading input map... 

Projecting... "

and the r.info-output

"r.info map=comp2 
 +----------------------------------------------------------------------------+
 | Layer:    comp2                          Date: Wed Feb  8 23:50:33 2006    |
 | Mapset:   images                         Login of Creator: helli           |
 | Location: bayern                                                           |
 | DataBase: //home/helli/grassdata                                           |
 | Title:     ( comp2 )                                                       |
 |----------------------------------------------------------------------------|
 |                                                                            |
 |   Type of Map:  raster              Number of Categories: 255              |
 |   Data Type:    FCELL                                                      |
 |   Rows:         3210                                                       |
 |   Columns:      4373                                                       |
 |   Total Cells:  14037330                                                   |
 |        Projection: Transverse Mercator (zone 0)                            |
 |            N: 5356212.27241587    S: 5353002.55047188   Res: 0.99991338    |
 |            E: 8609160.0773742    W: 8604787.25632747   Res: 0.99995908     |
 |   Range of data:    min =  nan max = nan                                   |
 |                                                                            |
 |   Data Source:                                                             |
 |                                                                            |
 |                                                                            |
 |                                                                            |
 |   Data Description:                                                        |
 |    generated by r.proj                                                     |
 |                                                                            |
 |                                                                            |
 +----------------------------------------------------------------------------+
"




----------------------------------------------------------------------------
-Quoting Helmut Kudrnovsky <hellik at web.de>:

>> Then i started location (2) and wanted to re-project the orthofoto 
>> from location (1) with r.proj into the current location. I set the 
>> resolution to 1 in the location and in the input of r.proj and the 
>> option „Do not perform region cropping optimization“.

-Unless you are working with global maps you should let r.proj do region 
-cropping for you. Otherwise, if input and output are not overlapping, 
-you will end up with an empty map. r.proj will normally warn you that 
-the input map is outside the currrent region, but not so if you disable 
-region cropping.

-There is no need to set a current region of the input location - r.proj 
-will only look at the map's extent, NOT at the WIND file that contains 
-the last active region settings for the input location. On the output 
-side r.proj will honor current region settings and create a map that 
-is, at most, the size of the current region.

-What result do you get do not disable region cropping?

-rgds
-Morten
----------------------------------------------------------------------------
+Disabling region cropping (the -n switch) is the safest option. The
+only disadvantages are that it may be slower, and it won't warn you in
+advance if you are going to end up with an empty map.

+It will never result in data being lost.

-- 
+Glynn Clements <glynn at gclements.plus.com>




morten at untamo.net schrieb am 07.02.06 23:15:21:

Quoting Helmut Kudrnovsky <hellik at web.de>:

> Then i started location (2) and wanted to re-project the orthofoto 
> from location (1) with r.proj into the current location. I set the 
> resolution to 1 in the location and in the input of r.proj and the 
> option „Do not perform region cropping optimization“.

Unless you are working with global maps you should let r.proj do region 
cropping for you. Otherwise, if input and output are not overlapping, 
you will end up with an empty map. r.proj will normally warn you that 
the input map is outside the currrent region, but not so if you disable 
region cropping.

There is no need to set a current region of the input location - r.proj 
will only look at the map's extent, NOT at the WIND file that contains 
the last active region settings for the input location. On the output 
side r.proj will honor current region settings and create a map that 
is, at most, the size of the current region.

What result do you get do not disable region cropping?

rgds
Morten


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193




More information about the grass-user mailing list