Reference

pkascii2ogr(1)

program to create vector points or polygons from text file

NAME

pkascii2ogr - program to create vector points or polygons from text file

SYNOPSIS

FCpkascii2ogrF[0] [FC-iF[0] input] [FC-oF[0] output] [FC-fF[0] OGRformat] [FC-xF[0] col] [FC-yF[0] col] [FC-lineF[0]] [FC-nF[0] fieldname] [FC-otF[0] type] [FC-fsF[0] separator]

DESCRIPTION

pkascii2ogr creates a vector dataset (points or single polygon) from an ASCII textfile. A better alternative is to use virtual vector datasets ⟨http://www.gdal.org/drv_vrt.html⟩ . Specify the position of the vertices (x and y) in the columns defined by the options (FC-xF[0] FC-yF[0]), starting from 0. The default is to use the first (FC-dxF[0] 0) and second (FC-dxF[0] 1) columns for x and y respectvely. Specify the names and types of the remaining columns in your input file via the option pairs FC-nF[0] and FC-otF[0] respectively. The default field separator is space.

OPTIONS

FC-iF[0] filename, FC--inputF[0] filename

input ASCII file

FC-oF[0] filename, FC--outputF[0] filename

Output file

FC-fF[0] OGRformat, FC--fF[0] OGRformat

Output sample file format

FC-xF[0] col, FC--xF[0] col

column number of x (0)

FC-yF[0] col, FC--yF[0] col

column number of y (1)

FC-lF[0], FC--lineF[0]

create OGRPolygon as geometry instead of points. Fields are taken from first point and polygon is automatically closed (no need to repeat first point at last line). (false: use OGRPoint)

FC-nF[0] fieldname, FC--nameF[0] fieldname

Field names for the columns in the input ascii file

FC-otF[0] type, FC--otypeF[0] type

Field type (Real, Integer, String) for each of the fields as defined by name

FC-a_srsF[0] EPSG:number, FC--a_srsF[0] EPSG:number

Override the projection for the output file, use epsg: or Wkt string

FC-fsF[0] separator, FC--fsF[0] separator

field separator.

FC-vF[0] n, FC--verboseF[0] n

verbose (0)

EXAMPLE

Create a vector shape file (FCoutput.shpF[0]) from input ASCII file (FCinput.txtF[0]). The coordinates x (longitude) and y (latitude) can be found in FCinput.txtF[0] as columns 3 and 2 respectively (columns start counting from 0). The remaining 2 columns in FCinput.txtF[0] are used as fields (attributes) of type integer: id (column 0) and label (column 3). The projection is set to lat lon (epsg:4326).

FC
pkascii2ogr -i input.txt -o output.shp -x 2 -x 1 -n id -ot Integer -n label -ot Integer -a_srs epsg:4326
      F[0]

SEE ALSO

pkascii2img(1)

History