From 6dcb558989af777efeb9d3df40281c1901bf555e Mon Sep 17 00:00:00 2001 From: gerdos82 <37865635+gerdos82@users.noreply.github.com> Date: Wed, 19 May 2021 13:37:15 +0200 Subject: [PATCH 1/2] Added empty column with null values to example.gpkg --- example/example.gpkg | Bin 143360 -> 143360 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/example/example.gpkg b/example/example.gpkg index 1a2a3dcc164448e2fa51a05c47aa74a6d99cf1eb..672352f24dba1d5a0ce82a9af0810c5e107dfc7c 100644 GIT binary patch delta 117 zcmZp8z|ru4V}i6`9s>h|G7w7wF(VLnPSi1G&129ru-cfi@Vzj@IR?I!ym35CT-!LK zIQZB$F`Sz$@nIWRqo4%4xU4K=W9ej*Z?!x+3aPmTC6x*xt`Q-V6F)XGv1x67^3jcj S1!!VNv);Gudfyl?Sponb*&{Ci delta 98 zcmZp8z|ru4V}i6`E&~IDG7w7wF(VLnOw=)E&1KN@p0F`x;d^1mBnG~fym35CT-!LK zIQZB$v1v_~_^@sAhfkc-mzFVhPfq&Sz{J3?`N>B&7M4a<3HD~aZ`<|0F Date: Wed, 19 May 2021 14:35:41 +0200 Subject: [PATCH 2/2] Fixed fatal error with null value in column --- sieve.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sieve.go b/sieve.go index 97fc971..eab6652 100644 --- a/sieve.go +++ b/sieve.go @@ -252,9 +252,6 @@ func readFeatures(h *gpkg.Handle, preSieve chan feature, t table) { var c []interface{} for i, colName := range cols { - if vals[i] == nil { - continue - } switch colName { case t.gcolumn: wkbgeom, err := gpkg.DecodeGeometry(vals[i].([]byte)) @@ -263,7 +260,6 @@ func readFeatures(h *gpkg.Handle, preSieve chan feature, t table) { } f.geometry = wkbgeom.Geometry default: - // Grab any non-nil, non-id, non-bounding box, & non-geometry column as a tag switch v := vals[i].(type) { case []uint8: asBytes := make([]byte, len(v)) @@ -279,6 +275,8 @@ func readFeatures(h *gpkg.Handle, preSieve chan feature, t table) { c = append(c, v) case string: c = append(c, v) + case nil: + c = append(c, v) default: log.Printf("unexpected type for sqlite column data: %v: %T", cols[i], v) }