[Xastir] Missing dependency for gpx2shape

Lee Bengston lee.bengston at gmail.com
Mon Mar 21 23:21:32 EDT 2016


On Mon, Mar 21, 2016 at 3:11 PM, Tom Russo <russo at bogodyn.org> wrote:

> On Mon, Mar 21, 2016 at 12:12:06PM -0400, we recorded a bogon-computron
> collision of the <eric at christensenplace.us> flavor, containing:
> > Running Debian 8.3 and can't seem to figure out what I need to install
> > to make this script work:
> >
> > $ perl /usr/local/share/xastir/scripts/gpx2shape TdC_100.gpx
> > Can't locate Geo/Shapelib.pm in @INC (you may need to install the
> > Geo::Shapelib module) (@INC contains: /etc/perl
> > /usr/local/lib/x86_64-linux-gnu/perl/5.20.2 /usr/local/share/perl/5.20.2
> > /usr/lib/x86_64-linux-gnu/perl5/5.20 /usr/share/perl5
> > /usr/lib/x86_64-linux-gnu/perl/5.20 /usr/share/perl/5.20
> > /usr/local/lib/site_perl .) at /usr/local/share/xastir/scripts/gpx2shape
> > line 28.
> >
> >
> > BEGIN failed--compilation aborted at
> > /usr/local/share/xastir/scripts/gpx2shape line 28.
> >
> > I don't see any perl package for Shapelib (or similar).
>
>
> http://search.cpan.org/dist/Geo-Shapelib-0.21/Shapelib.pm


​The link above didn't work for me, but when I tried installing with the
cpan shell, it grabbed the Geo-Shapelib package from here:​


​http://www.cpan.org/authors/id/A/AJ/AJOLMA/Geo-Shapelib-0.21.tar.gz

The shapelib package can be downloaded via the link above and extracted,
which creates a folder named Geo-Shapelib-0.21.  Normally the next step is
to issue "perl Makefile.PL" from a terminal inside the folder above.
However that bombed because the make file was looking in the wrong place
for the shapelib development files. My files are in
'/usr/lib/i386-linux-gnu', so in theory the command below should have
addressed that:

perl Makefile.PL --shapefile=/usr/lib/i386-linux-gnu

However, I still got the same error that it could not find the shapelib
files.  I ended up editing ​Makefile.PL - I believe it's line 18:

for (qw(/usr/lib /usr/lib/x86_64-linux-gnu /usr/local/lib)) {

new version:
for (qw(/usr/lib /usr/lib/i386-linux-gnu /usr/local/lib)) {

Then issuing "perl Makefile.PL", followed by changing to root and entering
"make install" completed the installation.  I did get a warning about a
dependent module not installed (Tree::R), but given it's a warning it may
not be an absolute requirement.

l did all of the above on an old 32 bit computer running Debian Jessie.  If
you are running a 64 bit version, perhaps Makefile.PL will work as is.  If
not, you'll have to edit it to tell it where to find your libshp.so file.

I don't have a gpx file I can try, though, so I don't know if the old 2006
script will work now that I have the Shapelib module installed.  You can
consider this a fallback in case you can't get gdal fixed.  :-)

Lee - K5DAT







>
> But don't get your hopes up --- that script was written in 2006 and was
> never
> modified.  It might work if you have the Shapelib.pm module, but might
> not.
>
> Rarely used scripts do have a tendency to get very out of date, and this
> one's
> gone 10 years without being touched.
>
> You may be better off using gdal tools to convert gpx files to shapefiles.
> They are extremely powerful and are under constant development.
>
> The tool to use for this would be "ogr2ogr", which can convert any vector
> format that GDAL supports to any other format that GDAL supports.  GPX and
> Shapefile are among those.
>
> --
> Tom Russo    KM5VY   SAR502   DM64ux          http://www.swcp.com/~russo/
> Tijeras, NM  QRPL#1592 K2#398  SOC#236
> http://kevan.org/brain.cgi?DDTNM
>  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