shptobin

NAME
VERSION
SYNOPSIS
DESCRIPTION
AUTHOR

NAME

shptobin − dump contents of a shapefile to a binary stream

VERSION

2

SYNOPSIS

shptobin [-i index] [-d descriptor] [-s] [-bn e s w’] shapefile

DESCRIPTION

This application dumps the contents of a ESRI shapefile to a binary stream. It builds on shapelib 1.2, available from http://gdal.velocet.ca/projects/shapelib/. It is similar to shapelib’s shpdump, but it sends a binary instead of ascii stream which the geomap::lnarr fmbin command in tkgeomap can read. Go to http://www.tkgeomap.org for more information.

shapefile identifies the shapefile to read. It should be comprised of files shapefile.dbf, shapefile.shp, and shapefile.shx.

The following options are recognized:

-i index

Specifies the index of desired line. First line is at index 0. Default is to dump entire shapefile.

-d descriptor

Optional string placed at start of output stream

-s

Send all real values as float. Default is double.

-b ’n e s w’

Bounding region, given as n (north), e (east), s (south), and w (west). Lines that have no points in the bounding region are skipped.

The output stream will have the following format:

descriptor length (could be 0)
descriptor string
number of points in the first line
lat lon lat lon ... for first line
number of points in the second line
lat lon lat lon ... for second line
and so on until there are no more lines.

Lat’s and lon’s are sent as doubles unless -s option is present.

AUTHOR

Gordon Carrie user0 at address tkgeomap.org