SpatiaLite is a spatial extension to SQLite, providing vector geodatabase functionality.

learn more… | top users | synonyms

2
votes
1answer
32 views

Add layers to Spatialite Database using PyQGIS

I would like to add layers into a spatialite database. I have used the QgsVectorFileWriter method: parcDisSHP='/xxx/xxx/xxx/xxx/FILE.shp' parcelasDis = QgsVectorLayer(parcDisSHP, 'Parcelas_Unicas', "...
0
votes
0answers
19 views

Loading SpatiaLite tables with WHERE clause with pyqgis?

I have some layer in a SpatiaLite database that I want to filter and load in QGIS through pyqgis. From the pyqgis cookbook I read that it is possible to add a WHERE clause, so my script is like: db =...
0
votes
1answer
12 views

Update query with sub query and join in Spatialite

I am looking to do an update query to one table (munparcel_zoning) with the sum of values from a column in another table (permability.permarea) where the type (permtype) is equal to a value (...
1
vote
1answer
252 views

ogr2ogr from personal geodatabase to spatialite produces “non-spatial” tables

I have around 4 GB of data in 10 separate Personal Geodatabases, each of which contains multiple feature classes. I'm trying to convert the smallest one to SpatiaLite via ogr2ogr, in preparation for ...
0
votes
2answers
205 views

Performing spatial join in Spatialite (QspatiaLite for QGIS)

I'm trying to spatially join and summarize the attributes of a set of buildings to a set of containing parcels. There are (potentially) many buildings to each one parcel. Here is the query as I'm ...
1
vote
3answers
321 views

ogr2ogr without spatialite support - How to fix it?

I am trying to use ogr2ogr to convert OSM data from pbf to spatialite. I used to do so with the following command: ogr2ogr -f "SQLite" -dsco SPATIALITE=YES png-full-last.db planet_137.084,-15....
8
votes
3answers
559 views

Remove duplicates from Spatialite

I have a Spatialite database with points. From time to time now points are added. What would be the easiest way to remove duplicates based on the coordinates?
2
votes
1answer
479 views

Added columns in SpatiaLite wont appear in QGIS (attribute table)

I have a SpatiaLite Database with OSM-Data from planet osm (imported with the OSM import tool from QGIS2.0) Everything is fine so far. I can create, export, delete tables and draw them in qgis... but ...
0
votes
1answer
111 views

Visualizing map from Spatialite DB on Mobile

I am working on an Android application for a school project. I am converting shapefiles (examples) into SQLite databases using SpatiaLite and performing queries on those databases on the mobile with ...
1
vote
1answer
941 views

Error Loading spatialite extension in .NET Project using System.Data.SQLite

I am trying to use Spatialite in a .NET application using the System.Data.SQLite provider. I have tried to load 'libspatialite-4.dll' but an error happens when I call function "conn.EnableExtensions(...
4
votes
1answer
509 views

How do I link OGR with spatialite?

Problem & Evidence: I'm trying to create a spatialite file with the code snippet below. However the outDataSource object gets assigned NoneType and all subsequent (unshown) code fails. I'm ...
4
votes
2answers
900 views

Configuring spatialite database access for Python 2.6.6

I'm working on a GIS project, and I would like to implement and test some geo-spatial algorithms in Python. For this purpose, I will not only need sqlite, but also spatialite, in order to store and ...
0
votes
2answers
49 views

Converting SpatialLite.Core.API.IGeometry to GeoAPI.Geometries.IGeometry

I have an in-house .NET library which processes geometry data in GeoAPI form (https://github.com/NetTopologySuite/GeoAPI). Within this library I have a method which I need to call which is expecting a ...
2
votes
0answers
57 views

How to speed up work with local maps in QGIS?

within one project we are distributing a QGIS project including offline maps (you can get it here - has about 1GB) to display measurement data. Looks this way: I need to keep it as easy as possible ...
2
votes
1answer
196 views

About spatialite views and Attribute table

I try to use views with spatial column in spatialite. I can connect to spatialite database and load the layer without problems but when I try to view data in Attribute Table I can't get eny data; all ...
2
votes
1answer
49 views

ST_LocateAlong interpolation: difference between PostGIS and Spatialite

In a previous question, I discovered that ST_LocateAlong along a LineStringM is not implemented the same way in Spatialite than in PostGIS. While PostGIS interpolates between measures, this is not ...
0
votes
0answers
116 views

find pairs of near features with geopandas, fiona, gdal etc

I have a feature class of points, a few thousands I have now, but I expect to deal with hundreds of thousands of points. I would like find pair of points that is within a specific distance. The ...
0
votes
0answers
36 views

QGIS Spatialite multi-part editing

I'm exploring Spatialite, about which I know very little but trying to change that. I have started recording a walking route. On Days 1 & 2 I did the same route so copied the polyline feature ...
0
votes
0answers
33 views

What is the ogr2ogr syntax for exporting from Oracle to Spatialite?

I want to export data from Oracle to spatialite, 3 tables with geometry and 1 attribute table. Alternatively, I already have this data written out nightly using ogr2ogr, but the output location is a ...
1
vote
2answers
45 views

Find centroids of rows with Multipoint Geometry

I wish to find the centroid of a set of given points. The points will be rows of my SpatiaLite database and have Multipoint geometry. I checked the SpatiaLite manual but the ST_Centroid function I ...
2
votes
3answers
131 views

In QGIS how do I edit/save data which has no geometries?

In QGIS I can import data tables (CSV in particular) which have no inherent geometry (and no lat/lon columns) into QGIS. There doesn't seem to be any obvious way to manipulate that data (edit/save). ...
1
vote
1answer
18 views

InitSpatialMetaData errors with Spatialite

This Stackexchange may not be the best place for this question but I will start here. I am trying to create a spatially-enabled, sqlite3 database. The following code is a short example of what I am ...
2
votes
0answers
52 views

QGIS managing relationships

Coming from an ESRI background I'm used to ESRI geodatabases (.mdb or .gdb). In those databases, I could create feature classes, tables and relationships between them. Every time I loaded a feature ...
2
votes
4answers
103 views

merge overlapping polygons with spatialite

The green points, buffered by one of the point attributes, should result in the three areas outlined in red (a table with three rows): I'd like to do it in spatialite. How can I do that? If it's ...
2
votes
0answers
44 views

How to use ST_VoronojDiagram for points that are almost aligned?

I am trying to use the spatialite ST_VoronojDiagram function on a table containing four 4 points that are almost aligned: (1.01 2.02, 2.02 3.03, 10.01 10.02, 11.01 11.02). I wrote the following script ...
0
votes
1answer
26 views

Spatialite union more than two layers / tables

Is there a way to union or collect any number of layer geometries with Spatialite (or another spatial database)? Two is simple enough, but more than that becomes convoluted. For example, if all I want ...
1
vote
1answer
30 views

Create lines between two points, given an ID

I have a spatialite point table (p1) with an additonal column (pid) that relates each point to a point in another point table (p0) in the same database. I want to create a line between every pair of ...
1
vote
0answers
34 views

Finding point on line closest to other point: unexpected results [closed]

I'm basically trying to do the same thing as outlined here: Finding the point closest to a point on a near feature However, the results I'm getting with the queries suggested in the accepted answer ...
1
vote
1answer
60 views

Qgis 2.14 & spatiaLite : MakeLine and aggregate function

I want to create a line between points 104 and 74. This works : select 1 as axe, make_line(p1.geometry, p2.geometry) as geometry from MR200_amers_plan p1, MR200_amers_plan p2 where p1.matricule = ...
0
votes
0answers
32 views

How to publish layer from spatialite store in GeoServer

I've installed Spatialite extension on GeoServer(2.8.3) successfully. I created a new Spatialite database (*.sqlite file) and loaded some sample shapefiles into it. Then I added a new Spatialite data ...
4
votes
1answer
56 views

Connecting to a spatialite DB, querying, writing the queried result to a spatialite table using PyQGIS

I am developing a plugin that connects to a spatialite DB , do some queries and outputs the results to a spatialite table. I had tried with the below code to connect to the DB and print the queried ...
0
votes
1answer
231 views

BuildCircleMbr with 1km of accuracy - spatialite

I want to create a Circle MBR in spatialite of 1km for example from lat/lon in WGS84 I use BuildCircleMBR but i am not able to generate this well. My query SELECT BuildCircleMbr(40.0,-4.0,1, 1000) ...
1
vote
1answer
54 views

Foreign Key error, creating new splite db?

Attempting to use a plugin in QGIS (midvatten) that utilizes splite. I am attempting to create a db in a different EPSG than the plug in defaults to, im getting "foreign key constraint failed" as my ...
2
votes
1answer
31 views

QGIS 'Save As' to Spatialite is changing integers into strings

Using QGIS 2.14.0, Windows 10, when I use 'Save As' to save a polygon shapefile as a Spatialite layer (all options left as default), all of the input integer fields are incorrectly output as text ...
0
votes
0answers
20 views

Using SpatiaLite with Clion

What is the easiest way of importing the SpatiaLite (C++) with the Clion IDE ? I have been trying all sorts of different ways, but nothing seems to work. Does anyone know how ?
1
vote
1answer
57 views

How to get the long/lat information from a NodeID and vice versa

In the SpatiaLite website they explain how to use .osm data to create a SpatiaLite database, that contains a single table, where each row is an arc of the road graph. Then, they explain the procedure ...
1
vote
1answer
43 views

QGIS crashes (dumped crash) while importing SHP layers or SpatialLite

I meet problems with the last version of QGIS (Lyon 2.12.3) 64bits on Windows 7. The software crashes as soon as I load a SHP layer or use SpatiaLite layers (created from OSM data). Besides, each ...
-1
votes
1answer
66 views

The reason why dataset does not create layer

I have a plugin written in Python, and two versions of the QGIS, assembly there are differences, but the main suspect, that the version of GDAL==2.0.0dev (1) another 1.11.3 (2) for first >>>...
0
votes
1answer
32 views

Count polygons that intersects polygon in Spatialite

I am trying to do a very simple query, but keep getting an error. I am looking to get the count of polygons that intersect with another polygon. I've used the following query: SELECT feature__1 AS ...
0
votes
0answers
52 views

How to use SpatiaLite functions in a Python script?

I'm trying to find the intersection coordinates between a line (knowing its start and end points) and a polygon (SQlite file). I've managed to make it work in QGIS by creating a shapefile for the ...
0
votes
1answer
28 views

ST_Union returning Null with Spatialite, even after ST_MakeValid

I am attempting to run ST_Union on some features in a GROUP BY Spatialite query, with the aim of counting the number of features, and the total area of those features, which may overlap so should not ...
1
vote
1answer
135 views

How to create a new database in spatialite and insert the data using python in Qgis

I want to create a new database in spatialite and want to connect to the database and execute the sql queries. conn = db.connect('myDB.sqlite') # creating a Cursor cur = conn.cursor() sql = 'select * ...
8
votes
4answers
1k views

Can QGIS Read Spatialite Views?

I have a spatialite database I created that spans several years of crime data. To facilitate a real-world scenario where I may simplify the interaction for a user by introducing a View that simply ...
1
vote
1answer
60 views

How to manage QGIS styles saved in Spatialite

At QGIS 2.14 the style files we have saved in our Spatialite database do not show the labels anymore. Luckily I have the Layer Definition Files saved that still display the labels, but in trying to ...
5
votes
2answers
720 views

Defining spatial operators (Equals, Disjoint, Touches, Within, Overlaps, Crosses, Intersects, Contains, Relate)?

Ok, I have to admit, I don't really delve too deep into the semantics of the spatial operators list below, I'm more of a user, I write software to drive the SQL most of the time and don't really think ...
0
votes
1answer
66 views

convert GPS coordinates to SRID coordinates in spatialite

The following query fails for me: select account_nu, srid(geometry), AsText(Geometry) from tbl where contains(geometry,MakePoint('35.16604','-101.8635',4326)); I would like to find shapes that ...
1
vote
0answers
31 views

AutoNumber in Spatiallite

I have a spatiallite database. In this database I have some attributes. One of them is the attribute Nr_. In this attribute the value must be assigned automatically and is not allowed to be a double. ...
4
votes
0answers
196 views

How can I properly rename a table in a SpatiaLite DB?

Spatial layers (tables) in SpatiaLite include various supporting objects and metadata, including triggers, indices, and entries in (at minimum) the geometry_columns table. I'm looking for (preferably) ...
1
vote
1answer
61 views

Open Street Map export to QGIS Lines not Polylines

I recently updated to QGIS 2.10.1 and have found that I can no longer view .OSM files. Before I simply dropped and dragged downloaded .OSM files into QGIS and it automatically split into four ...
3
votes
1answer
60 views

QGIS convert long integers stored as string to integer [duplicate]

I have long integers (11 characters) stored as text in a shapefile that I need to convert to integers, but when I attempt to convert them in the QGIS field calculator, I get the following error: Eval ...