1

I'm getting an error that "[geom-type or SRID not allowed]" for a geometry column, but I'm confident that the value I'm inserting is valid for the type and SR. I noticed that if I drop the table and recreate it again with the same value SQL, I no longer get the error. For example, in the query below, I get the error with the second DROP/CREATE/AddGeometryColumn commented out, but not if I uncomment it.

DROP TABLE IF EXISTS test;
CREATE TABLE test (Value double);
SELECT AddGeometryColumn('test', 'SHAPE', 32615, 'LINESTRING');
--DROP TABLE IF EXISTS test;
--CREATE TABLE test (Value double);
--SELECT AddGeometryColumn('test', 'SHAPE', 32615, 'LINESTRING');
INSERT INTO test VALUES (46.71864700317383, GeomFromText('LINESTRING (701268.032645698 3675362.29477,701268.032645698 3675364.29728502,701265.122816664 3675368.30231507,701264.28479163 3675368.86824025,701261.045560283 3675372.30734512,701260.272152777 3675372.78885241,701256.259513924 3675375.65843502,701255.162166084 3675376.31237516,701252.246875071 3675377.76809262,701248.234236219 3675378.84164383,701244.221597366 3675378.58692897,701240.208958513 3675376.3929278,701240.119712612 3675376.31237516,701236.663233482 3675372.30734512,701236.19631966 3675371.17638664,701234.972864821 3675368.30231507,701234.36868546 3675364.29728502,701234.36868546 3675362.29477)'))

https://www.screencast.com/t/1aP4rXEdhap

Is this expected behavior?

spatialite_gui version info

cwa
  • 1,092
  • 9
  • 12

1 Answers1

1

Found the issue .. The second AddGeometryColumn call doesn't add the validation triggers to the table, which is why it appears to work. The real fix is to include the SRID as the second parameter to GeomFromText.

cwa
  • 1,092
  • 9
  • 12