Next: , Up: Shapefile   [Contents][Index]


1.1 shp - Shape Data

Module (shapefile shp).

Each shape file contains a list of shapes. All shapes are of the same type (or the null shape).

All shapes define the make-shape, parse-shape, and shape?. make-shape and shape? are self explanatory. Each parse-shape takes a bytevector, and a byte offset into that vector, and reads from the vector creating a shape. However, you usually don’t want to call the parse procedures directly, but instead use

Function: parse-shp-file port

Reads shapedata from port. The data must start with a propper shp header.

Returns a list of shapes, as defined below.

The following generic procedures are also available, in lie of individual getters.

Function: get-bounding-box shape

Returns the (minimum?) bounding box for shape, which is any of the shape types which have a bounding box.

See Rectangle

Function: get-parts shape

For poly-lines and polygons, return the list of parts.

For multi-points, return the list of points.

1.1.1 point

Data Type: point x y
Function: point? point
Function: make-point x y
Function: point-x point
Function: point-y point
Function: parse-point bytevector offset

1.1.2 multi point

Data Type: multi-point box points

A group of points. box is the (minimum?) bounding box which all points lie within. points is a list of points. point

Function: parse-multi-point bytevector offset

1.1.3 poly-line & polygon

Data Type: poly-line box parts
Data Type: polygon box parts

Poly-lines and polygons are really similar structures. box is in both cases the (minimum?) bounding box containing all nodes of the shape. parts is a list of parts, where each part is a list of points. Each part is a connected series of points (draw lines between them). For polygons, the first and last point must be the same.

Function: parse-poly-line bytevector offset
Function: parse-polygon bytevector offset

Next: , Up: Shapefile   [Contents][Index]