[GRASS-user] Grass7 - Inconsistencies with v.out.ogr and v.out.postgis

Martin Landa landa.martin at gmail.com
Fri Apr 26 02:22:00 PDT 2013


Hi,

2013/4/26 Mark Wynter <mark at dimensionaledge.com>:
> v.category osm_nz_roads_2193_cleaned op=report
> Layer/table: 1/grass.osm_nz_roads_2193_cleaned
> type       count        min        max
> point          0          0          0
> line      176783          1      88617
> boundary       0          0          0
> centroid       0          0          0
> area           0          0          0
> face           0          0          0
> kernel         0          0          0
> all       176783          1      88617

note that `v.out.ogr` export by default only features with category
(see `-c` flag).

I have tried `roadsmajor` from `nc` dataset.

$ v.category roadsmajor opt=r -g
1 line 355 1 355
1 all 355 1 355

> v.out.ogr --overwrite input=osm_nz_roads_2193_cleaned type=line dsn="PG:host=localhost dbname=test user=postgres password=password active_schema=osm" olayer=osm_nz_roads_2193_export format=PostgreSQL

v.out.ogr in=roadsmajor dsn=PG:dbname=pgis_grass format=PostgreSQL

->

$ db.select data=pgis_grass dri=pg sql="select count(*) from roadsmajor" -c
355

db.select data=pgis_grass dri=pg sql="select srid from
geometry_columns where f_table_name = 'roadsmajor'" -c
900914

(new srid added to the table `spatial_ref_sys`)

> v.out.postgis --o input=osm_nz_roads_2193_cleaned dsn="PG:host=localhost dbname=test user=postgres password=password" olayer=osm.osm_nz_roads_2193_export options="GEOMETRY_NAME=wkb_geometry,SRID=2193"

$ v.out.postgis in=roadsmajor dsn=PG:dbname=pgis_grass
options="GEOMETRY_NAME=wkb_geometry,SRID=3358" --o

$ db.select data=pgis_grass dri=pg sql="select count(*) from roadsmajor" -c
355

$ db.select data=pgis_grass dri=pg sql="select srid from
geometry_columns where f_table_name = 'roadsmajor'" -c
3358

> v.out.ogr input=osm_nz_roads_2193_cleaned type=line dsn=/var/tmp/osm_nz_roads_export.shp

$ v.out.ogr in=roadsmajor dsn=/tmp/roadsmajor.shp

> ogrinfo -so osm_nz_roads_export.shp osm_nz_roads_export

$ ogrinfo /tmp/roadsmajor.shp -so roadsmajor
INFO: Open of `/tmp/roadsmajor.shp'
      using driver `ESRI Shapefile' successful.

Layer name: roadsmajor
Geometry: Line String
Feature Count: 355
Extent: (611136.499873, 197465.257810) - (676800.487681, 257970.129540)
Layer SRS WKT:
PROJCS["Lambert_Conformal_Conic",
    GEOGCS["GCS_grs80",
        DATUM["North_American_Datum_1983",
            SPHEROID["Geodetic_Reference_System_1980",6378137,298.257222101]],
        PRIMEM["Greenwich",0],
        UNIT["Degree",0.017453292519943295]],
    PROJECTION["Lambert_Conformal_Conic_2SP"],
    PARAMETER["standard_parallel_1",36.16666666666666],
    PARAMETER["standard_parallel_2",34.33333333333334],
    PARAMETER["latitude_of_origin",33.75],
    PARAMETER["central_meridian",-79],
    PARAMETER["false_easting",609601.22],
    PARAMETER["false_northing",0],
    UNIT["Meter",1]]
cat: Integer (10.0)
MAJORRDS_: Real (24.15)
ROAD_NAME: String (16.0)
MULTILANE: String (3.0)
PROPYEAR: Integer (10.0)
OBJECTID: Integer (10.0)
SHAPE_LEN: Real (24.15)

Everything seems to be OK. Do you have fresh installation from svn? Martin


--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa


More information about the grass-user mailing list