<div dir="ltr">Hi Moritz,<br><br>Thanks for your reply.<br><br>In <a href="http://www.gdal.org/ogr/drv_pg_advanced.html">http://www.gdal.org/ogr/drv_pg_advanced.html</a>, it says:<br><br>"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."<br>
<br>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.<br><br>I set a connection with pg from grass7 using db.connect, db.login, db.connect -p, db.tables -p (details below).<br>
<br>db.tables returns only one base.geoi1 table (should be 2, since it has 2 geometry columns, no?).<br><br>Then I imported both geometries with v.external. For the second geometry I specified the field the_geometry3763.<br>
<br>Both tables are imported into grass, showing the same geometry (the orginal, with crs=20790).<br><br>Is this a bug or I'm doing something wrong?<br><br>Thanks,<br>António<br><br>------------------------<br>g.region -p <br>
projection: 99 (Transverse Mercator)<br>zone: 0<br>datum: etrs89<br>ellipsoid: grs80<br>north: 1<br>south: 0<br>west: 0<br>east: 1<br>nsres: 1<br>ewres: 1<br>rows: 1<br>cols: 1<br>
cells: 1<br><br>----------------------------<br>(Mon Jul 29 16:39:23 2013) Command finished (0 sec) <br>(Mon Jul 29 16:40:06 2013) <br>
db.connect driver=pg database=host=localhost,dbname=geocontacto,port=5432 <br>(Mon Jul 29 16:40:06 2013) Command finished (0 sec)<br>----------------------------<br>(Mon Jul 29 16:41:02 2013) <br>
db.login user=marxco password=******** <br>The password was stored in file (.grass7/dblogin)<br>(Mon Jul 29 16:41:02 2013) Command finished (0 sec)<br>----------------------------<br>
db.connect -p <br>driver: pg<br>database: host=localhost,dbname=geocontacto,port=5432<br>schema: <br>group: <br>(Mon Jul 29 16:41:48 2013) Command finished (0 sec) <br>
---------------------------<br>db.tables -p <br>base.geoi1<br>information_schema.sql_features<br>information_schema.sql_implementation_info<br>information_schema.sql_languages<br>
information_schema.sql_packages<br>information_schema.sql_parts<br>information_schema.sql_sizing<br>information_schema.sql_sizing_profiles<br>public.geography_columns<br>public.geometry_columns<br>public.raster_columns<br>
public.raster_overviews<br>public.spatial_ref_sys<br>public.spatial_ref_sys_old<br>topology.layer<br>topology.topology<br>(Mon Jul 29 16:42:25 2013) Command finished (0 sec)<br>---------------------------------<br><br>(from postgis)<br>
select st_srid(the_geom3763) from base.geoi;<br>Returns 3763<br><br>---------------------------------<br>v.external dsn=PG:host=localhost user=marxco password=******** dbname=geocontacto layer=base.geoindex_jan13_v3 output=geoindex1<br>
Building topology for vector map <geoi1@geoindex>...<br>Using external data format 'PostgreSQL' (feature type '(null)')<br>Building pseudo-topology over simple features...<br>Registering primitives...<br>
8177 primitives registered<br>8177 vertices registered<br>Number of nodes: 0<br>Number of primitives: 8177<br>Number of points: 8177<br>Number of lines: 0<br>Number of boundaries: 0<br>Number of centroids: 0<br>Number of areas: 0<br>
Number of isles: 0<br>v.external complete. Link to vector map <geoi1> created.<br>(Mon Jul 29 16:49:03 2013) Command finished (0 sec) <br>-------------------------------------------------------------<br>v.external dsn=PG:host=localhost user=marxco password=******** dbname=geocontacto layer=base.geoindex_jan13_v3.the_geom3763 output=geoindex2<br>
Building topology for vector map <geoindex2@geoindex>...<br>Using external data format 'PostgreSQL' (feature type '(null)')<br>Building pseudo-topology over simple features...<br>Registering primitives...<br>
8177 primitives registered<br>8177 vertices registered<br>Number of nodes: 0<br>Number of primitives: 8177<br>Number of points: 8177<br>Number of lines: 0<br>Number of boundaries: 0<br>Number of centroids: 0<br>Number of areas: 0<br>
Number of isles: 0<br>v.external complete. Link to vector map <geoi2> created.<br>(Mon Jul 29 16:50:22 2013) Command finished (0 sec) <br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">
2013/7/29 Moritz Lennert <span dir="ltr"><<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 29/07/13 16:34, António M. Rodrigues wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I'm using v.external to get postgres geometries into grass7.<br>
<br>
I have a table with two geometries, each for a different crs. Is there a<br>
way to specify the name of the geometry column?<br>
<br>
</blockquote>
<br>
</div></div><a href="http://www.gdal.org/ogr/drv_pg_advanced.html" target="_blank">http://www.gdal.org/ogr/drv_<u></u>pg_advanced.html</a><span class="HOEnZb"><font color="#888888"><br>
<br>
Moritz<br>
<br>
</font></span></blockquote></div><br></div>