Skip to main content

Questions tagged [sqlite]

A self-contained SQL database engine.

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

Numerous errors migrating SpataLite database with GeoDjango

On a Windows machine, I am trying to run GeoDjango's makemigrations, but receiving numerous errors from a models.py file created from GeoDjango's inspectdb. The error block looks like: ...
jwx's user avatar
  • 713
0 votes
0 answers
29 views

QGIS - list/string comparison using SQLite

I'm using SQLite to process multiple queries while working with SpatiaLite layers. I need to identify which string has been added to a list after updating the layer. Currently, my approach involves ...
Giene's user avatar
  • 763
0 votes
1 answer
20 views

GeoDjango fails to load SpatiaLite, but not Jupyter?

I am trying to use SpatiaLite for a GeoDjango application on a Windows 10 machine using Anaconda, but, when I run python manage.py dbshell, I get an error "CommandError: You appear not to have ...
jwx's user avatar
  • 713
0 votes
0 answers
18 views

.mode column results in strange output with spatialite

I'm currently experimenting with SpatiaLite because I plan to eventually use it to programmatically generate a geodatabase from an API I have subscribed to. I already have sqlite3 available as a ...
user32882's user avatar
  • 3,544
0 votes
2 answers
25 views

How to use ogr2ogr -clipdstsql?

This works (A), $ ogrinfo -dialect SQLITE -sql "SELECT ST_Buffer(ST_GeomFromText('POLYGON ((120.81313 24.18337 ... Layer name: SELECT OGRFeature(SELECT):0 POLYGON ((120.702569638856 24....
Dan Jacobson's user avatar
1 vote
0 answers
29 views

QGIS - SQLite trigger to create buffer but with a non-overlaping clause

I'm using an SQLite trigger to add a buffer around another "POINT" layer based on entered values. The buffers are being correctly added, but I'm encountering difficulty in preventing them ...
Giene's user avatar
  • 763
3 votes
1 answer
110 views

SpatiaLite Equals function vs the standard ‘=‘ operator

When using SQLite with SpatiaLite, what is the difference between ‘=‘ and Equals? As far as I understand from the documentation: Equals(geometry1,geometry2) may return TRUE when geometry1 = geometry2 ...
Sch's user avatar
  • 41
0 votes
1 answer
32 views

Geoserver not allowed to edit gpkg

I have set up Geoserver in Tomcat on a Ubuntu Server. All the geodata is stored in a specific folder: /tomcat9/webapps/geoserver/data/GIS_data The problem is geoserver does not seem to have rights to ...
MrSalamikuchen's user avatar
1 vote
2 answers
88 views

QGIS - Synchronize polygons changes between layers

I'm working with two distinct SpatiaLite layers, each with specific fields (they are not duplicates of each other). While working on HABITATS_POLY, I aim to update ZONES_HUMIDES_POLY based on field ...
Giene's user avatar
  • 763
0 votes
1 answer
29 views

Grass GIS vector seem to lost connection to database table, but in file dbln connection exists

After I imported a big vector file and table in sqlite.db was successfully created, there were some operations then I got an error: DBMI-SQLite driver error: Error in sqlite3_prepare(): select * from ...
Nikolay Yasinskiy's user avatar
1 vote
1 answer
71 views

How to use the 'sqlite' dialect in ogr2ogr queries when one of the GeoJSON property fields is "id"

I have an example GeoJSON, and I would like to use it as input to an ogr2ogr command. I aim to generate a new file with positive integer feature ids, as described here. The example GeoJSON, src....
zabop's user avatar
  • 2,234
1 vote
0 answers
67 views

SQLite/GeoPackage over a network [closed]

In our organisation we work with data stored on an Azure network file server - pretty typical for an office. We use QGIS to read geodata files (SQLite/GeoPackage) across this network and it seems to ...
Mr_Robinini's user avatar
0 votes
0 answers
38 views

QGIS - Unable to save after mergin attribute - (SpatiaLite - Triggers)

I'm working with SpatiaLite layers, and I'm currently encountering a problem when I use the tool: « Merge attributes of selected entities ». I use several triggers that are not the cause of the ...
Giene's user avatar
  • 763
2 votes
2 answers
99 views

QGIS - Trigger's execution too slow (QGIS freeze)

I am currently working on a SpatiaLite layer that is updated after insertions and modifications through triggers. When I copy-paste features on the "HABITATS_POLY" layer, it triggers updates ...
Giene's user avatar
  • 763
0 votes
1 answer
52 views

QGIS - SpatiaLite triggers doesn't update properly each field

See edit at the end of the post I am working in two layers: HABITATS_POLY (important fields: "EUNIS_1" , "EUNIS_2" , "EUNIS_3" , "EUNIS_4" ; "EUNIS22_1&...
Giene's user avatar
  • 763
1 vote
1 answer
52 views

QGIS - How to update several rows with triggers SQLite

I currently have two SpatiaLite layers: HABITATS_POLY: Key fields include EUNIS_1, EUNIS_2, EUNIS_3, EUNIS_4, EUNIS22_1, EUNIS22_2, EUNIS22_3, EUNIS22_4. GESTION_CODES: Key fields include EUNIS and ...
Giene's user avatar
  • 763
1 vote
0 answers
42 views

Specifying field type as DateTime when exporting (save feature as...) QGIS virtual layer

To extract useful data from CSV file I use virtual layer. As virtual layer are based on SQLite all field in my virtual layer are of type int, real or text. These data need to be exported in an ESRI ...
J.R's user avatar
  • 16.6k
1 vote
1 answer
53 views

QGIS - SpatialLite - Trigger for code correspondences - Manage multiple results

I have a database containing correspondences between codes (e.g., A = 1 = 11 = H = M, etc.). I've made the first 100 rows of this data available for download. BDD Extract I would like a feature where, ...
Giene's user avatar
  • 763
1 vote
1 answer
174 views

Rebuild spatial index after massive changes

I have a question about spatial indexes. I'm using SQLite with VirtualSpatialIndex. I have a main table that contains millions of polygons. Let's say every 4 months I have to get a completely new ...
Sch's user avatar
  • 41
0 votes
2 answers
82 views

Requesting your help to identify what is automatically executed when a QGIS layer is saved

I'm working with a QGIS project where a script runs during the saving process. I've looked extensively, but I haven't been able to locate the code that gets executed. I believe the layers are saved in ...
Giene's user avatar
  • 763
0 votes
0 answers
38 views

OGR error creating feature -N: sqlite3_step() failed: UNIQUE constraint failed: layer.rowid (n)

Im in QGIS writing a plugin to syncronize 2 spatialite databases. I perfom a test to delete a feature in database A, then I click my syncronizer. And then I get this error in the message pane, not any ...
Paal Pedersen's user avatar
0 votes
0 answers
96 views

SpatiaLite / SQLite -- error: tracks.geom violates geometry constraint [geom-type or srid not allowed]

I am working with an Elixir struct that looks like %Geo.MultiLineStringZ{ coordinates: [ [ {18.68056, 54.695338, 15.6}, {18.68061, 54.695331, 15.6}, {18.68069, 54.695339, 15.6} ...
user232211's user avatar
0 votes
0 answers
27 views

QGIS 3.28.5 problems opening SQLite DB

I´m unable to open my Database and have no clue about the problem. I have the following Python error: Traceback (most recent call last): File "C:\PROGRA~1/QGIS32~1.5/apps/qgis-ltr/....
golo peters's user avatar
5 votes
1 answer
268 views

How to decide when to use the SQLite dialect when running ogr2ogr on large files

When using ogr2ogr, I got used to using the -dialect sqlite option. I often see this option in GIS.SE answers (examples), and I notice others also found it helpful: +1 for the inclusion of -dialect ...
zabop's user avatar
  • 2,234
0 votes
1 answer
146 views

Buffer lines using ogr2ogr

I'm trying to create a contour around polygons. I already managed to convert the polygons to lines and now I am trying to use SQLite and the ogr2ogr command to give them thickness. From online ...
paul maier's user avatar
0 votes
0 answers
57 views

QGIS forms and connected SQLite tables

I have a problem regarding QGIS forms for connected SQLite tables. The description is rather long, but needed in order to explain the issue. While there are many tables, it is the connection between ...
detvanliga's user avatar
3 votes
1 answer
247 views

Inserting XY POINT (EPSG 4326) fails in sqlite3 shell

I'm working for the first time with spatial databases, using SpatiaLite. I'm working with Kotlin (Xerial's driver for JDBC) and it seems to work just fine. But I'm wondering why I am getting errors ...
M I P A's user avatar
  • 33
4 votes
2 answers
1k views

Unesting JSON array in SQLite [closed]

I'm using DB Manager on QGIS to write a view. I want to "translate" unnest() SQL function, but I don't find the same in SQLite. SQL SELECT unnest(ARRAY['A','B','C']); unnest A B C The ...
GeoGyro's user avatar
  • 1,656
5 votes
1 answer
893 views

Creating relationships at the database level using QGIS and Geopackages

I've been trying to work out a way to create relationships at the database level of geopackages. Simple scenario for example - Table 'clearing' is related to table 'sourcefile'. The solution is to ...
nr_aus's user avatar
  • 3,576
1 vote
1 answer
136 views

AddGeometryColumn not creating column on new Spatialite database

I'm creating a new Spatialite database using c# and .net through the following code: using var connection = new SqliteConnection($"Data Source={Path.Combine(outputDirectory, "data.db")}&...
Walter's user avatar
  • 249
6 votes
2 answers
555 views

SQL functions supported by ogr2ogr

I have a GeoJSON, test.geojson: { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { }, "geometry": { ...
zabop's user avatar
  • 2,234
1 vote
1 answer
116 views

ogr2ogr SQLite and json_each, filtering using WHERE does not work

using ogr2ogr I want to process a geojson file that has a JSON field (see minimal file below). I tried the following command to extract the description corresponding to group a from the JSON field: ...
Quantum Martin's user avatar
1 vote
1 answer
731 views

Convert SQLite3 Geometry BLOB to WKB for PostgreSQL

I have used iterdump() to create an output file from a SQLite database that includes SpatiaLite data. I need to convert the hex data to a geometry in PostgreSQL. I have found here a summary of how the ...
CNIDog's user avatar
  • 479
3 votes
1 answer
297 views

ogr2ogr: Make polygon from points

I have a set of points in a csv file like this (ie. a square): -77.63333333;-11.75 -77.63333333;-12.25 -77.3;-12.25 -77.3;-11.75 -77.63333333;-11.75 -77.63333333;-11.75 After getting rid of the semi-...
Gery's user avatar
  • 2,135
3 votes
1 answer
213 views

How can I calculate the nearest 3D distance (x, y, z) between points in Qgis?

I'm new to Qgis. I have two point groups. One is the points representing the road with an interval of 1 m, and another is the forest area. Each point has x, y, and z values. I want to calculate the ...
Kang's user avatar
  • 33
4 votes
1 answer
347 views

Difference between SQLite and SpatiaLite export from QGIS

When exoprting data in QGIS, I can choose between SpatiaLite and SQLite files. Both files get the file extension .sqlite. What is the difference between these export formats? Is it a different data ...
e-shirt's user avatar
  • 667
2 votes
1 answer
55 views

SQLite collaboratibe editing in Mergin-Maps

I've QGIS project using SpatiaLite database. I can see SQLite as a valid data provider in Mergin-Maps user documentation, but it is not listed as collaborative editing, only GeoPackage is. As SQLite ...
CATER-COM's user avatar
2 votes
2 answers
517 views

Can't query GeoPackage geometry via SQLite client

I have a GeoPackage and I want to select the geometry as text from the SQLite command-line client. Here's what I've done: Run sqlite3 Load SpatiaLite with .load /path/to/mod_spatialite.dylib (I'm on ...
bertday's user avatar
  • 1,317
0 votes
0 answers
137 views

SQLite database not updating

I have a SpatiaLite database that I need to update from a shapefile. I have successfully created a dictionary querying the shapefile and I've printed on my console statements like: UPDATE POLE SET ...
nanunga's user avatar
  • 533
1 vote
0 answers
377 views

Export raster to SQliteDB format in QGIS

Does anyone know how I can export a raster to .SQliteDB format in QGIS? I created georeferences of satellite images with the GIS program Global Mapper for Locus Map, but now I want to understand how ...
Pavel Bodnar's user avatar
2 votes
1 answer
2k views

SQLite in QGIS project

I have exported file with no geometry, values from attribute tables, to SQLite. I manage to open it in SQLite. But when I want to import to another QGIS project or even the same project I get an ...
Marin Mirošević's user avatar
2 votes
1 answer
384 views

QGIS: SQLite DB with point data in lat, long columns (no geometry columns)

I have a SQLite database that I cannot modify (it is a local copy of a database sync'd from elsewhere). I would like to view vector (point) data from a table in this database in QGIS. The table ...
madpom's user avatar
  • 165
1 vote
0 answers
125 views

GeoPackage (GPKG) with custom style and spatial area

With Qgis 3, with the tool available in "Processing" "Layer packaging", package layers within a GeoPackage database by saving the style. But unless I am wrong, it does not allow to ...
user35117's user avatar
  • 929
1 vote
1 answer
44 views

GDAL missing VFK driver

I've installed gdal v3.6.0 with conda v4.12.0, but I'm missing VFK vector driver. How can I add it? When I run a siple script: from osgeo import gdal vfk_file = '727008.vfk' ds = gdal.Open(vfk_file, ...
Eldrik's user avatar
  • 13
7 votes
3 answers
2k views

Using input parameter as part of SQL query in QGIS model

Sample data for testing available here (the model described below is embedded in the QGIS project file) In the context of a QGIS model, I am struggling to pass input parameters as part of a SQL query ...
Lisdengard's user avatar
2 votes
1 answer
282 views

Converting a shapefile to .sqlite using Python

I am trying to convert a shapefile to SQLite file in QGIS 3.26 using Python. Here is my code: def convert_to_sqlite(self): input_shp = QgsVectorLayer("C:\shapeFile\BMR_Zones_Corrected_519.shp&...
BenStone's user avatar
  • 333
6 votes
3 answers
425 views

Adding non-spatial SQLite query to QGIS

How do I load a query of a non-spatial table to be used as a join with a spatial layer? The DB Manager doesn't allow me to load as a layer and I don't want to load the whole table.
Ariel's user avatar
  • 315
0 votes
0 answers
124 views

Add Query Feature Class to ArcMap using ArcPy

Is there any way to add a feature class from a .sqlite database to ArcMap using ArcPy (Python)? If I drag and drop the feature class from the .sqlite database, ArcMap creates a Query Feature Class, ...
Emil Nielsen's user avatar
0 votes
1 answer
56 views

SpatiaLite AddGeometry not accepting a variable [closed]

I have a program that asks users to browse for a .csv of X and Y points and then prompts the user via a sg.popup to enter a SRID (SRS) captured as string variable 'EPSG_Code'. Once entered I'd like to ...
Nick_Jo's user avatar
  • 158
2 votes
1 answer
364 views

SpatiaLite update/transform Geometry column CRS

How do I update the CRS for a table geometry column? I have created my db and table with spatialite_tool -i -shp London_Ward_CityMerged -d london_boundaries.sqlite -t Barnet -g geometry -c utf-8 -s ...
Rojj's user avatar
  • 175

1
2 3 4 5
8