[GRASS-dev] How to import from a spatialite/sqlite db by v.in.ogr?

Helmut Kudrnovsky hellik at web.de
Sun Apr 16 13:40:07 PDT 2017


database can be downloaded here:

http://www.eea.europa.eu/data-and-maps/data/biogeographical-regions-europe-3

----
ogrinfo -al -so BiogeoRegions2016.sqlite
INFO: Open of `BiogeoRegions2016.sqlite'
      using driver `SQLite' successful.

Layer name: biogeoregions2016
Geometry: Multi Polygon
Feature Count: 12
Extent: (943611.000000, 600000.000000) - (8500000.000000, 7800000.000000)
Layer SRS WKT:
PROJCS["ETRS89 / LAEA Europe",
    GEOGCS["ETRS89",
        DATUM["European_Terrestrial_Reference_System_1989",
            SPHEROID["GRS 1980",6378137,298.257222101,
                AUTHORITY["EPSG","7019"]],
            TOWGS84[0,0,0,0,0,0,0],
            AUTHORITY["EPSG","6258"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4258"]],
    PROJECTION["Lambert_Azimuthal_Equal_Area"],
    PARAMETER["latitude_of_center",52],
    PARAMETER["longitude_of_center",10],
    PARAMETER["false_easting",4321000],
    PARAMETER["false_northing",3210000],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","3035"]]
FID Column = PK_UID
Geometry Column = geometry
short_name: String (0.0)
pre_2012: String (0.0)
code: String (0.0)
name: String (0.0)
----

test which layer are in the db:

----
v.in.ogr -l input=BiogeoRegions2016.sqlite
biogeoregions2016
Data source <BiogeoRegions2016.sqlite> (format 'SQLite') contains 1 layers:
----

a layer can be seen by v.in.ogr (see the messed output)

then try to import:

----
v.in.ogr input=BiogeoRegions2016.sqlite layer=biogeoregions2016|geometry
output=test where=short_name = 'alpine'
ERROR: Layer <biogeoregions2016^^^|geometry> not available
----

it seems the geometry column of the can't be found by v.in.ogr.

but trying:

----
ogr2ogr -where "short_name = 'alpine'" test.shp BiogeoRegions2016.sqlite
----

works without any problems.

tested with

System Info                                                                     
GRASS version: 7.3.svn                                                          
GRASS SVN revision: r70874M                                                     
Build date: 2017-04-15                                                          
Build platform: x86_64-w64-mingw32                                              
GDAL: 2.1.3                                                                     
PROJ.4: 4.9.3                                                                   
GEOS: 3.5.0                                                                     
SQLite: 3.17.0                                                                  
Python: 2.7.5                                                                   
wxPython: 2.8.12.1                                                              
Platform: Windows-8-6.2.9200 (OSGeo4W) 

any ideas?



-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/How-to-import-from-a-spatialite-sqlite-db-by-v-in-ogr-tp5317435.html
Sent from the Grass - Dev mailing list archive at Nabble.com.


More information about the grass-dev mailing list