Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [spatialite]

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

0
votes
1answer
34 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
14 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
16 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
15 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
25 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
53 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
10 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
72 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 ...
0
votes
2answers
72 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
28 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 ...
1
vote
1answer
65 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
85 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
156 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
68 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
62 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
39 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
44 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
54 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
106 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
92 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 extension. here ...
1
vote
1answer
224 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
117 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
466 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 ...
2
votes
0answers
160 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. ...
1
vote
3answers
197 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
95 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
48 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
88 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
107 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 ...
0
votes
0answers
88 views

Is it possible to work with GeoPackage or SpatiaLite files in command-line?

I am interested in processing GeoPackage files in CLI (probably in linux). I know for example I can use ogr2ogr with the -spat option to crop OSM *.pbf file and convert it to SpatiLite DB. But is it ...
1
vote
3answers
218 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
54 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 = ...
0
votes
0answers
29 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. ...
0
votes
1answer
74 views

Create vector layers in sql in spatialite db with PyQGIS / QtSql

I have a vector layer in a spatialite DB structured as follows: In PyQGIS I try to create a derived vector layer from this like from PyQt4.QtSql import * db = QSqlDatabase.addDatabase('QSPATIALITE') ...
0
votes
0answers
72 views

sqlite layers not showing in QGIS

Installed qgis 3.2 on MAC. Added layers from spatialite database and they display fine. Two weeks later, they still show up in the original project I created in qgis, but when I try to add layers (...
0
votes
1answer
113 views

ogr2ogr Export spatial data from SQL Server to Spatialite

I am trying to export some spatial data from SQL Server 2012 to Spatialite with the following command ogr2ogr -f SQLite -update C:\tmp\Spatial.sqlite -nln "my_polygons" "MSSQL:server=host;database=...
4
votes
2answers
177 views

QGIS 3 does not load default styles from spatialite (defined in QGIS 2.18)

I have a set of styles stored in a spatialite db with QGIS 2.18, the layer_styles table looks like this: Adding a layer in QGIS 2.18 loads the style set as default (waters light blue, categorized): ...
2
votes
1answer
55 views

Build spatialite db from scratch within build process

Having a scripted build process on Windows 10 (CMD or Powershell, both is possible) I want to build a spatialite database with the ready to use but empty schema created from a couple of sql files. I ...
0
votes
0answers
71 views

Cannot open a SpatiaLite connection using ogr in Python

I need to open SpatiaLite connection to copy data to the database. This is my code: from osgeo import ogr dsc_in = ogr.Open(file_name) if dsc_in is None: raise Exception("Reading data failed.") ...
1
vote
2answers
236 views

Unique constraint for SpatialLite geometry column

I am creating a SpatiaLite database where I want to ensure that the contents of the geometry column for a table are unique. For normal SQL I would add a UNIQUE constraint to that column but, I don't ...
3
votes
1answer
103 views

Plot points from a Sqlite (non spatial) table as a query on the canvas instead of making a new table

I have a table in an SQLite database with a non spatial table that contains 6 sets of coordinates, representing different features within a record. I would like to generate a series of layers (lets ...
2
votes
0answers
74 views

Adding a Spatialite 2.3.1 layer in QGIS 3: invalid layer

I am running QGIS 3.0.3 and I am trying to add a Spatialite layer from this link http://www.gaia-gis.it/spatialite-2.3.1/test-2.3.zip The program says that it is an invalid layer and that it can't ...
1
vote
2answers
202 views

Can a Geopackage file be created by Spatialite

Starting with the Spatialite application, can a new Geopackage file be created, or is Spatialite only capable of working with existing Geopackage files?
4
votes
1answer
192 views

Sqlite ERROR: Too many connections: max 64

I would like to use the ST_SingleSidedBuffer SpatiaLite SQL function to create one-sided buffers around all lines in a layer. The following functions works fine, until the 64rd iteration. Then the ...
0
votes
1answer
76 views

Reproject all layers in a spatialite file using ogr2ogr

I would like to reproject all layers in a spatialite file from one srs to another srs. Is there a way I can archieve this without parsing the layers names to a txt-file? I know I can write all ...
0
votes
0answers
278 views

How can I build GDAL/ogr for Android which supports sqlite driver with Android Studio?

I'm working on an Android application with Android Studio. I want to use GDAL/ogr C++ library to convert two vector formats. Here, I want to convert Sqlite/Spatialite database to ESRI Shapefile. I ...
4
votes
1answer
288 views

Spatial indexes in GeoPackage files

I'm working with GeoPackage files built with QGIS3. I tried to execute some spatial queries but it was really slow, so I'd like to speed it up with indexes. After some readings I tried create ...
3
votes
0answers
283 views

How do I access my newly added fields in a spatialite layer from QGIS?

Forgive my language, I am a newbie in QGIS. I created a spatialite layer and added 4 fields. As I was working on the project I realised that I didn't need one of the fields, and I needed to add 3 ...
2
votes
1answer
154 views

Open a Spatialite database in PHP

I need to open a Spatialite database by using php in a php's framework. I've already work on a basic php file to test how it work but it gave me some errors. I've already try to load extension by ...
0
votes
2answers
143 views

Spatialite geometry

FOR QGIS: Is there a benefit to having a single spatialite database that contains many different geometry types (e.g., point, line, polygon) over separate spatialite databases for each geometry type?