Spatialite RecoverGeometryColumn

1497
2
02-15-2021 01:39 PM
Labels (1)
karosc
by
New Contributor

 

I am trying to create a spatial table from a view in my spatialite database and found a quirk in Arcmap and ArcGIS Pro I am wondering if anyone has come across. 

 

ArcGIS has no problem recognizing my spatial table if I create my table, add my geometry column, then insert data a la: 

CREATE TABLE spatial_table(
OBJECTID INT,
FIELD1 TEST
FIELD2 INT
);

SELECT AddGeometryColumn('spatial_table', 'shape', 4326, 'multipolygon', 'XY');

Insert into spatial_table select * from spatial_view;

 

However ArcGIS does not recognize the table's spatial data if I elect for a more concise SQL syntax, creating my table including my spatial column, then trying to register the geometry column a la:

CREATE TABLE spatial_table as 
SELECT * from spatial view;
SELECT RecoverGeometryColumn('spatial_table', 'shape', 4326, 'multipolygon', 'XY');

 

I can add this table to ArcMap or ArcGIS pro, but the spatial reference and spatial column are not recognized. This seems weird to me because the spatiallite docs states that there is absolutely no difference between a Geometry created by AddGeometryColumn() and another crea...

Tags (1)
0 Kudos
2 Replies
WesleyMills
New Contributor

Were you ever able to get this sorted out? I am running into the same issue and can't find anything about it online which is surprising.

0 Kudos
WesleyMills
New Contributor

For anyone else who may be stuck on this, you select all from your new table and export the result set as a shapefile and load that into your project. The geometry will work fine which shows that the geo is recorded in the spatialite database. Its an annoying extra step but it gets the job done.

0 Kudos