<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Just found the problem with PostgreSQL-import:<br>
<br>
If the postGIS-layer has multiple geometries (in my case, centroid
and polygon), it will be viewed with "db.tables -p", but not
imported through "v.in.ogr". Error is misleading as it says "Layer
not available". Workaround, was a copy of the layer with only one
geometry. Would be great to be able to select though, e.g. as done
in QGIS.<br>
<br>
patrick<br>
<br>
<br>
<pre wrap="">Message: 4
Date: Wed, 14 Mar 2012 10:50:57 +0100
From: "Patrick S." <a class="moz-txt-link-rfc2396E" href="mailto:patrick_GIS@gmx.ch"><patrick_GIS@gmx.ch></a>
Subject: [GRASS-user] postgreSQL import
To: grass mailing list <a class="moz-txt-link-rfc2396E" href="mailto:grass-user@lists.osgeo.org"><grass-user@lists.osgeo.org></a>
Message-ID: <a class="moz-txt-link-rfc2396E" href="mailto:4F606A01.6050504@gmx.ch"><4F606A01.6050504@gmx.ch></a>
Content-Type: text/plain; charset="iso-8859-1"
I try to import various files from PostgreSQL to GRASS in GRASS70.
/
db.connect driver=pg
database='host=<server>,dbname=<database>,schema=<schamename>'
db.login user="sustaincity" pass="+++"
db.connect -p
db.tables -p |less
for i in {1..3};
do
v.in.ogr dsn='PG:host=<servername> dbname=<dbname>
user=<username>' layer=schema.layer output=layer$i
type=boundary,centroid -o --o;
done/
This does only work for few layers. Some layers have many items inside
and these are not recognized, although I can view them through db.tables
-p.:
<i class="moz-txt-slash"><span class="moz-txt-tag">/</span>ERROR: Layer <schema.layername> not available<span class="moz-txt-tag">/</span></i>
any ideas?
</pre>
<br>
</body>
</html>