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

Mark Wynter mark at dimensionaledge.com
Thu Apr 25 23:20:32 PDT 2013


Possibly some bugs.   In summary:

CASE 1:  v.out.ogr if I export to shapefile works as expected - in terms of 176783 features and SRID 2193.
CASE 2: v.out.ogr if I export to postgis, only returns 139 features, with SRID 900915(?)
CASE 3: v.out.postgis returns 176782 features, with SRID=0 despite setting SRID=2193 using the options flag.

Has anyone else encountered similar problems?

The detail...

-----------
CASE 1
-----------
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


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

Rows (estimated)	139

-- Table: osm.osm_nz_roads_2193_export

-- DROP TABLE osm.osm_nz_roads_2193_export;

CREATE TABLE osm.osm_nz_roads_2193_export
(
  ogc_fid serial NOT NULL,
  wkb_geometry geometry(LineString,900915),
  cat integer,
  osm_id integer,
  name character varying(255),
  highway character varying(255),
  bridge integer,
  oneway integer,
  driveable integer,
  trainable integer,
  walkable integer,
  cycleable integer,
  ignore integer,
  CONSTRAINT osm_nz_roads_2193_export_pk PRIMARY KEY (ogc_fid)
)
WITH (
  OIDS=FALSE
);
ALTER TABLE osm.osm_nz_roads_2193_export
  OWNER TO postgres;

-- Index: osm.osm_nz_roads_2193_export_geom_idx

-- DROP INDEX osm.osm_nz_roads_2193_export_geom_idx;

CREATE INDEX osm_nz_roads_2193_export_geom_idx
  ON osm.osm_nz_roads_2193_export
  USING gist
  (wkb_geometry);


-----------
CASE 2
-----------

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"

Rows (estimated)	176782

- Table: osm.osm_nz_roads_2193_export

-- DROP TABLE osm.osm_nz_roads_2193_export;

CREATE TABLE osm.osm_nz_roads_2193_export
(
  fid serial NOT NULL,
  cat integer,
  osm_id integer,
  name character varying(255),
  highway character varying(255),
  bridge integer,
  oneway integer,
  driveable integer,
  trainable integer,
  walkable integer,
  cycleable integer,
  ignore integer,
  wkb_geometry geometry(LineString),
  CONSTRAINT osm_nz_roads_2193_export_pkey PRIMARY KEY (fid)
)
WITH (
  OIDS=FALSE
);
ALTER TABLE osm.osm_nz_roads_2193_export
  OWNER TO postgres;

-- Index: osm.osm_nz_roads_2193_export_wkb_geometry_idx

-- DROP INDEX osm.osm_nz_roads_2193_export_wkb_geometry_idx;

CREATE INDEX osm_nz_roads_2193_export_wkb_geometry_idx
  ON osm.osm_nz_roads_2193_export
  USING gist
  (wkb_geometry);


-----------
CASE 3
-----------
v.out.ogr input=osm_nz_roads_2193_cleaned type=line dsn=/var/tmp/osm_nz_roads_export.shp

ogrinfo -so osm_nz_roads_export.shp osm_nz_roads_export
INFO: Open of `osm_nz_roads_export.shp'
      using driver `ESRI Shapefile' successful.

Layer name: osm_nz_roads_export
Geometry: Line String
Feature Count: 176783
Extent: (1148817.072845, 4793789.625743) - (2089039.165212, 6193819.546965)
Layer SRS WKT:
PROJCS["Transverse_Mercator",
    GEOGCS["GCS_grs80",
        DATUM["New_Zealand_Geodetic_Datum_2000",
            SPHEROID["Geodetic_Reference_System_1980",6378137,298.257222101]],
        PRIMEM["Greenwich",0],
        UNIT["Degree",0.017453292519943295]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",173],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",1600000],
    PARAMETER["false_northing",10000000],
    UNIT["Meter",1]]
cat: Integer (10.0)
osm_id: Integer (10.0)
name: String (255.0)
highway: String (255.0)
bridge: Integer (10.0)
oneway: Integer (10.0)
driveable: Integer (10.0)
trainable: Integer (10.0)
walkable: Integer (10.0)
cycleable: Integer (10.0)
ignore: Integer (10.0)



More information about the grass-user mailing list