I'm writing a tcl script that uses spatialite. There's a file of coordinates and an sqlite database of polygons that represent land
parcels. Which parcel is the point in? Note that I'm not a novice at
this, it's just the latest software is not working on windows. I have
bawt which provides the sqlite3 package and spatialite comes with a qgis install.
Here's a query using sqlite3 without tcl that works fine on windows and
linux using a spatial index
select load_extension('mod_spatialite');
.version
select spatialite_version();
select lotplan,segpar from lotslite as d,
(select makepoint(492842.0,6981883.0,28356) as point) as p
where within(p.point, d.shape) and d.rowid in
(select rowid from spatialindex
where f_table_name='lotslite'
and search_frame=p.point);
output is
SQLite 3.41.0 2023-02-21 18:09:37 .....
zlib version 1.2.13
gcc-12.2.1 20230201
5.0.1
9RP175453|62902002
Here's the tcl script with both the indexed and unindexed query. This
works fine on linux but wanders off into the weeds on the spatialindex
query.
package require sqlite3
sqlite3 db lots.sqlite
db enable_load_extension true
db eval {SELECT load_extension('mod_spatialite')}
puts [db version]
puts [db eval {select spatialite_version()}]
set x 492842
set y 6981883
puts [db eval {
select lotplan,segpar from lotslite as d,
(select makepoint(casttodouble(:x),casttodouble(:y),28356)
as point) as p
where within(p.point, d.shape)
}]
puts [db eval {
select lotplan,segpar from lotslite as d,
(select makepoint(casttodouble(:x),casttodouble(:y),28356)
as point) as p
where within(p.point, d.shape) and d.rowid in
(select rowid from spatialindex
where f_table_name='lotslite'
and search_frame=p.point)}]
outputs on linux
3.41.0
5.0.1
9RP175453 62902002
9RP175453 62902002
but on windows I only get
3.41.0
5.0.1
9RP175453 62902002
I've tried this also with a tclkit that comes with bawt and also a kit
from Ashok. What to blame? It's looking like the sqlite which comes
with bawt. Is there somewhere else I can get a compiled sqlite package
for windows. Ultimately this will be wrapped up as a starpack to give
to a client so the sqlite package needs to be compatible with whatever kit.
TIA for any tips
Peter
Am 01.03.23 um 07:29 schrieb Peter Dean:
outputs on linuxcorrection, it's actually 3.40.0 on windows. Could that be it?
3.41.0
5.0.1
9RP175453 62902002
9RP175453 62902002
but on windows I only get
3.41.0
5.0.1
9RP175453 62902002
I've tried this also with a tclkit that comes with bawt and also a
kit from Ashok. What to blame? It's looking like the sqlite which
comes with bawt. Is there somewhere else I can get a compiled sqlite
package for windows. Ultimately this will be wrapped up as a
starpack to give to a client so the sqlite package needs to be
compatible with whatever kit.
Most likely. I can't believe it comes from the Tcl driving it, so it
must be a pure SQLite problem. 3.40.0 is bundled with Tcl 8.6.13. 3.41.0 appeared on 2023-02-24 (one week ago!), so probably your linux distro is
one of those with instant rolling release.
Can't you compile it on your own?
Christian
outputs on linuxcorrection, it's actually 3.40.0 on windows. Could that be it?
3.41.0
5.0.1
9RP175453 62902002
9RP175453 62902002
but on windows I only get
3.41.0
5.0.1
9RP175453 62902002
I've tried this also with a tclkit that comes with bawt and also a kit
from Ashok. What to blame? It's looking like the sqlite which comes
with bawt. Is there somewhere else I can get a compiled sqlite
package for windows. Ultimately this will be wrapped up as a starpack
to give to a client so the sqlite package needs to be compatible with
whatever kit.
Am 01.03.23 um 07:29 schrieb Peter Dean:
outputs on linuxcorrection, it's actually 3.40.0 on windows. Could that be it?
3.41.0
5.0.1
9RP175453 62902002
9RP175453 62902002
but on windows I only get
3.41.0
5.0.1
9RP175453 62902002
I've tried this also with a tclkit that comes with bawt and also a
kit from Ashok. What to blame? It's looking like the sqlite which
comes with bawt. Is there somewhere else I can get a compiled sqlite
package for windows. Ultimately this will be wrapped up as a
starpack to give to a client so the sqlite package needs to be
compatible with whatever kit.
Most likely. I can't believe it comes from the Tcl driving it, so it
must be a pure SQLite problem. 3.40.0 is bundled with Tcl 8.6.13. 3.41.0 appeared on 2023-02-24 (one week ago!), so probably your linux distro is
one of those with instant rolling release.
Can't you compile it on your own?
Christian
On 1/03/2023 5:22 pm, Christian Gollwitzer wrote:
Most likely. I can't believe it comes from the Tcl driving it, so itThanks Christian, it was quite straight forward to compile 3.41.0 on
must be a pure SQLite problem. 3.40.0 is bundled with Tcl 8.6.13.
3.41.0 appeared on 2023-02-24 (one week ago!), so probably your linux
distro is one of those with instant rolling release.
Can't you compile it on your own?
Christian
windows and it solved the problem. 3.40.0 is buggy on this particular problem.
Am 01.03.23 um 09:28 schrieb Peter Dean:
On 1/03/2023 5:22 pm, Christian Gollwitzer wrote:
Most likely. I can't believe it comes from the Tcl driving it, so itThanks Christian, it was quite straight forward to compile 3.41.0 on
must be a pure SQLite problem. 3.40.0 is bundled with Tcl 8.6.13.
3.41.0 appeared on 2023-02-24 (one week ago!), so probably your linux
distro is one of those with instant rolling release.
Can't you compile it on your own?
Christian
windows and it solved the problem. 3.40.0 is buggy on this particular
problem.
NP, you actually solved the problem yourself ;) Anyway, keep in mind,
when you compile something on Windows using gcc, you need to include
these flags in your linker line:
-static-libgcc
otherwise, the result will depend on the libgcc_s library and not run on computers, where gcc is not installed. I don't know if the sqlite
Makefiles do it on their own, if not, simply pass this as a "LIBS" or "LDFLAGS" to configure. Probably easiest to find out by trying the
library on another Windows machine; maybe also "ldd" from the msys2
prompt could work, and if it shows any library inside your msys2
install, then it won't work outside of it.
Christian
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 498 |
Nodes: | 16 (3 / 13) |
Uptime: | 17:47:18 |
Calls: | 9,827 |
Calls today: | 6 |
Files: | 13,761 |
Messages: | 6,191,269 |