shpadd - Man Page
append a shape to an ESRI shapefile
shpadd shp_file [[x y] [+]]*
Appends a shape to the shapefile determined from shp_file. The geometric data of the new shape consists of lists of X/Y points on the command line grouped into parts, with points in different parts separated by a plus (+) sign. If no points or parts are given then a shape of type NullShape is appended to the shapefile, and otherwise the type of the new shape is determined by the shapefile´s header. See shpdump(1) for a description of shape types and how geometric data for parts are interpreted for a specific type. No geometric restrictions set by the shapefile specification are enforced by shpadd(1).
Shapefiles actually consist of two files with the same basename and extensions .shp and .shx (or .SHP and .SHX) containing the shape data and shape index respectively. The files to open are determined by first stripping any filename extension from file and attempting to open the files shp_file.shp or shp_file.SHP, and shp_file.shx or shp_file.SHX for the respective data and index files.
the name of an existing shapefile.
- x1 y1 x2 y2 ... xn yn
the set of x,y coordinates that describes the shape that you wish to add. Note that you must specify the correct number of parameters for a given type of shapefile. e.g.: for point shapefiles you have to pass 1 pair of XY coordinates and for a polygon shapefile you should pass at least 4 pairs of XY coordinates (where the first and the last point must have the same coordinates).
shpadd testpolygon 100000 7000000 250000 6500000 200000 6000000 100000 7000000
assuming that testpolygon is a polygon shapefile, this command line will insert a new shape (a triangle) into testpolygon with the following XY coordinates:
vertice 0: 100000 7000000 (this will also be the vertice where the shape starts and ends) vertice 1: 250000 6500000 vertice 2: 200000 6000000 vertice 3: 100000 7000000
Successful program execution.
Missing shp_file argument, the shapefile can´t be opened, or the program ran out of memory.
The following diagnostics may be issued on stdout:
Unable to open:shp_file
Out of memory
shpadd is part of shapelib, maintained by Frank Warmerdam. This guide was created by Eduardo Patoo Kanegae and converted to manpage by Johan Van de Wauw.
Coordinate values that can´t be be parsed by sscanf(3) get undefined values. There´s no way to give measure or Z data to vertices in a shape, but those are always set to zero if the shapefile´s shape type requires those values. MultiPatch shape types aren´t supported.
dbfadd(1), dbfcat(1), dbfcreate(1), dbfdump(1), dbfinfo(1), shpcat(1), shpcentrd(1), shpcreate(1), shpdump(1), shpdxf(1), shpfix(1), shpinfo(1), shpproj(1), shprewind(1), shptest(1)
dbfadd(1), dbfcat(1), dbfcreate(1), dbfdump(1), dbfinfo(1), Shape_PointInPoly(1), shpcat(1), shpcentrd(1), shpcreate(1), shpdump(1), shpdxf(1), shpfix(1), shpinfo(1), shpproj(1), shprewind(1), shptest(1).