[Xastir] Goodbye GeoTIFF, Hello GeoPDF

Brian Heaton geekdownrange at gmail.com
Fri Jul 6 12:35:13 PDT 2018


Now that I've moved, I need to do the whole exercise again for Texas.

Great to hear it will be a bit easier this time.

73-KY9K/Brian


On Fri, Jul 6, 2018, 14:25 Tom Russo <russo at bogodyn.org> wrote:

> On Fri, Jul 06, 2018 at 02:08:12PM -0500, we recorded a bogon-computron
> collision of the <lee.bengston at gmail.com> flavor, containing:
> > Thanks!  I had looked at the help on gdalwarp, but it listed that option
> as
> > [-oo NAME=VALUE], which is pretty generic.
>
> gdalwarp has so many different supported formats and each format has
> different
> supported options, so you can't just rely on the "--help" feature.  You
> have
> to get the format-specific help using the "--format <formatname>" options
> (and you can get the list of formats with "--formats").
>
> "gdalwarp --format GTiff" will give you more detailed help on the options
> recognized by the GeoTIFF driver.
>
> But DPI is actually an option for *reading* the PDF, so it's hidden in the
> output for "gdalwarp --format PDF".
>
> They're all in a goofy XML format, so not delightful to read IMNSHO.
>
> Just a hint:  "-oo" means "Open options" and "-co" means "creation
> options",
> so anything with a "-oo" is generally applying to input, and "-co" apply
> to output.  It is easy to misinterpret "-oo" as "output options".
>
> > I needed to delve further into
> > the command line options, so you probably saved me a lot of time.  I like
> > the maps, but they're meant for use when zoomed in quite a bit.  That's
> > fine, but as is they start to look bad if zoomed in too far as well, so
> > maybe by increasing dpi I can increase the window of zoom levels where
> they
> > look good.
> >
> > Lee - K5DAT
> >
> >
> > On Thu, Jul 5, 2018 at 10:12 PM, Tom Russo <russo at bogodyn.org> wrote:
> >
> > > You an add "-oo 'DPI=600.0'" to the gdalwarp command line to make it
> > > output at 600DPI.  With the modification for other DPI
> > >
> > > I have used a modified version of Xastir's geopdf2gtiff script in some
> of
> > > my search-and-rescue GIS work a few years ago, making it send the
> > > orthoimage,
> > > topo map, and shaded relief layers to separate files, and to skip the
> > > "dither down to 8 bit"
> > > step (because ArcGIS can handle the 24 bit rasters where Xastir can't).
> > >
> > > In that script, instead of doing:
> > >
> > > -----
> > > $theGdalWarp="gdalwarp -cutline $inputPDF.vrt -crop_to_cutline -t_srs
> > > EPSG:4326  $inputPDF $outputTif";
> > >
> > > system ($theGdalWarp) == 0 or die "System $theGdalWarp failed: $?";
> > > -----
> > >
> > > the way Xastir's does, I do:
> > >
> > > -----
> > > $theGdalWarp="gdalwarp -cutline $inputPDF.vrt -crop_to_cutline -of
> GTiff
> > > -oo 'DPI=250.0' -oo 'LAYERS_OFF=Images,Images.Orthoimage' -dstnodata
> '5 6
> > > 7' -co \"COMPRESS=PACKBITS\" $inputPDF $outputTif";
> > >
> > > system ($theGdalWarp) == 0 or die "System $theGdalWarp failed: $?";
> > >
> > > $theGdalWarp="gdalwarp -cutline $inputPDF.vrt -crop_to_cutline -of
> GTiff
> > > -oo 'DPI=600.0' -oo 'LAYERS=Images,Images.Orthoimage' -dstnodata '5 6
> 7'
> > > -co \"COMPRESS=PACKBITS\"  $inputPDF Orthos_$outputTif";
> > >
> > > system ($theGdalWarp) == 0 or die "Second system $theGdalWarp failed:
> $?";
> > >
> > > $theGdalWarp="gdalwarp -cutline $inputPDF.vrt -crop_to_cutline -of
> GTiff
> > > -oo 'DPI=600.0' -oo 'LAYERS=Map_Frame.Terrain.Shaded_Relief' -dstnodata
> > > '5 6 7' -co \"COMPRESS=PACKBITS\"  $inputPDF ShadedRelief_$outputTif";
> > >
> > > system ($theGdalWarp) == 0 or die "Third system $theGdalWarp failed:
> $?";
> > > -----
> > >
> > > This snippet shouldn't be used as a drop-in replacement for what's in
> > > Xastir's script, because:
> > >
> > >   1) It doesn't warp to WGS84 Lat/Lon coordinates, because I didn't
> need
> > >      that in ArcGIS.  It should be obvious how to reinsert that if you
> > >      look at the actual gdalwarp command lines.  (-t_srs EPSG:4326)
> > >
> > >   2) I'm also telling gdalwarp to set regions of no data to
> > >      the RGB tuple 5,6,7, so that I can tell ArcGIS to ignore those
> > > pixels.
> > >      There is no corresponding "ignore pixel of this value" option in
> > > Xastir's
> > >      geotiff code, so you could leave the "-dstnodata '5 6 7'" piece
> off.
> > >
> > >   3) I also found in early playing with geopdf2gtiff that compressing
> the
> > >      image sometimes made it unreadable by Xastir, which is why
> Xastir's
> > >      geopdf2gtiff doesn't do that.  YMMV.  (leave off
> > >      -co \"COMPRESS=PACKBITS\" if it causes trouble)
> > >
> > > On Thu, Jul 05, 2018 at 08:20:10PM -0500, we recorded a bogon-computron
> > > collision of the <lee.bengston at gmail.com> flavor, containing:
> > > > On Mon, Mar 21, 2016 at 2:28 PM, Brian Heaton <
> geekdownrange at gmail.com>
> > > > wrote:
> > > >
> > > > > I cranked the dpi setting in the script so mine would look good at
> > > higher
> > > > > zoom levels. Bigger files but storage is cheap.
> > > > >
> > > > > ???Resurrecting an old thread here.  I've been converting geopdf's
> > > lately
> > > > and found it's easier now to install prerequisites because the
> current
> > > > version of the binary gdal package in Ubuntu supports the conversion
> - no
> > > > need to build gdal from source.  My laptop is on Ubuntu 17.10, so
> anyone
> > > on
> > > > that release or 18.04 should be able to take advantage.
> > > >   I'm not sure where the cutoff is, but I do know Ubuntu 16.04
> required a
> > > > source build of gdal because the binary version was below version
> 1.8.1.
> > > >
> > > > I've been looking through the geopdf2gtiff.pl script, but I can't
> find
> > > > where to increase the "dpi setting" as the person above indicated had
> > > been
> > > > done.  If anyone can shed some light on that (or debunk it if it's
> not
> > > > possible), I would appreciate it.
> > > >
> > > >
> > > > Thanks,
> > > > Lee
> > > > K5DAT
> > > >
> > > >
> > > > >
> > > > > >       From: Lee Bengston <lee.bengston at gmail.com>
> > > > > >  To: Xastir - APRS client software discussion <
> > > xastir at lists.xastir.org>
> > > > > >  Sent: Monday, March 21, 2016 10:18 AM
> > > > > >  Subject: Re: [Xastir] Goodbye GeoTIFF, Hello GeoPDF
> > > > > >
> > > > > > Xastir has a script that uses gdal to convert GeoPDF to
> GeoTIFF.  Tom
> > > > > Russo
> > > > > > wrote it a few years ago and refined it much more recently.
> There
> > > was
> > > > > > quite a bit of discussion about it not too long ago.
> > > > > >
> > > > > > Lee - K5DAT
> > > > > > On Mar 21, 2016 11:12 AM, "Curt Mills" <curt.we7u at gmail.com>
> wrote:
> > > > > >
> > > > > > > As I recall the geoPDF's have multiple layers that can be
> > > > > > enabled/disabled
> > > > > > > for viewing. I'm not sure whether these files can be directly
> used
> > > > > within
> > > > > > > other programs w/o having to implement Postscript and a bunch
> of
> > > other
> > > > > > > stuff. Would be worth investigating though.
> > > > > > >
> > > > > > > On Mon, Mar 21, 2016 at 7:47 AM, Eric Christensen <
> > > > > > > eric at christensenplace.us>
> > > > > > > wrote:
> > > > > > >
> > > > > > > > -----BEGIN PGP SIGNED MESSAGE-----
> > > > > > > > Hash: SHA256
> > > > > > > >
> > > > > > > > I recently learned that USGS will no longer release
> > > GeoTIFF-formatted
> > > > > > > > map files in favor of GeoPDF[0].  This will likely cause
> > > problems for
> > > > > > > > Xastir.  I did locate a instructions for converting the
> GeoPDF to
> > > > > > > > GeoTIFF[1].
> > > > > > > >
> > > > > > > > [0] http://www.usgs.gov/faq/taxonomy/term/10413
> > > > > > > > [1] http://www.usgs.gov/faq/node/3704
> > > > > > > >
> > > > > > > > - --Eric
> > > > >
> > > > _______________________________________________
> > > > Xastir mailing list
> > > > Xastir at lists.xastir.org
> > > > http://xastir.org/mailman/listinfo/xastir
> > >
> > > --
> > > Tom Russo    KM5VY
> > > Tijeras, NM
> > >
> > >  echo "prpv_a'rfg_cnf_har_cvcr" | sed -e 's/_/ /g' | tr [a-m][n-z]
> > > [n-z][a-m]
> > >
> > > _______________________________________________
> > > Xastir mailing list
> > > Xastir at lists.xastir.org
> > > http://xastir.org/mailman/listinfo/xastir
> > >
>
> --
> Tom Russo    KM5VY
> Tijeras, NM
>
>  echo "prpv_a'rfg_cnf_har_cvcr" | sed -e 's/_/ /g' | tr [a-m][n-z]
> [n-z][a-m]
>
> _______________________________________________
> Xastir mailing list
> Xastir at lists.xastir.org
> http://xastir.org/mailman/listinfo/xastir
>


More information about the Xastir mailing list