shpsort1
Rewrite a shapefile sorted by a field or by the geometry ##synopsis shpsort infile outfile field[;...] [<(ascending|descending)[;...]>] ##description rewrite a shapefile sorted by a field or by the geometry. for polygons, sort by area, for lines sort by length and do nothing for all others. ##options ##author shpsort is part of shapelib, maintained by frank warmerdam. ##see also 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)
History
- Debian 13 (Trixie): the text shown here
- Debian 12 (Bookworm)
- Debian 11 (Bullseye)
- Debian 10 (Buster)
- Debian 9 (Stretch)
See also
Mentioned on this page
dbfadd(1)
add a row to an xBase DBF file ##SYNOPSIS dbfadd xbase_file field_values... ##DESCRIPTION Adds a row to the DBF file named by xbase_file with column values given by the field_values options that follow. A NULL value is denoted by an empty argument. ##OPTIONS ##EXAMPLE dbfadd testbase.dbf REGION1 25.656 150.22 Assuming that testbase.dbf has 3 fields (NAME, AREA and VALUE), this command line will insert a new record into testbase.dbf with the value "REGION1" for NAME, '25.656' for AREA and '150.22' for VALUE field. ##EXIT STATUS ##DIAGNOSTICS The following diagnostics may be issued on stdout: DBFOpen(xbase_file,"rb+") failed. Got count1 fields, but require count2 ##AUTHOR dbfcreate 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. It was further enhanced with the man page written by Joonas Pihlaja ([email protected]). ##BUGS Field values that are too large to fit in a field are silently truncated from the right. Numeric field values that can't be parsed by atof(3) get undefined values. ##SEE ALSO dbfcat(1), dbfcreate(1), dbfdump(1), dbfinfo(1), shpadd(1), shpcat(1), shpcentrd(1), shpcreate(1), shpdump(1), shpdxf(1), shpfix(1), shpinfo(1), shpproj(1), shprewind(1), shptest(1)
dbfcat(1)
appends the records of a source xBase file ##SYNOPSIS dbfcat [-v] [-f] from_DBFfile to_DBFfile ##DESCRIPTION Appends the records of a source xBase file into a destiny xBase file. Both files must have the same number of fields. ##OPTIONS ##EXAMPLE dbfcat -v testbase1 testbase2 ##AUTHOR dbfcat 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. ##SEE ALSO dbfadd(1), dbfcreate(1), dbfdump(1), dbfinfo(1), shpadd(1), shpcat(1), shpcentrd(1), shpcreate(1), shpdump(1), shpdxf(1), shpfix(1), shpinfo(1), shpproj(1), shprewind(1), shptest(1)
dbfcreate(1)
Create an empty xBase DBF file ##SYNOPSIS dbfcreate xbase_file [[-s field_name width] | [-n field_name width decimals],...] ##DESCRIPTION Creates an empty DBF file called xbase_file with columns described by all the -s and -n options that follow. ##OPTIONS ##EXAMPLE dbfcreate testbase -s NAME 20, -n AREA 9 3, -n VALUE 9 2 this will create a file named testbase.dbf with 3 fields: NAME (string (20)), AREA (float (9,3)) and VALUE (float (9,2)) ##EXIT STATUS ##DIAGNOSTICS The following diagnostics may be issued on stdout: DBFCreate(xbase_file) failed. DBFAddField(field_name,FTString,width,0) failed. DBFAddField(field_name,FTDouble,width,decimals) failed. Argument incomplete, or unrecognised: arg ##AUTHOR dbfcreate 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. It was further enhanced with the man page written by Joonas Pihlaja ([email protected]). ##SEE ALSO dbfadd(1), dbfcat(1), dbfdump(1), dbfinfo(1), shpadd(1), shpcat(1), shpcentrd(1), shpcreate(1), shpdump(1), shpdxf(1), shpfix(1), shpinfo(1), shpproj(1), shprewind(1), shptest(1)
dbfdump(1)
dumps the content of a xBase file to the terminal ##SYNOPSIS dbfdump [-h] [-r] [-m] xbase_file ##DESCRIPTION Dumps the contents of xbase_file to standard output. The first line contains the field names appearing in xbase_file, and each of the following lines contains the field values of a record. Field names and values are padded by spaces to their field widths. Empty fields are printed as the string "(NULL)". ##OPTIONS ##EXAMPLE dbfdump -h testbase.dbf assuming that testbase.dbf has 1 record (inserted by other example using dbfadd), this command line will produce the following output: ##EXIT STATUS ##DIAGNOSTICS The following diagnostics may be issued on stdout: DBFOpen(xbase_file,"r") failed. There are no fields in this table! ##AUTHOR dbfdump 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. It was further enhanced with the man page written by Joonas Pihlaja ([email protected]). ##BUGS Unless the -r option is given, values in numeric fields that overflow the int or double types of the C language are printed as plus or minus a huge number. For integer fields the huge value is HUGE_VALL from ##SEE ALSO dbfadd(1), dbfcat(1), dbfcreate(1), dbfinfo(1), shpadd(1), shpcat(1), shpcentrd(1), shpcreate(1), shpdump(1), shpdxf(1), shpfix(1), shpinfo(1), shpproj(1), shprewind(1), shptest(1)
dbfinfo(1)
Displays basic information for a given xBase file ##SYNOPSIS dbfinfo xbase_file ##DESCRIPTION Displays basic information for a given xBase file, like number of columns, number of records and type of each column. ##OPTIONS ##EXAMPLE dbfinfo testbase ##AUTHOR dbfinfo 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. ##SEE ALSO dbfadd(1), dbfcat(1), dbfcreate(1), dbfdump(1), shpadd(1), shpcat(1), shpcentrd(1), shpcreate(1), shpdump(1), shpdxf(1), shpfix(1), shpinfo(1), shpproj(1), shprewind(1), shptest(1)
shpcat(1)
appends the records of a source shapefile ##SYNOPSIS shpcat [-v] [-f] from_shpfile to_shpfile ##DESCRIPTION Appends the content of a source shapefile into a destination shapefile. Both files must be the same shapefile type. ##OPTIONS ##EXAMPLE shpcat -v shapefile1 shapefile2 ##AUTHOR shpcat 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. ##SEE ALSO dbfadd(1), dbfcat(1), dbfcreate(1), dbfdump(1), dbfinfo(1), shpadd(1), shpcentrd(1), shpcreate(1), shpdump(1), shpdxf(1), shpfix(1), shpinfo(1), shpproj(1), shprewind(1), shptest(1)
shpcentrd(1)
computes XY centroid for polygon shapefiles ##SYNOPSIS shpcentrd shp_file new_shp_file ##OPTIONS ##EXAMPLE shpcentrd apolygonfile pointcentrd ##AUTHOR shpcentrd 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. ##SEE ALSO dbfadd(1), dbfcat(1), dbfcreate(1), dbfdump(1), dbfinfo(1), shpadd(1), shpcat(1), shpcreate(1), shpdump(1), shpdxf(1), shpfix(1), shpinfo(1), shpproj(1), shprewind(1), shptest(1)
shpcreate(1)
create an empty ESRI shapefile ##SYNOPSIS shpcreate shp_file [point|arc|polygon|multipoint] ##DESCRIPTION Creates an empty shapefile supporting shapes of the given type. 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 create are determined by first stripping any filename extension from shp_file and attempting to create 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 supported values for the shapetype argument are: point, arc, polygon, and multipoint. ##OPTIONS ##EXAMPLE shpcreate testpolygon polygon this will create a polygon shapefile named testpolygon (in fact testpolygon.shp and testpolygon.shx will be created). ##EXIT STATUS ##DIAGNOSTICS The following diagnostics may be issued on stdout: Shape Type `shapetype' not recognised. Unable to create:shp_file ##AUTHOR dbfdump 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. It was further enhanced with the man page written by Joonas Pihlaja ([email protected]). ##SEE ALSO dbfadd(1), dbfcat(1), dbfcreate(1), dbfdump(1), dbfinfo(1), shpadd(1), shpcat(1), shpcentrd(1), shpdump(1), shpdxf(1), shpfix(1), shpinfo(1), shpproj(1), shprewind(1), shptest(1)
shpdump(1)
dumps as text and/or validates the content of an ESRI shapefile ##SYNOPSIS shpdump [-validate] shp_file ##DESCRIPTION Prints the contents of the shapefile shp_file to standard output in textual format. 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 shp_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. Output consists of a header giving number and type of shapes in the file and the bounds for the minimum and maximum X, Y, Z, and M values appearing in the shapes. The header is followed by the geometric data for each shape in the file. All shapes in the file should be of the same type, except that NullShape typed shapes may be intermixed with any other type. The header has the form See section SHAPE TYPES below for the list of possible shape types. Next for each shape in the file a header giving it's shape_index, it's type type, number of vertices nVertices, number of parts nParts, and bounding box is given, followed by the vertex data of each part. The shape_index of a shape is the number of the shape starting from zero in the shape file. Each vertex has the form If there are multiple parts then the type of the part is appended appended to first vertex of each part, and the first vertex of the second and following parts is preceded by a plus (+) sign. The part type is Ring for all shape types except MultiPatch where it is the type of a surface patch. See below for the description of possible part types. ##SHAPE TYPES Each type of shape except MultiPatch typed shapes comes in three flavours: The normal unsuffixed type, where points lie in X/Y-space; a type with suffix M where points lie in X/Y-space and additionally have a measure value in M-space; and finally a type with suffix Z where points lie in X/Y/Z-space and also have a measure value in M-space. ##OPTIONS ##EXIT STATUS ##EXAMPLE $ shpdump shapefile.shp ##DIAGNOSTICS The following diagnostics may be issued on stdout: Unable to open:shp_file ##AUTHOR shpdump 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. It was further enhanced with the man page written by Joonas Pihlaja ([email protected]). ##BUGS The -validate option supports only one outer ring in a polygonal shape and assumes that the first ring in a shape is the outer ring. It doesn't support polygons inside MultiPatch shapes. The X and Y coordinates of a point are printed to three decimal places only. ##SEE ALSO dbfadd(1), dbfcat(1), dbfcreate(1), dbfdump(1), dbfinfo(1), shpadd(1), shpcat(1), shpcentrd(1), shpcreate(1), shpdxf(1), shpfix(1), shpinfo(1), shpproj(1), shprewind(1), shptest(1)
shpdxf(1)
creates a DXF from an existing shapefield ##SYNOPSIS shpdxf shapefile idfield ##OPTIONS ##EXAMPLE shpdxf shapefile name ##AUTHOR shpxdf 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. ##SEE ALSO dbfadd(1), dbfcat(1), dbfcreate(1), dbfdump(1), dbfinfo(1), shpadd(1), shpcat(1), shpcentrd(1), shpcreate(1), shpdump(1), shpfix(1), shpinfo(1), shpproj(1), shprewind(1), shptest(1)
shpfix(1)
fix nulls and inconsistencies in shapefiles ##SYNOPSIS shpfix in_shp_file out_shp_file [record# to blank] ##OPTIONS ##EXAMPLE shpfix broken fixed ##AUTHOR shpfix 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. ##SEE ALSO dbfadd(1), dbfcat(1), dbfcreate(1), dbfdump(1), dbfinfo(1), shpadd(1), shpcat(1), shpcentrd(1), shpcreate(1), shpdump(1), shpdxf(1), shpinfo(1), shpproj(1), shprewind(1), shptest(1)
shpinfo(1)
Displays basic information for a given shapefile ##SYNOPSIS shpinfo shapefile ##DESCRIPTION Displays basic information for a given shapefile, like shapefile type, number of objects and its extents. ##OPTIONS ##EXAMPLE shpinfo testpolygon ##AUTHOR shpinfo 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. ##SEE ALSO dbfadd(1), dbfcat(1), dbfcreate(1), dbfdump(1), dbfinfo(1), shpadd(1), shpcat(1), shpcentrd(1), shpcreate(1), shpdump(1), shpdxf(1), shpfix(1), shpproj(1), shprewind(1), shptest(1)
shpproj(1)
Reproject Shapefiles using PROJ
shprewind(1)
validates and resets the winding order of rings ##SYNOPSIS shprewind in_shp_file out_shp_file ##DESCRIPTION Validates and resets the winding order of rings in polygon geometries to match the ordering required by shapefile specification. This is useful for shapefiles having troubles when checked with a 'shpdump -validate'. Makes a copy of the shapefile in_shp_file to out_shp_file and fixes the orientation of points in the rings of Polygon, PolygonZ, and PolygonM typed shapes to conform to the shapefile specification. According to the specification, the vertices of outer rings should be oriented clockwise on the X/Y plane, and those of inner rings counterclockwise. 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 in_shp_file and attempting to open the files in_shp_file.shp or in_shp_file.SHP, and in_shp_file.shx or in_shp_file.SHX for the respective data and index files. The files to create from out_shp_file are determined by stripping any filename extension from out_shp_file and appending .shp and .shx suffixes for the respective data and index files. ##OPTIONS ##EXIT STATUS ##DIAGNOSTICS The following diagnostics may be issued on stdout: Unable to open:in_shp_file Unable to create:out_shp_file count objects rewound. ##EXAMPLE shprewind badshapefile newshapefile ##AUTHOR shprewind 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. It was further enhanced with the man page written by Joonas Pihlaja ([email protected]). ##BUGS The implementation assumes that there is at most one outer ring in each shape, that it is the first ring in a shape, and all other rings in a shape are inner rings. Polygons inside MultiPatch shape types aren't rewound. ##SEE ALSO dbfadd(1), dbfcat(1), dbfcreate(1), dbfdump(1), dbfinfo(1), shpadd(1), shpcat(1), shpcentrd(1), shpcreate(1), shpdump(1), shpdxf(1), shpfix(1), shpinfo(1), shpproj(1), shptest(1)
shptest(1)
create some shapefiles for testing