Questions tagged [spatialite]

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

Filter by
Sorted by
Tagged with
2
votes
0answers
62 views

Why ST_Distance give something different to 0?

I have this SQL: select ST_Distance(GeomFromText('POINT(-0.338767 39.55425)', 4326), geom) dis1, ST_Distance(GeomFromText('POINT(-0.338767 39.55425)', 4326), geom, 1) dis2, AsEWKT(geom) ...
2
votes
1answer
29 views

GDAL SQLite geometry error

I am having the following issue writing points to a SQLite file using ogr with SPATIALITE enabed: ERROR 1: Cannot insert feature with geometry of type POINTZ in column GEOMETRY. Type POINT expected ...
3
votes
0answers
53 views

Processing a Sqlite table in standalone QGIS application

I have been trying to use a single table of a Spatialite db in a standalone Python application. I have run it through the QGIS interface to find how it used the input pathway, which was: 'dbname=\'C:/...
0
votes
0answers
27 views

Loading spatialite tables into GeoPandas GeoDataFrame

Using information from here, I am trying to load a result of a SQL Python selection into a Geopandas geodataframe. I know pyspatialite is not longer maintained, so have tried using the dbapi2 module ...
1
vote
0answers
14 views

How to load a merged geometry view from Spatialite to QGIS

In DB manager on QGIS 3.6 I have a view created from a table in a Spatialite database using st_union(geometry). The geometry field is created and seems to have geometry stored in it, but it loads as ...
0
votes
1answer
60 views

Error: Geometry constraint geom-type or SRID not allowed. How to ensure the correct geom-type?

Following the top answer on a previous question about storing geometries in a spatialite database, I am trying to update a spatialite table using: engine.execute("SELECT AddGeometryColumn('your_table'...
1
vote
1answer
44 views

Calculating distance from centroid points to multiple polygon edges with SpatialLite

My question builds on a question previously asked (Calculating all distances from single points to multiple polygons). User @alexandre-neto provided an answer that I've worked on, but it isn't giving ...
0
votes
0answers
49 views

Loading and displaying NDS (Navigation Data Standard // SQLlite)?

On QGIS 3.4 (Windows), I would like to load and display NDS (Navigation Data Standard) data (attributes and geometry). I succeed in loading NDS data sample from openlanemodel. Via the QGIS DB manager,...
0
votes
1answer
78 views

Constructing query to return values from all polygons that line passes through using SpatiaLite? [closed]

I want an SQL query in Spatialite to return a list of values (Primary Key in this case, but could be any value) from all the polygons which are crossed by a line. Say, for example, a footpath passes ...
1
vote
1answer
53 views

How to create table with geometry column in GPKG with spatialite?

I want to create a vectorial GPKG with spatialite. With the help of the documenation (here: http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.3.0.html#p16gpkg ), I've created a sql script that look ...
0
votes
0answers
18 views

Remove duplicate polygons in a single layer using ogr2ogr? [duplicate]

I have a spatialite database file containing buildings within a country as multipolygons. While trying to use QGIS to delete these duplicate features, QGIS keeps on crashing due to the millions of ...
0
votes
0answers
27 views

QGIS @parent or import to database(Error 7) not working for layer

I have a shape file layer that won't load into the SpatiaLite database and it gives Error 7. It also won't run functions that work in other layers and works fine without the @parent or if I remove ...
0
votes
1answer
15 views

Counting (Multi)Polygons Within (Multi)Polygons on same Table

So I have a table with approximately 10k rows, with each row having its corresponding geometry entry. What I am attempting to do is count how many row geometries are contained/within the geometry of a ...
0
votes
1answer
19 views

Initialise a database with SpatiaLite 4.3

I am starting to work with SpatiaLite 4.3 in an empty database. SpatiaLite requires a number of meta-data tables, where it stores information about geometry fields. For previous versions there are SQL ...
1
vote
1answer
29 views

Field added to SpatiaLite table doesn't show in QGIS

I have a spatial table in a SpatiaLite database that I'm editing in QGIS with no problem (the spatial table was created through SpatiaLite GUI). I then added a text field to the table through SQL ...
1
vote
1answer
43 views

Finding nearest line from points in SpatiaLite?

I have writtern a query in Spatialite to get the nearest line from a point. I want to do that for all points. How can I modify the below codes: SELECT g1.id As gref_id, g2.id As gnn_gid FROM ...
1
vote
1answer
57 views

Efficiently query two properties QGIS spatialite

I have a simple query that involves two steps: non-spatial criteria (should be super-fast) spatial criteria (which is really slow) I would like to run the spatial query only on the filtered layer (...
0
votes
1answer
50 views

Importing NAS Data into SQLite database? [closed]

I'm trying to import German NAS-Data into a SQLite- Spatialite-database. For this I use the following command: ogr2ogr -f SQLITE --config OGR_SQLITE_CACHE 8192 -gt 65536 -skipfailures -s_srs "+proj=...
0
votes
0answers
104 views

Loading spatialite with python3's module under Windows

I installed spatialite's Python module using pip: pip install spatialite I copied the mod_spatialite.dll found on https://www.gaia-gis.it/gaia-sins/index.html into my windows/system32 folder (I have ...
0
votes
0answers
24 views

Apply gdal_rasterize with spatilite

I am trying to rasterize a spatialite database using gdal_rasterize. I am using gdalUtils in R to do so and have run the following gdal_rasterize -burn 1 -sql SELECT * FROM plants WHERE binomial="...
1
vote
0answers
24 views

'SELECT AddGeometryColumn' in C++ crashed

I am using MSVC 2018 developed a GIS program. I use spatialite API to create a SQLite geometry database. The program always crashed when executing "Select AddGeometryColumn'. I don't know if I need ...
1
vote
0answers
26 views

Auto delete 5th record while inserting 6th record of polygon to SpatiaLite table

I am having problem while inserting 6th record to SpatiaLite table it auto deletes 5th record, and after that it is ok. I am using SpatiaLite database to insert some polygon using Google Maps API in ...
0
votes
2answers
67 views

SQLite spatial function

I have a SQLite database, with point and linestring geometries. Between the points(blue) and the linestring(green) is a gap, which I want to close with another line(red). The line should have angle of ...
0
votes
0answers
27 views

Suitable Image or container that has ST_MakeValid functionality

I'm looking for an easy to deploy machine image that would allow me to use the ST_MakeValid function. I'm looking to use this in an ogr2ogr call, but can't get a version compiled correctly against ...
3
votes
0answers
112 views

Loading editable SQLite layer in QGIS?

I converted a shapefile to a SpatiaLite database so I could work with attributes with a length longer than 254 characters, and also not see some columns and change their order. In QGIS 2.18.16 I have ...
1
vote
2answers
92 views

Seeking list of spatial functions available in PostGIS but unavailable in Spatialite?

It seems like most of the classic spatial function available in PostGIS (i.e. ST_Buffer) are usable with Spatialite, but some others don't seem to be supported in Spatialite (i.e.: no such functions: ...
1
vote
1answer
36 views

Arcs from a Delaunay Triagulation

I am trying to generate a Cost Distance table using Spatialite. I have several points in the table random_points for which I would like to compute the Delaunay triangulation and use the segments it ...
2
votes
2answers
138 views

Calculating point layer values within polygon features in QGIS 2

There are two layers polygon BereichBerechnung with a field "Are_Number" points EW2017 with a field "EWjeAdr" In QGIS with a Virtual Layer, I want to calculate the sum of the field "EWjeAdr" for ...
1
vote
1answer
176 views

Efficient intersect query for virtual layers in QGIS

I have 3 tables/shapes as follows: ADRR (adress points) ADRR_ID | ST_ID (street surface id) | point geometry STREET ST_ID | ST_NAME (street name) | polygon geometry Obstacles ID_OBS | ...
0
votes
0answers
165 views

Can I use SpatiaLite database using Room for Android?

I want to use the SpatiaLite database using Room library for my project. Is it possible to do? I have heard there is a custom open helper for the Room which might help to use the SpatiaLite db. But ...
-2
votes
1answer
255 views

Difference between SQLite and SpatiaLite? [closed]

I wrote telegram bot for my uni project that receives from user spatial and non-spatial data (coordinates and user identity) and puts them in an SQLite database. Then when I extract this database and ...
1
vote
1answer
97 views

QGIS cannot save to SpatiaLite after vector difference?

In QGIS I have a spatialite DB full of roads. I'd like to do a Difference operation (Vector > Geometry Tools > Difference) with another layer in order to keep roads only available in a given ...
0
votes
1answer
112 views

Querying geometry in perimeter or square with SpatiaLite?

How can I query geometry in a perimeter or a square with SpatiaLite? CREATE TABLE points (id INTEGER,geom GEOMETRY) insert into points values (897, GeomFromText('POINT(40.0 3.0)')) I've tried ...
0
votes
0answers
60 views

Spatialite: command not found on CentOS 7

I've installed Spatialite on CentOS 7 using this procedure: 1) SQLite installation wget https://www.sqlite.org/2018/sqlite-autoconf-3240000.tar.gz tar -xzf sqlite-autoconf-3240000.tar.gz cd sqlite-...
0
votes
1answer
90 views

With Spatialite, how do I run PtDistWithin with meters?

So the problem is that I have a set of multipolygons and points and I need to be able to query the data with a given point to check which ones are within 'x' km. Initially my SRID was 4283 but I ...
2
votes
0answers
68 views

Extracting polygons from mbtiles

Currently, one can extract features within a bounding box from an mbtiles file using tilelive-copy. However there is no way to extract features within a polygon from an mbtiles file. The mbtiles-...
7
votes
1answer
152 views

Creating SpatiaLite view (for use in QGIS) from non-spatial SQLite database?

I have a plain SQLite database that contains X, Y coordinates in a table. Data are edited via an MS Access front-end using the ODBC driver and so I want to avoid storing them in a geometry blob that ...
1
vote
0answers
233 views

GeoDjango application using SpatiaLite database

I want to create a simple GeoDjango app with SpatiaLite database but I have this error at migrate: django.core.exceptions.ImproperlyConfigured: Unable to load the SpatiaLite library extensio`. ...
1
vote
1answer
336 views

Installing Spatialite on Centos7: select mod_extension() doesn't work

I'm trying to install Spatialite on a CentOS 7 server. Sqlite (version 3.7.17 ...), works fine. Using the command yum list | grep spatial the result is the follow So I've installed Spatialite ...
0
votes
1answer
230 views

Convert XY (SRID 4326) to UTM in spatialite returns NULL

How can I convert EPSG4326 point to UTM in spatialite? SRID=4326;POINT(51.2506238 35.70442974) Executing X(TRANSFORM(Geometry, 32639)) as X always returns NULL. What's the proper way of extracting ...
1
vote
2answers
665 views

How can I create a map style for OSM data in QGIS 3

I am new to QGIS (Version 3.2.2) and basically what I want to archive is to load OSM data and apply my own map style to it. However once I have defined my style I would also like to be able to load ...
3
votes
0answers
294 views

Does GeoPackage support simultaneous editing?

I am looking to move a mess of shapefiles to a newer format, either Spatialite or Geopackage. I have read that Spatialite can handle multiple users editing the same file more or less simultaneously. ...
2
votes
3answers
346 views

Re-projecting base map (WGS 84 EPSG: 4326)

I am trying to change my base map from the open street plug in to Google Street Map from WGS 84 EPSG: 3857 to WGS 84 EPSG: 4326. My spatialite polygons (originally mapped on United States) projects ...
4
votes
0answers
127 views

Offline editing solution for small GIS project with multiple editors?

I have a specific use-case that I cannot seem to find any solutions for online, so any and all advice would be most welcome. Some basic details: I am part of a small academic organization (a research ...
1
vote
1answer
64 views

Error while Importing data from .SHP files to spatialite using OGR2OGR

I was trying to import data from files provided here http://download.geofabrik.de/europe/france.html specifically http://download.geofabrik.de/europe/france/languedoc-roussillon-latest-free.shp.zip ...
1
vote
0answers
122 views

Adding SpatiaLite to Visual Studio project (already has SQLite)

I am very new to SpatiaLite. I am working on a large Visual Studio C++ project that already supports SQLite, and I am trying to add SpatiaLite capabilities to it. After reading the documentation and ...
2
votes
1answer
130 views

How to merge big and many polygons (SHP) in QGIS/Spatialite?

Background: I have a bunch of (huge) SHP-files that I would like to merge to one big SHP-file that I can use for geo-processing (clip, etc.). Now I was able to merge a big part of the SHP-files to one ...
1
vote
3answers
326 views

How to modify spatialite table column names with QGIS?

I am trying to modify column names in a SpatiaLite table. To do that, I run the following SQL statements in the DB Manager : -- Rename existing table ALTER TABLE compteur_routier RENAME TO ...
1
vote
1answer
66 views

Adding per-row creation time and modification time in GeoPackage geometry table?

I need to add ctime and mtime to a GPKG sqlite database in table with geometry. Apparently logic solution: add ctime column with DEFAULT CURRENT_TIMESTAMP and add trigger ON UPDATE to set mtime = ...
1
vote
0answers
35 views

python 3.6 spatialite 4.3 on mac

In researching this problem, it appears that there is an issue with loading extensions in sqlite3 that requires a recompile of sqlite3 so SELECT load_extension("mod_spatialite.dylib") can be called. ...