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

António M. Rodrigues amcrgrodrigues at gmail.com
Mon Jul 29 09:13:16 PDT 2013


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 at 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 at 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 <mlennert at 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.html<http://www.gdal.org/ogr/drv_pg_advanced.html>
>
> Moritz
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20130729/505d0dc1/attachment.html>


More information about the grass-user mailing list