I'm trying to script a .bat file (WINDOWS DOS) with a command to create a sqlite DB, add a table and a geometry column to that table.
I've successfully scripted and obtained a sqlite database with a table but I'm not being able to deal with the AddGeometryColumn to the table.
I'm using sqlite3.exe and spatialite_tools.exe doing the following:
1. Create a .bat file with the code to create my sqlite database
@echo off
setlocal
:: Global Variables here
set _engine=C:/path/to/sqlitetools/sqlite3.exe
call %_engine% C:/path/to/sqliteDB/mydb0.sqlite < C:/path/to/sqlitetools/sqlcreate_vantage_table.sql
2. create a .sql file to build a table inside mydb0.sqlite
CREATE TABLE table0 (uid_tab varchar(30) NOT NULL,
uid_obs varchar(30) NOT NULL,
uid_proj varchar(30) NOT NULL,
date varchar(30) NOT NULL
);
3. Create a .bat file with the code to add the geometry column to to table0 with something like:
@echo off
setlocal
:: Global Variables here
set _engine1=C:/path/to/sqlitetools/spatialite_tool.exe
call %_engine1% C:/path/to/sqliteDB/mydb0.sqlite < SELECT AddGeometryColumn('table0', 'Geometry', 4326, 'POINT', 2);
I'm not being able to achieve this.
Any help will be more than welcome
All the best,
Paulo