[GRASSLIST:8063] v.out.ogr to PostgreSQL

hello

when I try to use /*v.out.ogr as:*//* */
v.out.ogr input=jeo6 type=area dsn="PG:host=localhost dbname=bzk user=orkun" olayer=sil format=PostgreSQL

it gives:
Error: value <PostgreSQL> out of range for parameter <format>
       Legal range: ESRI_Shapefile,TIGER,S57,MapInfo_File,DGN,Memory,CSV,GML

what can I do to solve the problem *

regards

Ahmet Temiz

______________________________________
XamimeLT - installed on mailserver for domain @deprem.gov.tr
Queries to: postmaster@deprem.gov.tr
______________________________________
The views and opinions expressed in this e-mail message are the sender's own
and do not necessarily represent the views and the opinions of Earthquake Research Dept.
of General Directorate of Disaster Affairs.

Bu e-postadaki fikir ve gorusler gonderenin sahsina ait olup, yasal olarak T.C.
B.I.B. Afet Isleri Gn.Mud. Deprem Arastirma Dairesi'ni baglayici nitelikte degildir.

Hello orkun,

On Thu, 25 Aug 2005 15:56:34 +0300 orkun <temiz@deprem.gov.tr> wrote:

hello

when I try to use /*v.out.ogr as:*//* */
v.out.ogr input=jeo6 type=area dsn="PG:host=localhost dbname=bzk
user=orkun" olayer=sil format=PostgreSQL

it gives:
Error: value <PostgreSQL> out of range for parameter <format>
       Legal range:
ESRI_Shapefile,TIGER,S57,MapInfo_File,DGN,Memory,CSV,GML

It says that your OGR-Version is lacking Postgresl-Support.
So you should recompile gdal/ogr with postgresql-support.
or, if you are on debian

apt-get install gdal-bin libgdal1 python-gdal

Best
  Stephan

--
GDF Hannover - Solutions for spatial data analysis and remote sensing
Hannover Office - Mengendamm 16d - D-30177 Hannover
Internet: www.gdf-hannover.de - Email: holl@gdf-hannover.de
Phone : ++49-(0)511.39088507 - Fax: ++49-(0)511.39088508

Stephan Holl wrote:

Hello orkun,

On Thu, 25 Aug 2005 15:56:34 +0300 orkun <temiz@deprem.gov.tr> wrote:

hello

when I try to use /*v.out.ogr as:*//* */
v.out.ogr input=jeo6 type=area dsn="PG:host=localhost dbname=bzk user=orkun" olayer=sil format=PostgreSQL

it gives:
Error: value <PostgreSQL> out of range for parameter <format>
      Legal range:
ESRI_Shapefile,TIGER,S57,MapInfo_File,DGN,Memory,CSV,GML
   
It says that your OGR-Version is lacking Postgresl-Support.
So you should recompile gdal/ogr with postgresql-support.
or, if you are on debian

apt-get install gdal-bin libgdal1 python-gdal

Best
Stephan

thank you

I recompiled both grass61 and gdal.

Now v.out.ogr gives new error.

after entering db.connect driver=pg database=bzk,

v.out.ogr input=jeo6 type=area dsn="PG:host=localhost dbname=bzk user=orkun" olayer=sil7 format=PostgreSQL
ERROR 1: AddGeometryColumn failed for layer sil7, layer creation has failed.
ERROR: Cannot create layer

( is "user=orkun" wrong ?)

what might possible problems be ?

regards

______________________________________
XamimeLT - installed on mailserver for domain @deprem.gov.tr
Queries to: postmaster@deprem.gov.tr
______________________________________
The views and opinions expressed in this e-mail message are the sender's own
and do not necessarily represent the views and the opinions of Earthquake Research Dept.
of General Directorate of Disaster Affairs.

Bu e-postadaki fikir ve gorusler gonderenin sahsina ait olup, yasal olarak T.C.
B.I.B. Afet Isleri Gn.Mud. Deprem Arastirma Dairesi'ni baglayici nitelikte degildir.

Hello orkun,

On Fri, 26 Aug 2005 11:56:46 +0300 orkun <temiz@deprem.gov.tr> wrote:

v.out.ogr input=jeo6 type=area dsn="PG:host=localhost dbname=bzk
user=orkun" olayer=sil7 format=PostgreSQL
ERROR 1: AddGeometryColumn failed for layer sil7, layer creation has
failed. ERROR: Cannot create layer

It looks like this db does not have postGIS enabled?!
So enable the db with postgis-support.

If you just want to store attribute-information have a look at the
newly created wiki-entry[1].
There ist describes how to set up postgres for attribute storage.

hth
  Stephan

[1]
http://grass.gdf-hannover.de/twiki/bin/view/GRASS/GrassSixTutorialFaq#11_Use_Postgres_as_attribute_sto

--
GDF Hannover - Solutions for spatial data analysis and remote sensing
Hannover Office - Mengendamm 16d - D-30177 Hannover
Internet: www.gdf-hannover.de - Email: holl@gdf-hannover.de
Phone : ++49-(0)511.39088507 - Fax: ++49-(0)511.39088508

Stephan Holl wrote:

Hello orkun,

On Fri, 26 Aug 2005 11:56:46 +0300 orkun <temiz@deprem.gov.tr> wrote:

v.out.ogr input=jeo6 type=area dsn="PG:host=localhost dbname=bzk user=orkun" olayer=sil7 format=PostgreSQL
ERROR 1: AddGeometryColumn failed for layer sil7, layer creation has
failed. ERROR: Cannot create layer
   
It looks like this db does not have postGIS enabled?!
So enable the db with postgis-support.

If you just want to store attribute-information have a look at the
newly created wiki-entry[1].
There ist describes how to set up postgres for attribute storage.

hth
Stephan

[1]
http://grass.gdf-hannover.de/twiki/bin/view/GRASS/GrassSixTutorialFaq#11_Use_Postgres_as_attribute_sto

thank you

the db I used (bzk) has already been enabled with postGIS.

as "user postgres" in sql environment (out of grass), it works.

bzk=# CREATE TABLE gtest3 ( ID int4, NAME varchar(20) );
CREATE TABLE
bzk=# SELECT AddGeometryColumn('gtest3','geom',-1,'POLYGON',2);
                            addgeometrycolumn
-------------------------------------------------------------------------
public.gtest3.geom SRID:-1 TYPE:POLYGON DIMS:2
geometry_column fixed:0
(1 row)

the problem (I think) is related to:

my newer postgresql (8..) version enabled postgis. But grass only connects
older postgre (7.4..). So how can make grass work only newer postgresql ?
~~~~~~~~~~

how about different user other than user postgres in using v.out.ogr ?

regards

______________________________________
XamimeLT - installed on mailserver for domain @deprem.gov.tr
Queries to: postmaster@deprem.gov.tr
______________________________________
The views and opinions expressed in this e-mail message are the sender's own
and do not necessarily represent the views and the opinions of Earthquake Research Dept.
of General Directorate of Disaster Affairs.

Bu e-postadaki fikir ve gorusler gonderenin sahsina ait olup, yasal olarak T.C.
B.I.B. Afet Isleri Gn.Mud. Deprem Arastirma Dairesi'ni baglayici nitelikte degildir.

Hello orkun,

On Fri, 26 Aug 2005 13:56:26 +0300 orkun <temiz@deprem.gov.tr> wrote:

the db I used (bzk) has already been enabled with postGIS.

as "user postgres" in sql environment (out of grass), it works.

bzk=# CREATE TABLE gtest3 ( ID int4, NAME varchar(20) );
CREATE TABLE
bzk=# SELECT AddGeometryColumn('gtest3','geom',-1,'POLYGON',2);
                            addgeometrycolumn
-------------------------------------------------------------------------
public.gtest3.geom SRID:-1 TYPE:POLYGON DIMS:2
geometry_column fixed:0
(1 row)

So it "should" work with grass as user postgres as well.

the problem (I think) is related to:

my newer postgresql (8..) version enabled postgis. But grass only
connects older postgre (7.4..).
So how can make grass work only newer postgresql ?
~~~~~~~~~~

how about different user other than user postgres in using v.out.ogr ?

Have a look at the postgres-manual with special reference to the
SQL-command "GRANT". There you can grant different rights to different
users. Or use a GUI like pgadmin3[1].
This should solve your problems regarding the user-problem.

Since I have not used postgres8 yet (because it not yet in
debian-testing), I cannot help you on this topic.

hth
  Stephan

[1] http://www.pgadmin.org

--
GDF Hannover - Solutions for spatial data analysis and remote sensing
Hannover Office - Mengendamm 16d - D-30177 Hannover
Internet: www.gdf-hannover.de - Email: holl@gdf-hannover.de
Phone : ++49-(0)511.39088507 - Fax: ++49-(0)511.39088508