logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

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

Description

pkascii2ogr  creates a vector dataset (points or single polygon) from an ASCII textfile.  A better alter‐
       native 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 (-x-y), starting from 0.  The default is to
       use the first (-dx 0) and second (-dx 1) columns for x and y respectvely.  Specify the names and types of
       the remaining columns in your input file via the option pairs -n and -ot respectively.  The default field
       separator is space.

Example

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

       pkascii2ogr-iinput.txt-ooutput.shp-x2-x1-nid-otInteger-nlabel-otInteger-a_srsepsg:4326

Name

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

Options

-ifilename, --inputfilename
              input ASCII file

       -ofilename, --outputfilename
              Output file

       -fOGRformat, --fOGRformat
              Output sample file format

       -xcol, --xcol
              column number of x (0)

       -ycol, --ycol
              column number of y (1)

       -l, --line
              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)

       -nfieldname, --namefieldname
              Field names for the columns in the input ascii file

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

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

       -fsseparator, --fsseparator
              field separator.

       -vn, --verbosen
              verbose (0)

See Also

pkascii2img(1)

                                                 01 January 2025                                  pkascii2ogr(1)

Synopsis

pkascii2ogr [-iinput] [-ooutput] [-fOGRformat] [-xcol] [-ycol] [-line] [-nfieldname] [-ottype]
                   [-fsseparator]

See Also