我什么时候可以在现有数据库或表上初始化空间矿?
我正在尝试使用空间将几何列添加到现有的SQLite3表中。我可以在现有数据库上调用“选择initspatialMetadata()”,然后在现有表上的AddGeometryColumn?还是我需要放桌子?还是我需要完全启动一个新的数据库并立即调用InitspatialMetadata(或者使用空间cli创建数据库)?
I'm trying to use spatialite to add a geometry column to an existing sqlite3 table. Can I simply call "select initspatialmetadata()" on my existing database and then AddGeometryColumn on my existing table? Or do I need to drop the table? Or do I need to start a new database entirely and call initspatialmetadata immediately (or alternatively create the database with the spatialite cli)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您想在
spatialite
数据库的现有表上添加新的几何列。我想向您突出显示
initspatialMetadata()函数在创建新数据库后必须立即调用,并且在尝试调用任何其他空间SQL函数之前,必须立即调用。
。
此函数的范围正是在空间内部要求的任何元数据表(并填充)。
。
如果已经存在任何元数据表,则此功能根本不应用任何操作。因此,致电更多时间InitspatialMetadata()是没有用但完全无害的。
最后,我以前从未尝试过。但是我认为,您可以使用AddGeometryColumn在现有表上添加一个新列。为什么不尝试这样做。
You wanted to add new geometry column on existing table of
spatialite
database.There are few points that I wanted to highlight to you
The InitSpatialMetaData() function must be called immediately after creating a new database, and before attempting to call any other Spatial SQL function.
The scope of this function is exactly the one to create (and populate) any metadata table internally required by SpatiaLite.
If any metadata table already exist, this function doesn't apply any action at all. So, calling more times InitSpatialMetaData() is useless but completely harmless.
And lastly, I had never tried it before. But I think, you can add a new column on your existing table using AddGeometryColumn. Why not try to do this.