[GRASS-user] Create Vector Map from Data in Postgres Table

Rich Shepard rshepard at appl-ecosys.com
Fri Mar 16 13:15:03 EDT 2012


   About a year ago I used v.in.ascii to create a point map and save the
attribute data in a postgres table. Now I already have those data in a table
and want to create a points map using the geographic coordinates (x=col 2,
y=col 3), but associating the holeid and other attributes with each point.

   I've run db.connect and db.login within the project location/mapset and
now need to create a vector point ('sites') map from these data. The table
schema is,

CREATE TABLE boreholes (
   holeid TEXT PRIMARY KEY,
   easting NUMERIC(13,6) NOT NULL,
   northing NUMERIC(13,6) NOT NULL,
   surf_elev REAL,
   holedepth INTEGER,
   purpose VARCHAR(16),
   lithology VARCHAR(16),
   hole_diam REAL,
   well_diam REAL,
   flow_gpm REAL,
   h2o_elev REAL,
   comment TEXT
);

   Can I use v.in.ogr to create a GRASS vector map from these data?

   If not, I can create an ASCII text file of the data and use v.in.ascii to
create the map. If this is the way to proceed, I suppose that I need to
empty that database table so the column values will be loaded as v.in.ascii
runs.

   Or, have I completely missed how to do this?

TIA,

Rich



More information about the grass-user mailing list