[Xastir] Using GeoPDF maps

Lee Bengston lee.bengston at gmail.com
Mon Dec 14 15:20:52 EST 2015


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.

Have fun,
Lee - K5DAT


More information about the Xastir mailing list