cannot create column with spatialite -> unexpected metadata layout

后端 未结 2 1932
难免孤独
难免孤独 2021-01-11 19:10

I\'m very new with spatialite. I\'m running on Max OS Mountain lion and I have installed SQLite version 3.7.17 and libspatialite 4.1.1 (using homebrew)

I can load wi

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-11 19:48

    This issue occurs because there is no metadata (spatial_ref_sys table) within the database which happens when you create the database with sqlite3.exe rather than spatialite.exe.

    For example; if you create two databases, one with sqlite3 and the other with spatialite and run .table you will see that the db created by spatialite has a suite of other tables including a spatial_ref_sys. The spatial functions require these reference tables in order to work.

    Solution: Created a spatialite db and import the old db there or load all the necessary table into the old database. Either or is realtively easy with .dump.

提交回复
热议问题