Hi everybody,
I have 6 scanned maps which was resampled into one project. The maps are overlapping a bit and the scans includes also parts outside the map frame. Unfortunately after resampling to the project the mas are not rectangular. I would like cut out unwanted parts and mosaic the pieces into one file using r.patch. I have tried r.mask but it is masking out map values but not map areas. Is there any method in grass how to do it?
Thanks in advance.
Regards
Zbigniew
--
Zbigniew Perski
Geological Visualization Laboratory
Department of Fundamental Geology
Faculty of Earth Sciences at UNIVERSITY OF SILESIA
Bedzinska 60, 41-200 Sosnowiec
POLAND
LINUX user #333288
Zbigniew Perski wrote:
Hi everybody,
I have 6 scanned maps which was resampled into one project. The maps are overlapping a bit and the scans includes also parts outside the map frame. Unfortunately after resampling to the project the mas are not rectangular. I would like cut out unwanted parts and mosaic the pieces into one file using r.patch. I have tried r.mask but it is masking out map values but not map areas. Is there any method in grass how to do it?
Thanks in advance.
Regards
Zbigniew
Use the if(when true, choose A, else choose B) function in r.mapcalc. With this function you may decide, which map in case of overlapping you prefer and you may cut undesired areas. To begin it may be easier, to build the mosaic step by step with only one r.mapcalc if(a,b,c) (with only two maps included) function, but it is also possible to nest the if() function to join all 6 maps in one step.
Best regards,
Helmer
Helmer Schack-Kirchner wrote:
Use the if(when true, choose A, else choose B) function in r.mapcalc. With this function you may decide, which map in case of overlapping you prefer and you may cut undesired areas. To begin it may be easier, to build the mosaic step by step with only one r.mapcalc if(a,b,c) (with only two maps included) function, but it is also possible to nest the if() function to join all 6 maps in one step.
Best regards,
Helmer
Dear Helmer,
Thanks a lot for your help. In the meantime I found an alternative way:
1. Create polygon around interesting part of the map.
2. Associate value=1 to the polygon
3. Rasterize the polygon (with the same grid parameters like oryginal map result=mask
4. r.mapcalc: oryginal map * mask = clipped map
As the result of multiplying a map by 1 is the same map but outside the mask multiplyin is returning NaN values and thus the map is clipped.
Best regards
Zbogniew