I am trying to import some geopackage files. Some are polygons, and one is a points vector. The polygons import fine, but the point vector fails with:

ERROR: Detected different projections of input layers. Input layers must be
       imported separately.


Then if I convert the gpkg to a shapefile, it works fine.


Any ideas what could be wrong? Here's the procedure, showing the problem.


######################

# My Location/mapset info:

######################

micha@TP480:Ashalim$ g.version

GRASS 7.6.0 (2019)
micha@TP480:Ashalim$ g.proj -p
-PROJ_INFO-------------------------------------------------
name       : Israel 1993 / Israeli TM Grid
ellps      : grs80
proj       : tmerc
lat_0      : 31.73439361111111
lon_0      : 35.20451694444445
k          : 1.0000067
x_0        : 219529.584
y_0        : 626907.39
towgs84    : -48,55,52,0,0,0,0
no_defs    : defined
-PROJ_EPSG-------------------------------------------------
epsg       : 2039
-PROJ_UNITS------------------------------------------------
unit       : meter
units      : meters
meters     : 1


######################

# The polygon gpkg vector:

######################

micha@TP480:Ashalim$ ogrinfo ashalim_analysis.gpkg analysis_region
INFO: Open of `ashalim_analysis.gpkg'
      using driver `GPKG' successful.

Layer name: analysis_region
Geometry: Polygon
Feature Count: 1
Extent: (231234.000000, 551462.000000) - (232977.000000, 553925.000000)
Layer SRS WKT:
PROJCS["Israel 1993 / Israeli TM Grid",
    GEOGCS["Israel 1993",
        DATUM["Israel_1993",

.....


# and import to GRASS:

micha@TP480:Ashalim$ v.import ashalim_analysis.gpkg output=ashalim_region --o
Check if OGR layer <analysis_region> contains polygons...
 100%
Creating attribute table for layer <analysis_region>...
Importing 1 features (OGR layer <analysis_region>)...
 100%
-----------------------------------------------------
.....

Input <ashalim_analysis.gpkg> successfully imported without reprojection


######################

# Now The point gpkg vector:

######################

micha@TP480:Ashalim$ ogrinfo ashalim_train_pts.gpkg ashalim_train_pts
INFO: Open of `ashalim_train_pts.gpkg'
      using driver `GPKG' successful.

Layer name: ashalim_train_pts
Geometry: Point
Feature Count: 33
Extent: (231388.000000, 551892.000000) - (232708.000000, 553510.000000)
Layer SRS WKT:
PROJCS["Israel 1993 / Israeli TM Grid",
    GEOGCS["Israel 1993",
        DATUM["Israel_1993",
.....


# Try import

micha@TP480:Ashalim$ v.import ashalim_train_pts.gpkg output=ashalim_pts --o
ERROR: Detected different projections of input layers. Input layers must be
       imported separately.
ERROR: Detected different projections of input layers. Input layers must be
       imported separately.
ERROR: Unable to create location from OGR datasource
       <ashalim_train_pts.gpkg>
# Ooops


# Convert to shapefile (no reprojection)

micha@TP480:Ashalim$ ogr2ogr ashalim_train_pts ashalim_train_pts.gpkg

micha@TP480:Ashalim$ ll ashalim_train_pts/
total 32
drwxr-xr-x 2 micha micha 4096 Jun 26 17:41 .
drwxrwxrwx 3 micha micha 4096 Jun 26 17:41 ..
-rw-r--r-- 1 micha micha 1320 Jun 26 17:53 ashalim_train_pts.dbf
-rw-r--r-- 1 micha micha  442 Jun 26 17:41 ashalim_train_pts.prj
-rw-r--r-- 1 micha micha 1948 Jun 26 17:53 ashalim_train_pts.shp
-rw-r--r-- 1 micha micha  628 Jun 26 17:53 ashalim_train_pts.shx
-rw-r--r-- 1 micha micha 6292 Jun 26 17:53 layer_styles.dbf
# Now import the shape:

micha@TP480:Ashalim$ v.import input=ashalim_train_pts/ashalim_train_pts.shp output=ashalim_pts --o
Check if OGR layer <ashalim_train_pts> contains polygons...
 100%
Creating attribute table for layer <ashalim_train_pts>...
Importing 66 features (OGR layer <ashalim_train_pts>)...
 100%
-----------------------------------------------------
Building topology for vector map <ashalim_pts@OBIA>...
Registering primitives...
Input <ashalim_train_pts/ashalim_train_pts.shp> successfully imported
without reprojection


 

If anyone wants the point and polygon gpkg files to test, I can share it.

Thanks


-- 
Micha Silver
Ben Gurion Univ.
Sde Boker, Remote Sensing Lab
cell: +972-523-665918

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to