I have some scanned topographic maps in geotiff format. When I try to import them, r.in.gdal tells me that they are not orthogonal and I need to straighten them with gdalwarp. This works fine but as the map is rotated, I get black slivers along the edges of the maps.
I want to patch the maps together. If I set the black slivers to NULL with r.patch -z or r.null the valid black content in the map disappears as well.
Is there a way I can use the -dstnodata feature of gdalwarp to set the 'nodata' portions of the output map directly to a NULL value that grass will recognize on input?
Dave, I am not sure if this is the way you want to do this, but you can draw a mask (r.digit) around the part of your map that is data, and set everything else in the region to null with r.null. Then remove the mask and use r.patch. You can't really automate this easily, but it should work.
-Ian
On Sep 15, 2005, at 8:47 PM, Dave Kent wrote:
Hi:
I have some scanned topographic maps in geotiff format. When I try to import them, r.in.gdal tells me that they are not orthogonal and I need to straighten them with gdalwarp. This works fine but as the map is rotated, I get black slivers along the edges of the maps.
I want to patch the maps together. If I set the black slivers to NULL with r.patch -z or r.null the valid black content in the map disappears as well.
Is there a way I can use the -dstnodata feature of gdalwarp to set the 'nodata' portions of the output map directly to a NULL value that grass will recognize on input?
Or is there some other way to solve this problem?
Thanks for your help.
Dave
>
What happens if a big asteroid hits Earth? Judging from realistic simulations involving a sledge hammer and a common laboratory frog, we can assume it will be pretty bad.
- Dave Barry
-------------------------------------------------------------
This message has been scanned by Postini anti-virus software.
I have some scanned topographic maps in geotiff format. When I try
to import them, r.in.gdal tells me that they are not orthogonal and I
need to straighten them with gdalwarp. This works fine but as the
map is rotated, I get black slivers along the edges of the maps.
I want to patch the maps together. If I set the black slivers to
NULL with r.patch -z or r.null the valid black content in the map
disappears as well.
Is there a way I can use the -dstnodata feature of gdalwarp to set
the 'nodata' portions of the output map directly to a NULL value that
grass will recognize on input?
Or is there some other way to solve this problem?
Depending on what you want to do with them, I've found setting GDAL's
nodata value to white (255 for an 8-bit image) makes it so when plotted
on a white background the white holes don't really show up. A better
solution might be to load into GIMP/Photoshop, select by color, and
change all white or black pixels to black+1 or white-1, then let gdal
introduce black/white borders and r.null only crop out real NULL values,
but not noticeable to the eye.
Others will probably know how to do this reclassification using the
GDAL tools without having to use a paint program.