[Xastir] GeoPDF
Tom Russo
russo at bogodyn.org
Mon Sep 5 11:08:10 EDT 2011
On Mon, Sep 05, 2011 at 08:39:29AM -0600, we recorded a bogon-computron collision of the <russo at bogodyn.org> flavor, containing:
> On Sun, Sep 04, 2011 at 09:43:24PM -0400, we recorded a bogon-computron collision of the <lee.bengston at gmail.com> flavor, containing:
> > However, when Xastir tries to read the converted files, it shows the
> > following error in the terminal:
> >
> > TIFFReadDirectory: Warning,
> > /usr/share/xastir/maps/Offline/GeoTiff/VA_Manassas_20110606_TM.tif:
> > unknown field with tag 42112 (0xa480) encountered.
> > *** geoTIFF file
> > /usr/share/xastir/maps/Offline/GeoTiff/VA_Manassas_20110606_TM.tif is
> > not in the proper format:
> > ***** Has 3 samples per pixel instead of 1
> > *** Please reformat it and try again.
> >
> > Is there a specific setting in gdal_translate that I need to use in
> > order to convert the GeoPDF's in a way that Xastir will recognize?
> >
>
> See README.MAPS, under the heading
> XASTIR can only use GeoTIFF files that are 8-bit per pixel with one band
>
> There is no option to gdalwarp or gdal_translate to create a one-band, 8-bit
> color raster from a 3-band, 24-bit color raster. You have to do it in
> a separate step. The instructions for doing that final step are in README.MAPS.
>
> Some day it would be good to hack Xastir to deal with 24-bit rasters, but
> that could be a challenge.
I'm not going to hack Xastir to handle 24-bit, but I've been working on a
script to deal with this process (and an extension of it) and hope to release
it this afternoon.
In addition to the geopdf->geotiff and 24-to-8 bit conversion, it'll crop the
neatline *AND* warp the map to the format most suited to Xastir, the
equidistant cylindrical projection that will allow Xastir to display it
without error (it makes a small error in placement of interior pixels that is
insignificant on the scale of a 7.5' quad, but significant when using larger
quads). Doing this also makes it unnecessary for Xastir to do neatline
clipping calculations (even though the process Derrick gave us clips the
neatline off, it still leaves a border of dead pixels that Xastir would have
to trim off using its FGD-file computations. Conversion to equidistant
cylindrical ("unprojected lat/lon") eliminates both the error and the clipping
problem.
It will also allow geopdfs from other sources than USGS to be usable --- i.e.
geopdfs that are not in UTM projection.
The ideal fix, of course, is to finish Xastir's GDAL support so that the
files could be read directly, but that's not gonna happen.
--
Tom Russo KM5VY SAR502 DM64ux http://www.swcp.com/~russo/
Tijeras, NM QRPL#1592 K2#398 SOC#236 http://kevan.org/brain.cgi?DDTNM
"One man alone can be pretty dumb sometimes, but for real bona fide
stupidity, there ain't nothin' can beat teamwork." - Edward Abbey
More information about the Xastir
mailing list