Menu
CTAN
Comprehensive TeX Archive Network
Cover Upload Browse

Direc­tory tex-archive/graphics/pstricks/contrib/pst-geo/dataII

Project pst-geo-compress                                 2009-07-30
========================

Author: Heiko Oberdiek <oberdiek@uni-freiburg.de>
License is LPPL 1.3c,
  maintainance status: maintained
  current maintainer: author

Files:
  README (this file)
  pst-geo-compress.pl
  pst-geo-decompress.pl

Requirements: Ghostscript >= 8.56 (if prediction is used)

`pst-geo' (CTAN:graphics/pstricks/contrib/pst-geo/) comes with
huge data files:
  CTAN:graphics/pstricks/contrib/pst-geo/data/data.tgz
  CTAN:graphics/pstricks/contrib/pst-geo/dataII/dataII.tgz
Unpacked the data files consume about 134 MB.

The data files (files with extension `.dat') are PostScript files.
PostScript supports compression and decompression via filter.
The Perl script `pst-geo-compress.pl' compresses the data files
using the /FlateEncode filter and adds code to decompresses the file,
if read by a PostScript interpreter. Now the space requirements of
the data files is about 24 MB.

Caveat: Filters /FlateEncode and /FlateDecode require
PostScript language level 3 (supported by ghostscript).
(LZW compression don't need language level 3, but
the compression is less effective.)

Size reduction details:
* Much unnecessary white space is removed.
* Some comments are removed (especially number comments
  in .dat files of data.tgz), the remaining comments are preserved
  (especially city names).
* /FlateEncode filter.
* PNG prediction (method `up') is used for most of the files.
  Spaces at line ends are added to fill the space up to
  to the columns count. This improves the prediction,
  because these files contains long lists of sorted coordinate pairs.
  The prediction columns count is also the maximal line length,
  because of a ghostscript bug:

Ghostscript has a bug regarding prediction, it is fixed in
version 8.56 (2007-03-14):

| 2006-12-11T17:30:53.980862Z L. Peter Deutsch
|
| Fixes bug: the PNG predictor filters produced incorrect data for the last
| pixel of each row.  (The encoder and decoder had matching bugs, so
| encode+decode produced the correct result!)  Fixes a diff in PS3 CET
| 23-12U-1.

By having each line at the same length, the last byte of a row
has always the same value (end of line character). This does
not trigger this bug (tested with gs 7.07/8.64).

After compression the files aren't human-readable any more.
The Perl script `pst-geo-decompress.pl' can be used to
decompress a data file.

Both scripts know option -h that prints a short usage screen.
Option --gscmd allows to configure the ghostscript programm call,
if the automatic ghostscript isn't sufficient.

`pst-geo-compress.pl' is called inside the directory where
the data files are present. Options `-1' and `-2' choose
between the files from `data.tgz' and `dataII.tgz'.

`pst-geo-decompress.pl' expects the data file to decompress.
If an output file is given, the result is stored there. Otherwise
standard output is used.

History:
  2009-07-30 v1.0 First release
  2009-07-30 v1.1:
    * Workaround for ghostscript bug added:
      * Files that are compressed with prediction have
        equal line length.
      * Removing comments (except for city data files)
      * Obsolete option --prediction is therefore removed
    * Adding standalone test mode (option `--test').

Files

Name Size Date Notes
README 3273 2009-08-28 09:47
africa-bdy.dat 430869 2009-08-28 09:39
africa-cil.dat 1208423 2009-08-28 09:39
africa-riv.dat 2190429 2009-08-28 09:39
asia-bdy.dat 385718 2009-08-28 09:39
asia-cil.dat 3821210 2009-08-28 09:39
asia-isl.dat 61375 2009-08-28 09:39
asia-riv.dat 3505155 2009-08-28 09:39
c-cap.dat 3063 2009-08-28 09:39
c-sub.dat 7049 2009-08-28 09:39
citycapitals.dat 2903 2009-08-28 09:39
citysub.dat 6552 2009-08-28 09:39
europe-bdy.dat 165937 2009-08-28 09:39
europe-cil.dat 1360271 2009-08-28 09:39
europe-riv.dat 741031 2009-08-28 09:39
namer-bdy.dat 33667 2009-08-28 09:39
namer-cil.dat 3605338 2009-08-28 09:39
namer-pby.dat 226150 2009-08-28 09:39
namer-riv.dat 1391336 2009-08-28 09:39
pst-geo-compress.pl 10775 2009-08-28 09:45
pst-geo-decompress.pl 3244 2009-08-28 09:25
samer-arc.dat 11826 2009-08-28 09:39
samer-bdy.dat 236953 2009-08-28 09:39
samer-cil.dat 1609186 2009-08-28 09:39
samer-riv.dat 1696756 2009-08-28 09:39
Guest Book Sitemap Contact