Commit a7991f25 authored by Bas Couwenberg's avatar Bas Couwenberg

Imported Upstream version 0.68

parents
AUTHORS
========
Toshihiro Hiraoka <washitoshi at yahoo.co.jp>
maintainer
Petter Reinholdtsen <pere at hungry.com>
bug fix, debian package and advices
This diff is collapsed.
0.68
====
by Toshihiro Hiraoka
- Change XML parser from libxml2 to expat for big file support
- Remake almost all strucutes.
- Rewrite almost all sources.
- Add three path check options --min-points, --min-length and
--min-time to reduce the noise.
- Add -b, --basix-columns option
- Add -g, --gpxline option
- Add -f, --fast option
- README
- AUTHORS
- Change comment style to javadoc style.
- Structures flow
- Error code
0.65-1
======
by Petter Reinholdtsen
- Add some debian missing files.
- Added config.sub and config.guess.
- debian package available now!
by Toshihiro Hiraoka
- Stop to use strange version number.
0.65a
=====
by Petter Reinholdtsen
- Add configure script etc.
- Get rid of some warnings about loosing the 'const'-ness of the
variable.
- Remove unused include <math.h>.
- Add include to find prototype for geod_set().
- Fix handling of output filename, to make sure it handles
'./foo.gpx' (used to give random filename).
- Correct the prototype of closeFiles().
- Add files in debian/ to make debian package. This is just a
framework, and need more work. The package description and a lot
of the support files are from the dh-make package, and should be
edited or removed. To build the package, run debuild from the
devscripts package.
- Solve some memory leaks and complaints.
by Toshihiro Hiraoka
- Restruct directory
- Add many prototypes etc.
Requirements
==============
- proj >ver4.0
- expat >ver2.0
- gpsbabel If you want to convert from GPS to shp directory but the
future is not stable yet.
Installation
==============
It's not special. Just type below like others.
./configure
make
su
make install
gpx2shp image will be at /usr/local/bin.
SUBDIRS = src man
EXTRA_DIST = gps2shp pinatest2.gpx debian develop
debian-dist:
dpkg-buildpackage -rfakeroot -d -tc -us -uc
CLEANFILES = \
pinatest2_wpt.shx \
pinatest2_wpt.shp \
pinatest2_wpt.dbf \
pinatest2_trk.shx \
pinatest2_trk.shp \
pinatest2_trk.dbf \
pinatest2_rte.shx \
pinatest2_rte.shp \
pinatest2_rte.dbf \
pinatest2_meta.txt
check: src/gpx2shp
src/gpx2shp -s pinatest2.gpx
This diff is collapsed.
0.68
====
by Toshihiro Hiraoka
- Change XML parser from libxml2 to expat for big file support
- Remake almost all strucutes.
- Rewrite almost all sources.
- Add three path check options --min-points, --min-length and
--min-time to reduce the noise.
- Add -b, --basix-columns option
- Add -g, --gpxline option
- Add -f, --fast option
- README
- AUTHORS
- Change comment style to javadoc style.
- Structures flow
- Error code
0.65-1
======
by Petter Reinholdtsen
- Add some debian missing files.
- Added config.sub and config.guess.
- debian package available now!
by Toshihiro Hiraoka
- Stop to use strange version number.
0.65a
=====
by Petter Reinholdtsen
- Add configure script etc.
- Get rid of some warnings about loosing the 'const'-ness of the
variable.
- Remove unused include <math.h>.
- Add include to find prototype for geod_set().
- Fix handling of output filename, to make sure it handles
'./foo.gpx' (used to give random filename).
- Correct the prototype of closeFiles().
- Add files in debian/ to make debian package. This is just a
framework, and need more work. The package description and a lot
of the support files are from the dh-make package, and should be
edited or removed. To build the package, run debuild from the
devscripts package.
- Solve some memory leaks and complaints.
by Toshihiro Hiraoka
- Restruct directory
- Add many prototypes etc.
==============
gpx2shp README
==============
Toshihiro Hiraoka
1/5/2005
What's This
===========
gpx2shp is a converter from GPX file to ESRI/shape file.
gps2shp is also a converter from GPS device to shape file but it's not
stable yet.
This is a output of Metro Manila Transit Map Project by JOCV (Japan
Overseas Cooperation Volunteers) program of JICA (Japan International
Cooperation Agency in 2004. It is provided you on GPL2.
Why I Made
==========
It's easy. The software converts GPS data to shape file is too much
expensive! The cost is same as the one year salary of my co-worker here
in the Philippine. GIS is not for only rich countries.
How to Use
==========
- Basic
There are three types of data on GPX that are waypoint, trkpoint and
route. gpx2shp converts the three data to separated files like below.
Please try to convert a sample file "pinatest2.gpx" in this archive.
prompt> gpx2shp pinatest2.gpx
prompt> ls
pinatest2.gpx (source gpx)
pinatest2_meta.txt (meta data)
pinatest2_rte.dbf (route)
pinatest2_rte.shp (route)
pinatest2_rte.shx (route)
pinatest2_trk.dbf (trackpoint)
pinatest2_trk.shp (trackpoint)
pinatest2_trk.shx (trackpoint)
pinatest2_wpt.dbf (waypoint)
pinatest2_wpt.shp (waypoint)
pinatest2_wpt.shx (waypoint)
You can see 10 files after convertion. The shape format need 3 files
for discribing a map and gpx format has 3 types of data and metadata so
gpx2shp makes 10 of them. Route and track point data is converted as a
arc(path) data, waypoint data is converted into point data like the
table below.
data type | file name | format
-------------+---------------------+--------
waypoint | [basename]_wpt.* | point
track point | [basename]_trk.* | arc
route | [basename]_rte.* | arc
meta data | [basename]_meta.txt | text
- Convert only certain data
You can convert only a certain type of data like only waypoint or
track point using option '-w' (waypoint), '-t' (trackpoint) or '-r'
(route).
prompt> gpx2shp -r pinatest2.gpx
prompt> ls
pinatest2.gpx (source gpx)
pinatest2_meta.txt (meta data)
pinatest2_rte.dbf (route)
pinatest2_rte.shp (route)
pinatest2_rte.shx (route)
- Convert path data to points and etc
As default, track point and route data is converted as a arc data but
you can convert it other ways using option '-p'(convert as point) and
'-e' (as edge). The edge file has '_edg' in the filename and the point
file has '_pnt' in the filename.
prompt> gpx2shp -p -e pinatest2.gpx
prompt> ls
pinatest2_meta.txt
pinatest2_rte.dbf (route path data)
pinatest2_rte.shp
pinatest2_rte.shx
pinatest2_rte_edg.dbf (route each edge)
pinatest2_rte_edg.shp
pinatest2_rte_edg.shx
pinatest2_rte_pnt.dbf (route each point)
pinatest2_rte_pnt.shp
pinatest2_rte_pnt.shx
pinatest2_trk.dbf (track path data)
pinatest2_trk.shp
pinatest2_trk.shx
pinatest2_trk_edg.dbf (track each each)
pinatest2_trk_edg.shp
pinatest2_trk_edg.shx
pinatest2_trk_pnt.dbf (track each point)
pinatest2_trk_pnt.shp
pinatest2_trk_pnt.shx
pinatest2_wpt.dbf (waypoint is always as point)
pinatest2_wpt.shp
pinatest2_wpt.shx
- Statistics
If you add '-s' option you can see a conversion summery.
prompt> gpx2shp -s pinatest2.gpx
Track Points:
track count: 4
point count: 658
total length: 156565.627989
unconverted: 0( 0.00%)
Routes:
route count: 1
point count: 323
total length: 9258.618971
unconverted: 0( 0.00%)
Waypoints:
point count: 118
- Noise reduction
gpx2shp has several thresholds to reduct the noise path data. The
value can set as '--min-points', '--min-length' and '--min-time'. Please
try a example below.
prompt> gpx2shp --min-points 6 -s pinatest2.gpx
gpx2shp:../pinatest3.gpx:3962 track was not converted because of
less then 6 points. (<- this path is not converted because the path
has only 5 points)
Track Points:
track count: 3
point count: 653
total length: 156439.490642
unconverted: 1(25.00%)
Routes:
route count: 1
point count: 323
total length: 9258.618971
unconverted: 0( 0.00%)
Waypoints:
point count: 118
- Length and time units
You can choose any length related units that are supported by proj4
for attribute table using
'--length-unit' (for length column, default: m),
'--time-unit' (for time column, default: sec),
'--speed-length-unit' (for speed column, default: km),
'--speed-time-unit' (for speed column, default: hour) and
'--length-ellipsoid' (for length calculation, default: UGS84).
You can see the supported units by 'geod -lu' and 'geod -le' command.
Supported time unit are 'sec', 'min', 'hour' and 'day'.
- Other futures
There are other futures in gpx2shp. Please check the option list using
gpx2shp --help
Problem or Suggestion
=====================
Please let me know about your opinion in English or Japanese by e-mail.
washitoshi at yahoo.co.jp
http://gpx2shp.sourceforge.jp/
Acknowledgments
===============
NEDA (National Economic and Development Authority) Region IV-B office
My generous counter part
Yoshio Tanaka
My project leader
Petter Reinholdtsen
Many support to develop this
Frank Warmerdam and the team
shapelib and proj4
0.7
Big gpx file support // finish
README // finish
Projection converter
gps2shp
0.8
Windows binary
0.9
GUI
1.0
Documents
This diff is collapsed.
This diff is collapsed.
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
AC_INIT(gpx2shp, 0.68, washitoshi at yahoo.co.jp)
AM_INIT_AUTOMAKE(gpx2shp, 0.68)
AC_CONFIG_SRCDIR(src/main.c)
AM_CONFIG_HEADER(src/config.h)
# Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET
# Ask GCC to give us heaps of warnings
if eval "test x$GCC = xyes"; then
CFLAGS="$CFLAGS -W -Wall -Wcast-align -Wcast-qual"
CFLAGS="$CFLAGS -Wmissing-declarations -Wmissing-prototypes"
CFLAGS="$CFLAGS -Wstrict-prototypes -Wpointer-arith -Wreturn-type"
AC_SUBST(CFLAGS)
fi
# Checks for libraries.
AC_CHECK_LIB(proj, pj_param)
AC_CHECK_LIB(expat, XML_SetUserData)
AC_CHECK_LIB(z, inflate)
AC_CHECK_LIB(m, cos)
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(limits.h stdlib.h string.h unistd.h)
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_STRUCT_TM
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_MKTIME
AC_FUNC_REALLOC
AC_CHECK_FUNCS(memset sqrt)
AC_CONFIG_FILES(Makefile src/Makefile man/Makefile)
AC_OUTPUT
This package was debianized by Petter Reinholdtsen <pere@debian.org> on
Sun, 12 Dec 2004 17:13:58 +0100.
It was downloaded from <URL:http://sourceforge.jp/projects/gpx2shp/>
Upstream Author: "HIRAOKA, Toshihiro" <washitoshi@yahoo.co.jp>
License:
gpx2shp is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2, or (at your option) any later
version.
Bash is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License with
your Debian GNU/Linux system, in /usr/share/common-licenses/GPL, or with
the Debian GNU/Linux gpx2shp source package as the file COPYING. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite
330, Boston, MA 02111-1307, USA.
NEWS
README
TODO
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
config.status: configure
dh_testdir
# Add here commands to configure the package.
CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info
build: build-stamp
build-stamp: config.status
dh_testdir
# Add here commands to compile the package.
$(MAKE) all check
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp
# Add here commands to clean up after the build process.
-$(MAKE) distclean
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
cp -f /usr/share/misc/config.sub config.sub
endif
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
cp -f /usr/share/misc/config.guess config.guess
endif
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Add here commands to install the package into debian/gpx2shp.
$(MAKE) install DESTDIR=$(CURDIR)/debian/gpx2shp
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs ChangeLog
dh_installdocs
dh_installexamples
# dh_install
# dh_installmenu
# dh_installdebconf
# dh_installmime
# dh_installinfo
dh_installman
dh_link
dh_strip
dh_compress
dh_fixperms
# dh_makeshlibs
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
This diff is collapsed.
#!/usr/bin/sh
GB=`which gpsbabel`
GS="./gpx2shp"
GSOPT="-sv"
INTYPE="garmin"
INFILE="/dev/ttyS0"
OUTTYPE="gpx"
OUTFILE=`date +%y%m%d%k%M`
OUTWPT=$OUTFILE"_wpt.gpx"
OUTTRK=$OUTFILE"_trk.gpx"
OUTRTE=$OUTFILE"_rte.gpx"
if (! [[ -x $GB ]] )
then
echo "gpsbabel is not installed on your path"
echo "Abort."
exit 1
fi
echo "getting waypoint data from your GPS..."
$GB -w -i $INTYPE -f $INFILE -o $OUTTYPE -F $OUTWPT
$GS $GSOPT $OUTWPT
echo "getting trackpoint data from your GPS..."
$GB -t -i $INTYPE -f $INFILE -o $OUTTYPE -F $OUTTRK
$GS $GSOPT $OUTTRK
echo "getting routedata data from your GPS..."
$GB -r -i $INTYPE -f $INFILE -o $OUTTYPE -F $OUTRTE
$GS $GSOPT $OUTRTE
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
:
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
chmodcmd=""
else
instcmd=$mkdirprog
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f "$src" ] || [ -d "$src" ]
then
:
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
:
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
:
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
:
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
:
fi