Opened 7 years ago

Last modified 3 years ago

#2702 new defect

G7: vector vrt not recognized by "v.in.ogr - import common formats" by mode directory

Reported by: hellik Owned by: grass-dev@…
Priority: normal Milestone: 7.6.2
Component: Default Version: svn-releasebranch76
Keywords: Cc:
CPU: Unspecified Platform: Unspecified

Description

given a vector vrt (referring to a point csv):

ogrinfo gbif_to_gis_working.vrt
INFO: Open of `gbif_to_gis_working.vrt'
      using driver `VRT' successful.
1: gbif_gisinput (Point)
INFO: Open of `gbif_to_gis_working.vrt'
      using driver `VRT' successful.

Layer name: gbif_gisinput
Geometry: Point
Feature Count: 182
Extent: (0.000000, 0.000000) - (13.240250, 47.282780)
Layer SRS WKT:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        TOWGS84[0,0,0,0,0,0,0],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9108"]],
    AUTHORITY["EPSG","4326"]]
gbifid: String (0.0)
xdatasetkey: String (0.0)
occurrenceid: String (0.0)
kingdom: String (0.0)
phylum: String (0.0)
xclass: String (0.0)
xorder: String (0.0)
family: String (0.0)
genus: String (0.0)
species: String (0.0)
infraspecificepithet: String (0.0)
taxonrank: String (0.0)
scientificname: String (0.0)
countrycode: String (0.0)
locality: String (0.0)
publishingorgkey: String (0.0)
decimallatitude: String (0.0)
decimallongitude: String (0.0)
elevation: String (0.0)
elevationaccuracy: String (0.0)
depth: String (0.0)
depthaccuracy: String (0.0)
eventdate: String (0.0)
xday: String (0.0)
xmonth: String (0.0)
xyear: String (0.0)
taxonkey: String (0.0)
specieskey: String (0.0)
basisofrecord: String (0.0)
institutioncode: String (0.0)
collectioncode: String (0.0)
catalognumber: String (0.0)
recordnumber: String (0.0)
identifiedby: String (0.0)
rights: String (0.0)
rightsholder: String (0.0)
recordedby: String (0.0)
typestatus: String (0.0)
establishmentmeans: String (0.0)
lastinterpreted: String (0.0)
mediatype: String (0.0)
issue: String (0.0)
OGRFeature(gbif_gisinput):4
  gbifid (String) = 684164905
  xdatasetkey (String) = 7b904404-f762-11e1-a439-00145eb45e9a
  occurrenceid (String) = 
  kingdom (String) = Plantae
  phylum (String) = Magnoliophyta
  xclass (String) = Magnoliopsida
  xorder (String) = Asterales
  family (String) = Asteraceae
  genus (String) = Jacobaea
  species (String) = Jacobaea incana
  infraspecificepithet (String) = 
  taxonrank (String) = SPECIES
  scientificname (String) = Senecio carniolicus Willd.
  countrycode (String) = AT
  locality (String) = Aufstieg Roßtal (Maxer Lek) - Kalksteiner Jöchl
  publishingorgkey (String) = f9912a00-84a9-11d9-8952-b8a03c50a862
  decimallatitude (String) = 46.82056
  decimallongitude (String) = 12.29528
  elevation (String) = 2175.0
  elevationaccuracy (String) = 175.0
  depth (String) = 
  depthaccuracy (String) = 
  eventdate (String) = 2001-08-13T00:00Z
  xday (String) = 13
  xmonth (String) = 8
  xyear (String) = 2001
  taxonkey (String) = 6064702
  specieskey (String) = 5388625
  basisofrecord (String) = HUMAN_OBSERVATION
  institutioncode (String) = TLMF
  collectioncode (String) = Tiroler Landesmuseum Ferdinandeum
  catalognumber (String) = 1AD3DA9D-845D-4432-8A78-8527951513C9
  recordnumber (String) = 
  identifiedby (String) = 
  rights (String) = 
  rightsholder (String) = 
  recordedby (String) = Polatschek A.
  typestatus (String) = 
  establishmentmeans (String) = 
  lastinterpreted (String) = 2014-06-05T14:10Z
  mediatype (String) = 
  issue (String) = COORDINATE_ROUNDED;GEODETIC_DATUM_ASSUMED_WGS84
  POINT (12.29528 46.82056)

ogrinfo gives the right infos about the point vector.

v.in.ogr -f
Supported formats:
 ESRI Shapefile (rw): ESRI Shapefile
[...]
 VRT (ro): VRT
[...]

(1) the "v.in.ogr - import common formats"-GUI seems not to recognize the vrt format:

open this special GUI, insert the path to the vrt, only a shape file in this file is recognized, but not the vector vrt

(2) open v.in.ogr --ui:

v.in.ogr -l input=C:\tmp\0000402-150615163101818_senecio_carniolicus\gbif_to_gis_working.vrt output=check4
gbif_gisinput
ERROR 1: Failed to open datasource `gbif_gisinput.csv'.
Data source <C:\tmp\0000402-150615163101818_senecio_carniolicus\gbif_to_gis_working.vrt> (format 'VRT') contains 1 layers:
v.in.ogr input=C:\tmp\0000402-150615163101818_senecio_carniolicus\gbif_to_gis_working.vrt output=check5
ERROR 1: Failed to open datasource `gbif_gisinput.csv'.
Check if OGR layer <gbif_gisinput> contains polygons...
Importing 0 features (OGR layer <gbif_gisinput>)...
-----------------------------------------------------
Erstelle Topologie für die Vektorkarte <check5@newcheck>...
Registriere Primitive...
0 primitives registered
0 Vertices registriert
Erzeuge Flächen...
0 areas built
0 isles built
Füge Inseln hinzu...
Füge Zentroide hinzu...
Anzahl der Knoten: 0
Anzahl der Primitive: 0
Anzahl der Punkte: 0
Anzahl der Linien: 0
Anzahl der Grenzen: 0
Anzahl der Zentroide: 0
Anzahl der Flächen: 0
Anzahl der Inseln: 0

any idea?

(vrt and csv attached to ticket)

Attachments (2)

gbif_to_gis_working.vrt (328 bytes ) - added by hellik 7 years ago.
vrt
gbif_gisinput.csv (85.7 KB ) - added by hellik 7 years ago.

Download all attachments as: .zip

Change History (15)

by hellik, 7 years ago

Attachment: gbif_to_gis_working.vrt added

vrt

by hellik, 7 years ago

Attachment: gbif_gisinput.csv added

comment:1 by mlennert, 7 years ago

The problem is simply the path to the csv file. In your vrt you have:

<SrcDataSource>gbif_gisinput.csv</SrcDataSource>

which (IIUC) means that v.in.ogr will search for the csv file in the CWD, not in the same directory as the vrt file.

So either use an absolute path, or cd to the directory in which the two files are and then launch v.in.ogr.

Leaving the ticket open for you to confirm that this is the issue.

comment:2 by mlennert, 7 years ago

Or you can change the line to:

<SrcDataSource relativeToVRT=1>gbif_gisinput.csv</SrcDataSource>

and then it works, whatever your CWD, as long as the csv file is in the correct relative position to the vrt file (in this case in the same directory).

BTW: I have no problems using the wxgui import wizard to import this vrt. Have you made sure that the wizard file picker was not configured to only look for shapefiles ?

in reply to:  2 comment:3 by hellik, 7 years ago

Replying to mlennert:

Or you can change the line to:

<SrcDataSource relativeToVRT=1>gbif_gisinput.csv</SrcDataSource>

and then it works, whatever your CWD, as long as the csv file is in the correct relative position to the vrt file (in this case in the same directory).

yes, adding relativeToVRT=1 does the trick (will change the title of the ticket)

BTW: I have no problems using the wxgui import wizard to import this vrt. Have you made sure that the wizard file picker was not configured to only look for shapefiles ?

here the vrt is recognized by the vector import wizard if I explicitely choose the vrt file.

in mode "source type: directory; format: vrt": if I enter the path to directory, only the shapefile in this folder is recognized, although vrt is defined as format.

System Info                                                                     
GRASS version: 7.1.svn                                                          
GRASS SVN revision: 65544                                                       
Build date: 2015-07-09                                                          
Build platform: i686-pc-mingw32                                                 
GDAL: 1.11.2                                                                    
PROJ.4: 4.8.0                                                                   
GEOS: 3.4.2                                                                     
SQLite: 3.7.17                                                                  
Python: 2.7.4                                                                   
wxPython: 2.8.12.1                                                              
Platform: Windows-7-6.1.7601-SP1 (OSGeo4W)   

comment:4 by hellik, 7 years ago

Summary: G7: vector vrt not recognized by "v.in.ogr - import common formats"/can't be openedG7: vector vrt not recognized by "v.in.ogr - import common formats" by mode directory

comment:5 by neteler, 7 years ago

Milestone: 7.0.17.0.2

Ticket retargeted after 7.0.1 milestone closed

comment:6 by neteler, 7 years ago

Milestone: 7.0.27.0.3

Ticket retargeted after milestone closed

comment:7 by neteler, 7 years ago

Milestone: 7.0.3

Ticket retargeted after milestone closed

comment:8 by neteler, 7 years ago

Milestone: 7.0.4

Ticket retargeted after 7.0.3 milestone closed

comment:9 by martinl, 6 years ago

Milestone: 7.0.47.0.5

comment:10 by neteler, 6 years ago

Milestone: 7.0.57.0.6

comment:11 by neteler, 4 years ago

Milestone: 7.0.67.0.7

comment:12 by martinl, 3 years ago

Still relevant?

comment:13 by hellik, 3 years ago

Milestone: 7.0.77.6.2
Version: svn-releasebranch70svn-releasebranch76

still relevant for:

in mode "source type: directory; format: vrt": if I enter the path to directory, only the shapefile in this folder is recognized, although vrt is defined as format. 

upgrading milestone

Note: See TracTickets for help on using tickets.