3
votes
3answers
342 views

Sqlite, Python 2.7 and Spatialite

I am trying to spatially enable my sqlite database: import sqlite3 db = r'c:\temp\mydata.sqlite' conn = sqlite3.connect(db) conn.enable_load_extension(True) cur = conn.cursor() cur.execute(r"SELECT ...
0
votes
0answers
60 views

Is there a limitation in quantity of joined tables using spatialite views?

I've one point layer in qgis and several non spatial tables in a spatialite database. Now I want to create a view as you can see in the following: CREATE VIEW testansicht10 AS SELECT ...
1
vote
2answers
113 views

sqlite version error with ogr2ogr

I am trying to randomly select some points from a shape file using ogr2ogr and an SQL query via sqlite but it seems to baulk at the sqlite version: ogr2ogr -sql "SELECT * FROM probe_2004to2012 WHERE ...
0
votes
1answer
39 views

Wrong output wth group by and aggregate function in spatialite

I have a grid and for every cell I want to set the column "landuse" according to the largest intersecting polygon. SELECT grid.PKUID, landuse.landuse, ...
1
vote
1answer
188 views

Multiple input shapefiles for ogr2ogr sqlite spatial operations

I'm running up against an issue doing a spatial operation requiring multiple input shapefiles using ogr2ogr and sqlite. I have: ogr2ogr -f "ESRI Shapefile" output.shp input.shp -dialect sqlite -sql ...
0
votes
1answer
198 views

Linked point geometries to linestrings in Spatialite

I have been parsing Canada's radio system frequency open data. It's a single large table per province, containing point geometries for each station callsign. Where a point-to-point link is defined, ...
3
votes
1answer
245 views

Why is Spatialite showing dates in MM-DD-YYYY format?

I have a table with a dates column that is formatted in MM-DD-YYYY format, as shown in SQL SELECT statements. I'm using Qspatilite (QGIS 1.8) and Spatialite GUI. When I ORDER BY the date column it ...
6
votes
3answers
2k views

How to find nearest neighbors between two tables with point locations in SpatiaLite?

I have started playing with SpatiaLite today and already stumbled upon a problem. For each point location stored in tableOne I would like to select one, nearest (linear distance) point from tableTwo. ...
4
votes
1answer
488 views

Shorter Version of this SpatiaLite Query

I've been doing some spatial queries using spatialite, and they're large enough that a spatial index becomes a must. An example of using an index is given in the tutorial spatialite> SELECT ...
4
votes
1answer
620 views

Spatialite SpatialSQL Query

I've been flummoxed by this query. I have a table of points, and a table of lines, and I am trying to return the point id and line id whenever the point is contained within a buffer of the line (i.e. ...