Commit 485e3f0e authored by Petter Reinholdtsen's avatar Petter Reinholdtsen Committed by Bas Couwenberg

Imported Debian patch 0.70-1

parents f7b0c4be 278faeb2
AUTHORS
========
Toshihiro Hiraoka <washitoshi at yahoo.co.jp>
Toshihiro Hiraoka <hiraoka [@at@] azukimap.jp>
maintainer
Petter Reinholdtsen <pere at hungry.com>
Petter Reinholdtsen <pere [@at@] hungry.com>
bug fix, debian package and advices
0.70
======
by Toshihiro Hiraoka
- Applied debian patches.
- Applied Rodney's patch that tracks which didn't have <speed> elements
- Fixed a bug reported by forallsecure. http://www.forallsecure.com/bug-reports/6dd6730b963ea2c4886aee521508d95215f11ab2/
- Supported 1 line gpx.
- Reliability improvement.
- Formated the codes.
0.69
======
by Petter Reinholdsen
- Add configure option "--enable-coverage".
- Add few check targets.
......
......@@ -6,18 +6,32 @@ 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_meta.txt \
pinatest2_rte.dbf \
pinatest2_meta.txt
pinatest2_rte.shp \
pinatest2_rte.shx \
pinatest2_rte_edg.dbf \
pinatest2_rte_edg.shp \
pinatest2_rte_edg.shx \
pinatest2_rte_pnt.dbf \
pinatest2_rte_pnt.shp \
pinatest2_rte_pnt.shx \
pinatest2_trk.dbf \
pinatest2_trk.shp \
pinatest2_trk.shx \
pinatest2_trk_edg.dbf \
pinatest2_trk_edg.shp \
pinatest2_trk_edg.shx \
pinatest2_trk_pnt.dbf \
pinatest2_trk_pnt.shp \
pinatest2_trk_pnt.shx \
pinatest2_wpt.dbf \
pinatest2_wpt.shp \
pinatest2_wpt.shx
GPX2SHP=src/gpx2shp
$(GPX2SHP):
$(MAKE) -C `dirname $(GPX2SHP)` `basename $(GPX2SHP)`
check: $(GPX2SHP)
$(GPX2SHP) || true
$(GPX2SHP) --version
......
This diff is collapsed.
0.70
======
by Toshihiro Hiraoka
- Applied debian patches.
- Applied Rodney's patch that tracks which didn't have <speed> elements
- Fixed a bug reported by forallsecure. http://www.forallsecure.com/bug-reports/6dd6730b963ea2c4886aee521508d95215f11ab2/
- Supported 1 line gpx.
- Reliability improvement.
- Formated the codes.
0.69
====
by Petter Reinholdtsen
......
......@@ -157,7 +157,7 @@ for attribute table using
Problem or Suggestion
=====================
Please let me know about your opinion in English or Japanese by e-mail.
washitoshi at yahoo.co.jp
hiraoka [@at@] azukimap.jp
http://gpx2shp.sourceforge.jp/
Acknowledgments
......
0.7
Big gpx file support // finish
README // finish
Projection converter
Projection converter // Won't fix
0.8
Windows binary
......
This diff is collapsed.
This diff is collapsed.
......@@ -2,8 +2,8 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
AC_INIT(gpx2shp, 0.69, kogame at gmail.com)
AM_INIT_AUTOMAKE(gpx2shp, 0.69)
AC_INIT(gpx2shp, 0.70, hiraoka [@at@] azukimap.jp)
AM_INIT_AUTOMAKE(gpx2shp, 0.70)
AC_CONFIG_SRCDIR(src/main.c)
AM_CONFIG_HEADER(src/config.h)
......
gpx2shp (0.70-1) unstable; urgency=low
[ Petter Reinholdtsen ]
* New upstream release 0.70.
- Add support for GPX files without <speed> tags (Closes: #310078).
- Reliability fixes to avoid crashes (Closes: #715992).
- Drop patches 10_check_clean.dpatch and20_version_0.69.dpatch now
included upstream.
- Drop build dependency dpatch now that we do not have any local
patches.
* Updated copyright file to make it clear who got the copyright.
* Drop Jon Saints from uploader list. His email address no longer
work.
-- Petter Reinholdtsen <pere@debian.org> Tue, 16 Jul 2013 20:57:19 +0200
gpx2shp (0.69-4) unstable; urgency=low
[ Francesco Paolo Lovergine ]
......
......@@ -2,8 +2,8 @@ Source: gpx2shp
Section: science
Priority: optional
Maintainer: Debian GIS Project <pkg-grass-devel@lists.alioth.debian.org>
Uploaders: Petter Reinholdtsen <pere@debian.org>, Jon Saints <saintsjd@yahoo.com>, Francesco Paolo Lovergine <frankie@debian.org>
Build-Depends: debhelper (>= 8), dh-autoreconf, dpatch, libproj-dev, libexpat1-dev
Uploaders: Petter Reinholdtsen <pere@debian.org>, Francesco Paolo Lovergine <frankie@debian.org>
Build-Depends: debhelper (>= 8), dh-autoreconf, libproj-dev, libexpat1-dev
Standards-Version: 3.9.4
Homepage: http://gpx2shp.sourceforge.jp
Vcs-Browser: http://anonscm.debian.org/viewvc/pkg-grass/packages/gpx2shp
......
......@@ -3,7 +3,7 @@ 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>
Copyright (c) 2004-2013 "HIRAOKA, Toshihiro" <washitoshi@yahoo.co.jp>
License:
......
10_check_clean
20_version_0.69
#! /bin/sh /usr/share/dpatch/dpatch-run
## 10_clean_check.dpatch by Petter Reinholdtsen <pere@hungry.com>
##
## All lines beginning with `## DP:' are a description of the patch.
##
## DP: Make sure 'make check' work out of the box, and make sure 'make
## DP: clean' cleans up after the 'check' target.
@DPATCH@
This is the proper change:
--- gpx2shp-0.69.orig/Makefile.am
+++ gpx2shp-0.69/Makefile.am
@@ -6,18 +6,32 @@
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_meta.txt \
pinatest2_rte.dbf \
- pinatest2_meta.txt
+ pinatest2_rte.shp \
+ pinatest2_rte.shx \
+ pinatest2_rte_edg.dbf \
+ pinatest2_rte_edg.shp \
+ pinatest2_rte_edg.shx \
+ pinatest2_rte_pnt.dbf \
+ pinatest2_rte_pnt.shp \
+ pinatest2_rte_pnt.shx \
+ pinatest2_trk.dbf \
+ pinatest2_trk.shp \
+ pinatest2_trk.shx \
+ pinatest2_trk_edg.dbf \
+ pinatest2_trk_edg.shp \
+ pinatest2_trk_edg.shx \
+ pinatest2_trk_pnt.dbf \
+ pinatest2_trk_pnt.shp \
+ pinatest2_trk_pnt.shx \
+ pinatest2_wpt.dbf \
+ pinatest2_wpt.shp \
+ pinatest2_wpt.shx
GPX2SHP=src/gpx2shp
+$(GPX2SHP):
+ $(MAKE) -C `dirname $(GPX2SHP)` `basename $(GPX2SHP)`
check: $(GPX2SHP)
$(GPX2SHP) || true
$(GPX2SHP) --version
This change is generated by automake:
--- gpx2shp-0.69.orig/Makefile.in
+++ gpx2shp-0.69/Makefile.in
@@ -108,16 +108,28 @@
EXTRA_DIST = gps2shp pinatest2.gpx debian develop
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_meta.txt \
pinatest2_rte.dbf \
- pinatest2_meta.txt
+ pinatest2_rte.shp \
+ pinatest2_rte.shx \
+ pinatest2_rte_edg.dbf \
+ pinatest2_rte_edg.shp \
+ pinatest2_rte_edg.shx \
+ pinatest2_rte_pnt.dbf \
+ pinatest2_rte_pnt.shp \
+ pinatest2_rte_pnt.shx \
+ pinatest2_trk.dbf \
+ pinatest2_trk.shp \
+ pinatest2_trk.shx \
+ pinatest2_trk_edg.dbf \
+ pinatest2_trk_edg.shp \
+ pinatest2_trk_edg.shx \
+ pinatest2_trk_pnt.dbf \
+ pinatest2_trk_pnt.shp \
+ pinatest2_trk_pnt.shx \
+ pinatest2_wpt.dbf \
+ pinatest2_wpt.shp \
+ pinatest2_wpt.shx
GPX2SHP = src/gpx2shp
@@ -507,6 +519,8 @@
debian-dist:
dpkg-buildpackage -rfakeroot -d -tc -us -uc
+$(GPX2SHP):
+ $(MAKE) -C `dirname $(GPX2SHP)` `basename $(GPX2SHP)`
check: $(GPX2SHP)
$(GPX2SHP) || true
$(GPX2SHP) --version
#! /bin/sh /usr/share/dpatch/dpatch-run
## 20_version_0.69.dpatch by Francesco Paolo Lovergine <frankie@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.
@DPATCH@
diff -urNad gpx2shp-0.69~/src/gpx2shp.h gpx2shp-0.69/src/gpx2shp.h
--- gpx2shp-0.69~/src/gpx2shp.h 2007-03-28 20:50:54.000000000 +0200
+++ gpx2shp-0.69/src/gpx2shp.h 2007-03-28 20:53:24.000000000 +0200
@@ -1,7 +1,9 @@
#ifndef GPX2SHP_H_INCLUDED
#define GPX2SHP_H_INCLUDED
-#define PROG gpx2shp
+#define PROG "gpx2shp"
+#define PROG_VERSION "0.69"
+
#define FILENAMELENGTH 255 /* 255 is max length for dbf string column */
#define COMMENTLENGTH 255 /* 255 is max length for dbf string column */
#define NAMELENGTH 32
diff -urNad gpx2shp-0.69~/src/main.c gpx2shp-0.69/src/main.c
--- gpx2shp-0.69~/src/main.c 2005-02-06 15:38:38.000000000 +0100
+++ gpx2shp-0.69/src/main.c 2007-03-28 20:53:04.000000000 +0200
@@ -11,7 +11,7 @@
*/
void version(void)
{
- fprintf(stdout, "gpx2shp 0.68\n");
+ fprintf(stdout, "%s %s\n",PROG,PROG_VERSION);
fprintf(stdout, "\n");
fprintf(stdout, "by Toshihiro Hiraoka\n");
fprintf(stdout, " Petter Reinholdtsen\n");
#!/usr/bin/make -f
include /usr/share/dpatch/dpatch.make
build: patch-stamp
dh build --with autoreconf
clean: unpatch
dh clean --with autoreconf
%:
dh $@ --with autoreconf
# Makefile.in generated by automake 1.7.9 from Makefile.am.
# Makefile.in generated by automake 1.9.2 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
......@@ -13,7 +13,6 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
......@@ -21,7 +20,6 @@ pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
......@@ -35,6 +33,22 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
subdir = man
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/src/config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
man1dir = $(mandir)/man1
am__installdirs = "$(DESTDIR)$(man1dir)"
NROFF = nroff
MANS = $(man_MANS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
......@@ -84,6 +98,8 @@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
datadir = @datadir@
......@@ -96,6 +112,7 @@ libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
......@@ -105,30 +122,42 @@ sysconfdir = @sysconfdir@
target_alias = @target_alias@
man_MANS = gpx2shp.1
EXTRA_DIST = $(man_MANS)
subdir = man
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/src/config.h
CONFIG_CLEAN_FILES =
DIST_SOURCES =
NROFF = nroff
MANS = $(man_MANS)
DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu man/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
uninstall-info-am:
man1dir = $(mandir)/man1
install-man1: $(man1_MANS) $(man_MANS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(man1dir)
test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)"
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
......@@ -147,8 +176,8 @@ install-man1: $(man1_MANS) $(man_MANS)
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
$(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
done
uninstall-man1:
@$(NORMAL_UNINSTALL)
......@@ -168,8 +197,8 @@ uninstall-man1:
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
rm -f $(DESTDIR)$(man1dir)/$$inst; \
echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
done
tags: TAGS
TAGS:
......@@ -177,10 +206,6 @@ TAGS:
ctags: CTAGS
CTAGS:
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = ..
distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
......@@ -194,7 +219,7 @@ distdir: $(DISTFILES)
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
......@@ -212,9 +237,10 @@ distdir: $(DISTFILES)
check-am: all-am
check: check-am
all-am: Makefile $(MANS)
installdirs:
$(mkinstalldirs) $(DESTDIR)$(man1dir)
for dir in "$(DESTDIR)$(man1dir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
......@@ -234,7 +260,7 @@ mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f $(CONFIG_CLEAN_FILES)
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
......@@ -251,6 +277,8 @@ dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
......@@ -286,8 +314,8 @@ uninstall-am: uninstall-info-am uninstall-man
uninstall-man: uninstall-man1
.PHONY: all all-am check check-am clean clean-generic distclean \
distclean-generic distdir dvi dvi-am info info-am install \
install-am install-data install-data-am install-exec \
distclean-generic distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-exec \
install-exec-am install-info install-info-am install-man \
install-man1 install-strip installcheck installcheck-am \
installdirs maintainer-clean maintainer-clean-generic \
......
.\"
.TH "gpx2shp" "1" "0.68" "Toshihiro Hiraoka" ""
.TH "gpx2shp" "1" "0.70" "Toshihiro Hiraoka" ""
.SH "NAME"
gpx2shp \- Convert GPX files to ESRI Shape file
.SH "SYNOPSIS"
......@@ -94,7 +94,7 @@ Petter Reinholdtsen
.SH "BUGS or OPINIONS"
Please e\-mail your bugs or opinions to
.br
washitoshi at yahoo.co.jp
hiraoka [@at@] azukimap.jp
.SH "SEE ALSO"
gpx2shp / gps2shp homepage
......
This diff is collapsed.
......@@ -74,6 +74,9 @@
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
......
/******************************************************************************
* $Id: dbfopen.c,v 1.1.1.1 2004/11/23 15:04:13 washi Exp $
* $Id: dbfopen.c,v 1.1.1.1 2005/02/23 18:19:53 pagong Exp $
*
* Project: Shapelib
* Purpose: Implementation of .dbf access API documented in dbf_api.html.
......@@ -34,6 +34,9 @@
******************************************************************************
*
* $Log: dbfopen.c,v $
* Revision 1.1.1.1 2005/02/23 18:19:53 pagong
* release 0.69
*
* Revision 1.1.1.1 2004/11/23 15:04:13 washi
* log msg
*
......@@ -542,7 +545,10 @@ void SHPAPI_CALL DBFClose(DBFHandle psDBF)
unsigned char abyFileHeader[32];
fseek(psDBF->fp, 0, 0);
fread(abyFileHeader, 32, 1, psDBF->fp);
if (! fread(abyFileHeader, 32, 1, psDBF->fp) ) {
// do nothing
}
abyFileHeader[1] = 95; /* YY */
abyFileHeader[2] = 7; /* MM */
......@@ -1253,7 +1259,9 @@ DBFWriteAttribute(DBFHandle psDBF, int hEntity, int iField, const void *pValue)
psDBF->nRecordLength * hEntity + psDBF->nHeaderLength;
fseek(psDBF->fp, nRecordOffset, 0);
fread(psDBF->pszCurrentRecord, psDBF->nRecordLength, 1, psDBF->fp);
if (! fread(psDBF->pszCurrentRecord, psDBF->nRecordLength, 1, psDBF->fp)) {
// do nothing
}
psDBF->nCurrentRecord = hEntity;
}
......@@ -1466,7 +1474,10 @@ DBFWriteAttributeDirectly(DBFHandle psDBF, int hEntity, int iField,
psDBF->nRecordLength * hEntity + psDBF->nHeaderLength;
fseek(psDBF->fp, nRecordOffset, 0);
fread(psDBF->pszCurrentRecord, psDBF->nRecordLength, 1, psDBF->fp);
if ( ! fread(psDBF->pszCurrentRecord, psDBF->nRecordLength, 1, psDBF->fp)) {
// do nothing
}
psDBF->nCurrentRecord = hEntity;
}
......@@ -1662,7 +1673,9 @@ DBFWriteTuple(DBFHandle psDBF, int hEntity, void *pRawTuple)
psDBF->nRecordLength * hEntity + psDBF->nHeaderLength;
fseek(psDBF->fp, nRecordOffset, 0);
fread(psDBF->pszCurrentRecord, psDBF->nRecordLength, 1, psDBF->fp);
if (! fread(psDBF->pszCurrentRecord, psDBF->nRecordLength, 1, psDBF->fp)) {
// do nothing
}
psDBF->nCurrentRecord = hEntity;
}
......@@ -1715,7 +1728,9 @@ const char SHPAPI_CALL1(*) DBFReadTuple(DBFHandle psDBF, int hEntity)
psDBF->nRecordLength * hEntity + psDBF->nHeaderLength;
fseek(psDBF->fp, nRecordOffset, 0);
fread(psDBF->pszCurrentRecord, psDBF->nRecordLength, 1, psDBF->fp);
if (! fread(psDBF->pszCurrentRecord, psDBF->nRecordLength, 1, psDBF->fp)) {
// do nothing
}
psDBF->nCurrentRecord = hEntity;
}
......
This diff is collapsed.
#ifndef lint
static const char SCCSID[] =
"@(#)geod_for.c 4.6 95/09/23 GIE REL";
static const char SCCSID[] = "@(#)geod_for.c 4.6 95/09/23 GIE REL";
#endif
# include "projects.h"
# include "geodesic.h"
# define MERI_TOL 1e-9
static double th1, costh1, sinth1, sina12, cosa12, M, N, c1, c2, D, P, s1;
static int merid, signS;
void geod_pre(void)
{
al12 = adjlon(al12); /* reduce to +- 0-PI */
signS = fabs(al12) > HALFPI ? 1 : 0;
th1 = ellipse ? atan(onef * tan(phi1)) : phi1;
costh1 = cos(th1);
sinth1 = sin(th1);
if ((merid = fabs(sina12 = sin(al12)) < MERI_TOL)) {
sina12 = 0.;
cosa12 = fabs(al12) < HALFPI ? 1. : -1.;
M = 0.;
} else {
cosa12 = cos(al12);
M = costh1 * sina12;
}
N = costh1 * cosa12;
if (ellipse) {
if (merid) {
c1 = 0.;
c2 = f4;
D = 1. - c2;
D *= D;
P = c2 / D;
void geod_pre(void) {
al12 = adjlon(al12); /* reduce to +- 0-PI */
signS = fabs(al12) > HALFPI ? 1 : 0;
th1 = ellipse ? atan(onef * tan(phi1)) : phi1;
costh1 = cos(th1);
sinth1 = sin(th1);
if ((merid = fabs(sina12 = sin(al12)) < MERI_TOL)) {
sina12 = 0.;
cosa12 = fabs(al12) < HALFPI ? 1. : -1.;
M = 0.;
} else {
c1 = geod_f * M;
c2 = f4 * (1. - M * M);
D = (1. - c2) * (1. - c2 - c1 * M);
P = (1. + .5 * c1 * M) * c2 / D;
cosa12 = cos(al12);
M = costh1 * sina12;
}
N = costh1 * cosa12;
if (ellipse) {
if (merid) {
c1 = 0.;
c2 = f4;
D = 1. - c2;
D *= D;
P = c2 / D;
} else {
c1 = geod_f * M;
c2 = f4 * (1. - M * M);
D = (1. - c2) * (1. - c2 - c1 * M);
P = (1. + .5 * c1 * M) * c2 / D;
}
}
if (merid)
s1 = HALFPI - th1;
else {
s1 = (fabs(M) >= 1.) ? 0. : acos(M);
s1 = sinth1 / sin(s1);
s1 = (fabs(s1) >= 1.) ? 0. : acos(s1);
}
}
if (merid)
s1 = HALFPI - th1;
else {
s1 = (fabs(M) >= 1.) ? 0. : acos(M);
s1 = sinth1 / sin(s1);
s1 = (fabs(s1) >= 1.) ? 0. : acos(s1);
}
}
void geod_for(void)
{
double d, sind, u, V, X, ds, cosds, sinds, ss = 0, de;
void geod_for(void) {
double d, sind, u, V, X, ds, cosds, sinds, ss = 0, de;
if (ellipse) {
d = geod_S / (D * geod_a);
if (signS)
d = -d;
u = 2. * (s1 - d);
V = cos(u + d);
X = c2 * c2 * (sind = sin(d)) * cos(d) * (2. * V * V - 1.);
ds = d + X - 2. * P * V * (1. - 2. * P * cos(u)) * sind;
ss = s1 + s1 - ds;
} else {
ds = geod_S / geod_a;
if (signS)
ds = -ds;
}
cosds = cos(ds);
sinds = sin(ds);
if (signS)
sinds = -sinds;
al21 = N * cosds - sinth1 * sinds;
if (merid) {
phi2 = atan(tan(HALFPI + s1 - ds) / onef);
if (al21 > 0.) {
al21 = PI;
if (signS)
de = PI;
else {
phi2 = -phi2;
de = 0.;
}
if (ellipse) {
d = geod_S / (D * geod_a);
if (signS)
d = -d;
u = 2. * (s1 - d);
V = cos(u + d);
X = c2 * c2 * (sind = sin(d)) * cos(d) * (2. * V * V - 1.);
ds = d + X - 2. * P * V * (1. - 2. * P * cos(u)) * sind;