[Xastir] Speed issues moving maps.

Tom Russo russo at bogodyn.org
Tue Mar 22 14:45:17 EDT 2011


On Tue, Mar 22, 2011 at 10:04:20AM -0600, we recorded a bogon-computron collision of the <russo at bogodyn.org> flavor, containing:
> 
> A better way to do DRG->PNG transformation it would be with gdalwarp,
> because it does not only image format transformation but also
> coordinate system warping.  You need GDAL installed, of course.
> 
[...]
> So, what you want is to do the stretching and twisting needed in one
> operation and save that file.  
> 
> gdalwarp -t_srs EPSG:4326 -co WORLDFILE=true foo.tif foo.png
> 
> will do the trick

No, just tried this to sanity check myself, and found that this just creates
another GeoTiff named foo.png.  GDAL supports reading png files, but apparently
won't write them (or at least won't *create* them).  But it'll write portable
anymaps (PNM), which can be converted with standard tools.  So here's the
straight dope:

gdalwarp -t_srs EPSG:4326 -of PNM foo.tif foo.pnm
convert foo.pnm foo.jpg

"convert" is part of imagemagick, so you'll have that already.
(I tried "convert foo.pnm foo.png" and got a 1-bit greyscale instead of a 
color image).  The first will create a PNM with the warped image in a coordinate
system Xastir's .geo can work with easily,and the second creates a compressed
image out of it to save disk space.

The worldfile trick I mentioned in my previous post won't work with PNM output, 
because that GDAL output driver will refuse to create one.  You can, of 
course, do:

gdalwarp -t_srs EPSG:4326 -co WORLDFILE=true foo.tif bar.tif

to get a warped GeoTIFF with worldfile.  The worldfile it creates will be 
correct for the pnm and jpg you create with the other command.  You can discard
bar.tif.  You'll still have to do work to convert the information in the 
worldfile to something that is usable in a .geo.

-- 
Tom Russo    KM5VY   SAR502   DM64ux          http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236        http://kevan.org/brain.cgi?DDTNM
 "The truth will set you free, but first it will piss you off."





More information about the Xastir mailing list