[GRASSLIST:2284] output shapefiles - options?
David Orme
d.orme at imperial.ac.uk
Mon Jan 19 09:54:07 EST 2004
Hi,
I'm working with a series of vector files in Grass 5.7 which I need to
export to shapefiles. The geometry is stored as native grass files and
the attributes are stored in a PostgreSQL database. I've tried using
v.out.ogr but there is a problem with exporting attributes with
character data types (all the character attributes are fixed length) :
> WARNING: pg driver: column 'sm_name', type 0 is not supported
I can think of a number of possible ways forward - getting ODBC working
and connecting to the pg table that way, using a PostGIS database to
store geometry and using the pgsql2shp dumper program.
I've tried working with postgis - one problem is I can't get
pg.postgisdb to create a database: I've pointed to all the correct
files (incidentally, pg.posgisdb seems to be hard coded to look for
libpostgis files in ./lib/contrib - I had to create this folder and
link in the libpostgis files in from their installed location in ./lib)
but get the following:
> /usr/local/grass57/scripts/pg.postgisdb: line 199: createdb: command
> not found
I _can_ connect to an existing postgis db created within psql and new
vector files can be created in that database without problem. The
problem is that the geometry table contains linestrings for the areas
and also points for the label points and pgsql2shp can't write both
types into one file and currently doesn't have the option to
selectively export geometry types.
Can anyone suggest fixes / tell me if ODBC will export the character
columns / suggest another alternative?
Many thanks,
David Orme
More information about the grass-user
mailing list