Re: [GRASS-user] v.external pg alternative geometry column

2013-07-29 Thread Moritz Lennert

On 29/07/13 16:34, António M. Rodrigues wrote:

Hi,

I'm using v.external to get postgres geometries into grass7.

I have a table with two geometries, each for a different crs. Is there a
way to specify the name of the geometry column?



http://www.gdal.org/ogr/drv_pg_advanced.html

Moritz

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] v.external pg alternative geometry column

2013-07-29 Thread António M . Rodrigues
Hi Moritz,

Thanks for your reply.

In http://www.gdal.org/ogr/drv_pg_advanced.html, it says:

Starting with GDAL 1.6.0, the PostgreSQL driver supports accessing tables
with multiple PostGIS geometry columns. For such a table, there will be as
many layers reported as the number of geometry columns listed for that
table in the geometry_columns table.

Now, I have one postgis table with two geometry fields, the_geom and
the_geo3763. I opened both in qgis to make sure the geometries were
correctly transformed and everything was in place.

I set a connection with pg from grass7 using db.connect, db.login,
db.connect -p, db.tables -p (details below).

db.tables returns only one base.geoi1 table (should be 2, since it has 2
geometry columns, no?).

Then I imported both geometries with v.external. For the second geometry I
specified the field the_geometry3763.

Both tables are imported into grass, showing the same geometry (the
orginal, with crs=20790).

Is this a bug or I'm doing something wrong?

Thanks,
António


g.region
-p
projection: 99 (Transverse Mercator)
zone:   0
datum:  etrs89
ellipsoid:  grs80
north:  1
south:  0
west:   0
east:   1
nsres:  1
ewres:  1
rows:   1
cols:   1
cells:  1


(Mon Jul 29 16:39:23 2013) Command finished (0
sec)
(Mon Jul 29 16:40:06
2013)
db.connect driver=pg
database=host=localhost,dbname=geocontacto,port=5432
(Mon Jul 29 16:40:06 2013) Command finished (0 sec)

(Mon Jul 29 16:41:02
2013)
db.login user=marxco
password=
The password was stored in file (.grass7/dblogin)
(Mon Jul 29 16:41:02 2013) Command finished (0 sec)

db.connect
-p
driver: pg
database: host=localhost,dbname=geocontacto,port=5432
schema:
group:
(Mon Jul 29 16:41:48 2013) Command finished (0
sec)
---
db.tables
-p
base.geoi1
information_schema.sql_features
information_schema.sql_implementation_info
information_schema.sql_languages
information_schema.sql_packages
information_schema.sql_parts
information_schema.sql_sizing
information_schema.sql_sizing_profiles
public.geography_columns
public.geometry_columns
public.raster_columns
public.raster_overviews
public.spatial_ref_sys
public.spatial_ref_sys_old
topology.layer
topology.topology
(Mon Jul 29 16:42:25 2013) Command finished (0 sec)
-

(from postgis)
select st_srid(the_geom3763) from base.geoi;
Returns 3763

-
v.external dsn=PG:host=localhost user=marxco password=
dbname=geocontacto layer=base.geoindex_jan13_v3 output=geoindex1
Building topology for vector map geoi1@geoindex...
Using external data format 'PostgreSQL' (feature type '(null)')
Building pseudo-topology over simple features...
Registering primitives...
8177 primitives registered
8177 vertices registered
Number of nodes: 0
Number of primitives: 8177
Number of points: 8177
Number of lines: 0
Number of boundaries: 0
Number of centroids: 0
Number of areas: 0
Number of isles: 0
v.external complete. Link to vector map geoi1 created.
(Mon Jul 29 16:49:03 2013) Command finished (0 sec)
-
v.external dsn=PG:host=localhost user=marxco password=
dbname=geocontacto layer=base.geoindex_jan13_v3.the_geom3763
output=geoindex2
Building topology for vector map geoindex2@geoindex...
Using external data format 'PostgreSQL' (feature type '(null)')
Building pseudo-topology over simple features...
Registering primitives...
8177 primitives registered
8177 vertices registered
Number of nodes: 0
Number of primitives: 8177
Number of points: 8177
Number of lines: 0
Number of boundaries: 0
Number of centroids: 0
Number of areas: 0
Number of isles: 0
v.external complete. Link to vector map geoi2 created.
(Mon Jul 29 16:50:22 2013) Command finished (0 sec)



2013/7/29 Moritz Lennert mlenn...@club.worldonline.be

 On 29/07/13 16:34, António M. Rodrigues wrote:

 Hi,

 I'm using v.external to get postgres geometries into grass7.

 I have a table with two geometries, each for a different crs. Is there a
 way to specify the name of the geometry column?


 http://www.gdal.org/ogr/drv_**pg_advanced.htmlhttp://www.gdal.org/ogr/drv_pg_advanced.html

 Moritz


___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user