[Xastir] Using GeoPDF maps

Lee Bengston lee.bengston at gmail.com
Mon Dec 14 17:31:49 EST 2015


On Mon, Dec 14, 2015 at 3:20 PM, Lee Bengston <lee.bengston at gmail.com>
wrote:

> For those who want to try converting GeoPDF maps to GeoTif format f/u/w
> Xastir using a high level guide, here goes:
>
> 1) Install the development packages for Python and Poppler.
>     In Debian/Ubuntu that's python-dev for Python.  Poppler has
>     libpoppler-dev and libpoppler-private-dev.  You may only need
>     the second one, but at this time all I know is installing both
>     worked for me.  Package names above for Poppler apply to
>     Ubuntu 15.04 - they may or may not very with Ubuntu version.
>
> 2) Dowload GDAL 2.0.1 and compile it.
>      http://download.osgeo.org/gdal/2.0.1/gdal-2.0.1.tar.gz.
>      Commands are as follows:
>        ./configure --with-poppler --with-python
>        make
>        sudo make install
>        sudo ldconfig
>
> 3) Modify the geopdf2gtiff.pl script that comes with Xastir
>     Comment out (or delete) line #214 that reads as follows:
>
>     $theGdalWarp="gdalwarp -cutline $inputPDF.vrt -crop_to_cutline -t_srs
> EPSG:4326  $inputPDF $outputTif";
>
>     Then add a new line in it's place that reads as follows:
>
>     $theGdalWarp="gdalwarp -cutline $inputPDF.vrt -crop_to_cutline -t_srs
> EPSG:4326  -oo 'LAYERS_OFF=Images,Images.Orthoimage' -oo 'DPI=250.0'
> $inputPDF $outputTif";
>
> 4) Run the script on each geoPDF map file that you have downloaded.
>      I used this syntax (my Ubuntu didn't like the shebang for some
> reason.)
>      perl geopdf2gtiff.pl -f MAPFILENAMEgeo.pdf.
>
> The resulting MAPFILENAMEgeo.tif file is in a format Xastir supports and
> can be used pretty much like any supported offline map.
>
> Note: if you don't modify the script as stated above, conversion will take
> much longer, and you will end up with a larger map that doesn't look as
> good.
>


​Fyi, the text above applies specifically to converting the USGS topo maps
from GeoPDF format to GeoTiff.  ​

​I recomm​end doing the above on a computer running Linux with "reasonable"
processing power.  If the ultimate destination for the maps is, for
example, a Raspberry Pi, it would be better to convert the maps on a more
powerful platform and copy them to the Pi.

In order for Xastir to be able to display GeoTiff maps, it needs to be
built with GeoTiff support.  Clicking "Help/About" in Xastir displays a
list of "Libraries Used".  If 'Geotiff' is not in the list, GeoTiff maps
are not supported.  In Ubuntu and Debian, the 'libgeotiff-dev' package
needs to be installed prior to compiling Xastir, and that will enable
GeoTiff support.  The installation notes for Ubuntu 14.04 (and several
previous versions) include building Xastir with GeoTiff support.  When
running configure, be sure to use the following line if you have installed
the libgeotiff-dev package:

configure CPPFLAGS="-I/usr/include/geotiff"

The installation notes for Ubuntu 14.04 are at
http://xastir.org/index.php/HowTo:Ubuntu_14.04


Lee - K5DAT


More information about the Xastir mailing list