Questions tagged [spatialite]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
28 views

QGIS autoincrementing primary key, unique constraint error

We changed our format for our layers from GPKG to SpatiaLite. A few Layers made some problems with an unique constraint error. Funny thing, saving them as SpatiaLite again did the job most of the time....
2
votes
0answers
27 views

Finding points in one layer within range of time of points in another layer using QGIS

I am very new to QGIS and SQL. I have two layers, each is populated with points and temporal data. One layer has information on battles occuring in Iraq and Syria, and the other has information on ...
1
vote
1answer
17 views

gdal_translate SQLite driver has no raster capabilities

I am trying to convert a raster to SQLite using rasterlite2 and gdal a la: gdal_translate -f SQLite raster.img raster.sqlite but after running the command I get the following error: ERROR 1: SQLite ...
0
votes
1answer
35 views

SpatiaLite splitting large polygons from imported shape file into multiple rows

I have this shapefile: shapes.shp in which I have imported in SpatiaLite using this command: spatialite_tool --import --shapefile shapes --db-path db.sqlite --table shapes --charset UTF-8 --srid 27700 ...
0
votes
0answers
19 views

I have deleted all the data in a SpatiaLite layer in QGIS. Can I get it back?

I am totally new to QGIS, and I am working my way through its tutorial manual. After adding a spatialite layer in tutorial 2.2.4 (https://docs.qgis.org/3.16/en/docs/training_manual/basic_map/...
2
votes
1answer
33 views

Refer to attribute of current record in SpatiaLite trigger function

This is my first attempt at creating a trigger, so apologies if its obvious. In QGIS 3.14, I have two SpatiaLite layers [Tree] and [Crown]. I am trying to create a trigger to insert a record into [...
3
votes
0answers
70 views

Load layers from SQLite database in Model Designer

Regularly, I have to load layers from SQLite databases through Spatialite in Qgis 3.16 and perform some algorithms. Extension of these SQLite databases is not *.sqlite but another format (proprietary)....
1
vote
1answer
19 views

Empty layer copied from existing SpatiaLite layer to another SpatiaLite file is invalid

I am very new to QGIS development, but not GIS. My goal is to create a copy of an existing layer (created within the QGIS GUI) from one SpatiaLite file to another, then add new attributes and populate ...
1
vote
0answers
30 views

Converting xyz files with spatialite_dem

I am trying to convert textual xyz coordinates to spatialite with spatialite_dem: $ spatialite_dem --srid 3346 -ddem all.db -create_dem all.xyz 2>&1 | head -1 unknown argument: all.xyz ...
1
vote
1answer
23 views

Disable greeting message from spatialite cmdline

I can emit plain values in SQLite3: $ echo 'select 1;' | sqlite3 1 However, SpatiaLite always emits a greeting: $ echo 'select asgeojson(st_point(1,2));' | spatialite SpatiaLite version ..: 5.0.0 ...
1
vote
3answers
68 views

QGIS SpatiaLite layer does not display

I am having a problem in QGIS with some layers failing to display on the map canvas. I am trying to learn about QGIS by working through the Training Manual found on docs.qgis.org. I am running version ...
0
votes
1answer
29 views

Seeking documentation for SpatiaLite functions like AddGeometryColumn

I'm looking for the documentation for SpatiaLite functions but all my links are failing. The Gaia GIS website appears to be down https://www.isitdownrightnow.com/gaia-gis.it.html, but I'm not sure if ...
0
votes
0answers
14 views

QGIS Database Manager - 'Not connected' error on MacOS

Mac OS 10.12.6 3.10.11-A Coruña I have connected to a Spatialite .sqlite file in the Data Source Manager, but when I try to import the contents in the Database Manager, I get an 'Not connected' error ...
1
vote
0answers
34 views

Combining Mapbox GL JS plugin with another SQLite-based plugin (Cordova)

I'm creating an App with Cordova. For this I want to use Mapbox GL JS for using offline maps and a SpatiaLite database for storing additional spatial data. The mapbox-gl-cordova-offline plugin ...
0
votes
0answers
31 views

QGIS not showing spatialite's timestamp values in Attribute Table

I opened in QGIS (3.14.16) spatialite's table which has timestamp type field, but values in this field are not visible (NULL) in Attribute Table. In DB Manager view these values are visible. but in ...
1
vote
1answer
42 views

How to get most accurate Point-Point distance queries in Europe with Spatialite

I have a GeoDjango app, currently on PostGIS, which I am converting to use Spatialite db instead. I have no specialised knowledge about GIS systems :( The locations table has a Geography column ...
5
votes
2answers
170 views

CREATE TABLE AS with geometry in SpatiaLite

I would like to create a new SpatiaLite table based on a command. For example, I would like to transform a table to a different coordinate system: SELECT Transform(Geometry, 3068) FROM points_berlin; ...
0
votes
0answers
42 views

QGIS: spatialite incorrect string concatenation when loading layers

I am trying to draw some polygons in spatialite using the DB Manager in QGIS. However select 1 as id, st_geomfromtext('POLYGON((0 0,0 '||random()||','||random()||' '||random()||','||random()||' 0,0 0))...
1
vote
0answers
22 views

QGIS: spatialite error: no such function: st_functionname() in specific qgis project

From one day to another I can't import any queryresults that contain a spatialite function as layer from DB manager anymore despite the query concluding successfully in DB manager. select * from table ...
1
vote
0answers
75 views

Converting SQLite BLOB geo to Polygon in Python using SQLite3

I am trying to convert a geo column into Polygons in Python with SQLite3. I imported the file into Python and geo rows look like following first row: geo[0] = b'\x00\x01$i\x00\x00@\xd9\x94\x8b\xd6<\...
1
vote
0answers
44 views

qgis + spatialite: convert a list of points into lines and distances

I have a list of points stored in a spatialite database (track points from a gps log). I would like to transform these into a set of line segments and calculate the length of each segment. The ...
1
vote
0answers
105 views

Trouble with GeoPackage - is SpatiaLite a solid alternative?

I like GeoPackage because it is very versatile, small and compact and works well with QGIS. But the more I use GeoPackage and recommend it to my customers, the more negative experiences I have: ...
0
votes
1answer
56 views

Returning null during using SpatiaLite transformation command in Android Studio

I am using Spatialite version as following: SPATIALITE_VERSION: 5.0.0-beta1 PROJ4_VERSION: Rel. 6.1.1 I am running the SpatiaLite transform function in the android studio and it returns a null value ...
1
vote
2answers
199 views

ogr2ogr large gdb file to SQLite warning: “organizePolygons() received a polygon with more than 100 parts”

I'm trying to write a .gdb file (could also be any other format, geojson, gpkg, etc.) to a Spatialite DB but it takes awhile and I am getting a warning. Command: ogr2ogr --config OGR_SQLITE_CACHE 1024 ...
1
vote
0answers
42 views

QGIS labels rounding error

I wish to use rounded values as labels using QGIS 3.4.4. My field is type "double" and the the data source is a Spatialite table. I notice two odd behaviors linked to this problem. First, ...
0
votes
1answer
75 views

Best method for expanding Multi* geometries to their constituent objects [closed]

I have a SpatiaLite table with a geometry column containing a mix of multi and single geometries, e.g. (Multipolygon, Polygon) or (MultiLineString, LineString). The application that will be reading ...
0
votes
1answer
113 views

Can I store raster data in a spatialite database (in QGIS)?

This might be a super simple question, but I'm a little confused. I don't know what the best way is to share qgis-projects that have raster-data, vector-data and some applied styling. I figured a ...
1
vote
0answers
12 views

Counting number of intersections for N linestrings

I have a database with D entries of polygons representing buildings. Each entry/row has the following information: id, min_height, max_height, geom (min_height is for buildings that have some kind of ...
2
votes
0answers
25 views

How to find cities without nearby bigger city in SpatiaLite?

I have a table cities, each with a population INTEGER and a geom POINT location (WGS84). I'm trying to select all cities where there is not a more populous city within 50 km using the latest ...
0
votes
0answers
15 views

How to Create Spatialite tables and layers in QGIS using Python

I'm trying to build a data model for use in QGIS. I want to use Spatialite (SL). I've found a few things on the internet to create an in memory layer. I don't know how to specify the SL database where ...
1
vote
0answers
28 views

Spatialite - Editing points

I have a few hundred invalid x-coordinates on points in my database, as a result of a GPS logger malfunction. Database is Spatialite, GPX-files were imported with gpx2spatialite. As they are messing ...
1
vote
0answers
47 views

How to visualise generic geometry column from SpatiaLite database in QGIS

I have a SpatiaLite database with various tables. One is a table called Geometries that has a geometry column which is defined as a generic Geometry column - that is, not POINT or POLYGON or anything, ...
4
votes
0answers
112 views

Creating child entries in QGIS form with Spatialite many-to-many relationship

I am trying to reproduce the example from Introducing many-to-many (N-M) relations using Spatialite. Creating the tables and the relations works fine, but when I try to create a child element in a ...
1
vote
1answer
92 views

Create clusters from point layer [closed]

There is a point layer with points in a irregular grid. I need to separate them in 11 more or less identical cluster so that each cluster has more ore less the same amount of points in one area. Is ...
0
votes
0answers
24 views

Intersections between two Linestrings - SpatiaLite

I have two LineStrings and would like to draw the point of their intersection. The two lines are similar to this: LINESTRING(445798.43 6153379.87, 445892.89 6153340.08, 445987.35 6153300.3, 446081.82 ...
0
votes
0answers
51 views

Virtual layer with st_buffer from geopackage layer

I'm trying to make a virtual layer that has a buffer over a layer of lines. If I run the following query on a layer in shapefile it works correctly create view river as select st_buffer(geometry,50) ...
0
votes
0answers
44 views

getting convert X and Y to lat and long

I have a table called IK_TEMP and it contains columns called data, range . String sql = "SELECT DATA, RANGE FROM IK_TEMP"; try (Connection conn = this.connect(); ...
0
votes
0answers
62 views

Load a layer from SpatiaLite database, using Python

I'm new to SpatiaLite and PyQGIS. I would like to upload a layer from SpatiaLite database. To do this, I tried with this code: database = r"C:\sqlite\db.sqlite" uri = QgsDataSourceUri() uri....
0
votes
0answers
16 views

Spatialite layer with multiple geometry type in QGIS3

The spatialite table has field with GEOMETRY type and contains both line and polygon features. How to add them in QGIS 3.8.1 project as individual editable layers?
0
votes
0answers
38 views

ogr2ogr Error 1: no linking against spatialite library

I'm receiving this error from ogr2ogr: ogr2ogr -f SQLite testspatialite.sqlite test.sqlite -dsco SPATIALITE=YES Warning 6: driver SQLite does not support creation option SPATIALITE ERROR 6: OGR was ...
0
votes
0answers
41 views

Geometry loss/mix up of a spatialite view joining two tables

I have two Spatialite tables: - Sites (with geometry column) (ca. 5000 single sites) - Samples (ca. 6800 samples) To display the samples in QGIS I want to create a spatial view showing all samples at ...
0
votes
1answer
46 views

Check direction of linestring against corresponding polygon using SpatiaLite

I have a polygon and a linestring that is part of the polygons boundary, but not necessarily digitized in the same direction as shown here: In this case the linestring runs in the opposite direction ...
0
votes
1answer
43 views

SpatiaLite: Distance returns NULL when geometries touch

I use the Python sqlite3 library as well as the SQLite3 CLI. I am also using the Distance function with the use_ellipsoid parameter, to get the distance between two geometries in meters. Whenever the ...
1
vote
1answer
108 views

QGIS add PostGIS / Spatiallite rows as layers

I wish to be able to query PostGIS and Spatialite tables and add vectors from individual rows whose attributes meet criteria as multiple layers under a group or sub group instead of a single layer for ...
0
votes
0answers
66 views

How to minimize size of Spatialite file by reducing excess projections, logging etc

I have a spatialite db with only 1 table. It contains a million simple polygons with 8 points each and is about 350 MB. It is intended for read-only use in a mobile app, so I want to reduce the size ...
0
votes
1answer
95 views

Spatialite - update query for bounding polygon using WITHIN

I have 2 spatialite polygon layers which represent land parcels and municipalities. Each parcel is within or intersects 0, 1 or 2 municipalities. I am trying to update a field within the parcel layer ...
2
votes
0answers
101 views

Fresh QGIS 3.12 and 3.10 Installation result in unknown error when saving Spatialite layer

This is the most interesting problem to resolve. On a brand new Windows 10 HP Laptop, I install Windows with the latest updates and then install both versions of QGIS 3.10 and 3.12. On creating a new ...
1
vote
1answer
62 views

Dump all spatialite tables to shp and dbf

Given a spatialite database i want to export/dump all tables to shapefile (or dbf for those without geometry). I want to do it programatically so acceptable solutions will be using a (bash) command ...
2
votes
0answers
21 views

For Spatialite databases in QGIS, why is the provider 'spatialite' sometimes and 'ogr' other times?

I have many spatialite databases that I use across a lot of projects and sometimes the Provider is set to 'spatialite' and sometimes it's set to 'ogr', seemingly arbitrarily. This causes issues when ...
-2
votes
1answer
57 views

Find multipolygons in spatialite [closed]

How could I identify and select the rows with multiparts? How could I copy/save the polygons from a table with geom MULTIPOLYGON into a table with geom POLYGON?

1
2 3 4 5
13