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

learn more… | top users | synonyms

0
votes
1answer
14 views

How to create temporary tables in spatialite?

How do you create a temporary table with geometry column in spatialite? I have tried: CREATE TEMP TABLE rivers (code INTEGER, id INTEGER, name TEXT); Followed by: SELECT ...
0
votes
1answer
23 views

Splitting multiline into several same-length multilines

Is there a method to convert a multiline geometry into several multiline geometries having the same length? For example break this: MULTILINESTRING((1 1, 3 1, 3 1.5, 2.5 1.5)) Into [approximately] ...
1
vote
0answers
36 views

Simplifying geometries and calculating non-spatial averages

I'm quite new to using proper spatial tools, and have a simple question that doesn't immediately show up on google. I have a table that contains multiple rows of empiric data (say, speed of a ...
2
votes
0answers
12 views

ogr2ogr fileGDB translating points

I am converting data from spatialite to fileGDB (and reverse) for a project using QGIS and ArcGIS. When I convert using ogr2ogr (or QGIS) from spatialite to fileGDB, the points are translated ...
0
votes
0answers
42 views

QGIS vector edition corrupts SpatiaLite attribute table

I have a problem with edit SpatiaLite Layer on QGIS. When I make a this set of editions: cut line, delete a part, insert a new line and save it, the attribute table is corrupted. I was thought that ...
1
vote
1answer
33 views

SpatiaLite - WITH, view or sub-query?

I am running on Windows 8.1 SpatiaLite_gui 1.8.0, SpatiaLite version 4.2.0 and SQLite 3.8.5. I need to interrogate one single spatial table whith those attributes: ID | val | val_1 | val_2 | Geom ...
3
votes
1answer
50 views

QGIS Quantile method

I have a question about the quantile classification in QGIS (2.6 and master, windows or linux). I used the points in polygon fonction. I have 100 polygons. In the attributes of my 100 polygon I get ...
0
votes
1answer
28 views

Check if point is near a linestring Spatialite

I have a LINESTRING made of two points start point and end point in spatialite. UPDATE points SET road_geometry = GeomFromText('LINESTRING(24.889142 67.196188, 24.889673 67.196579)',4326) where ...
0
votes
1answer
6 views

How to drop a table in spatialite that starts with a certain string?

I am using spatialite (v4.2.0) on a Windows 7 (64bit) PC. I need a way to drop a specific table that always begins with "_old" from my database. The file may not be in the database in the first ...
1
vote
1answer
36 views

How to save multiple layers from QGIS to a Spatialite db?

I thought I had asked this before but I can't find any trace of it. Each time I save a layer from QGIS as a spatialite it insists on creating a new db ( if you select a existing db you are asked ...
1
vote
1answer
28 views

How to create non-duplicate lines between all selected points in Spatialite?

There is a nice answer for the similar question for PostGIS. I tried to adapt it for my case where I need to connect all points from a point layer, but unfortunately I get duplicate geometries: lines ...
3
votes
1answer
59 views

Spatialite WITH clause issue

I've encountered an issue: when I try to execute in Spatialite_GUI query that contains WITH clause I get SQL error: near "with": syntax error. Also WITH unlike SELECT and other keywords is not ...
2
votes
0answers
125 views

Sqlite insert java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (no such column: SRID)

I'm trying to connect to two DBs and then copy tables by inserting rows from one table to another through java using JDBC. I'm using sqlite-jdbc-3.7.2.jar plugin.The setup is in Eclipse Luna. I'm ...
1
vote
1answer
26 views

Only my geometry layers are exported from spatialite to postgis

I have a spatialite database (v4.1.1 / SQlite v3.7.17) consisting of one geometry table and several attribute tables linked to the geometry table by foreign keys. I want to export all tables to a ...
2
votes
0answers
36 views

QGIS “Fill Ring” tool error on SpatiaLite DB?

I´m try Fill Ring tool on a SpatiaLite DB and I get a error on the Primary Key. The Primary Key is integer auto increment. When I insert the ring and try to save editing I receive error message ...
1
vote
1answer
49 views

How can I reproject a layer in a spatialite database

I'm writing an android mobile application and, for performance reasons, I want to reproject my layers to match the basemap's projection. Is there a command to do that?
0
votes
1answer
44 views

Explicitly close a OGR result object from a call to ExecuteSQL

How can I explicitly close/release the result of an ExecuteSQL statement when querying a Spatialite database with OGR via Python? I have a simple query to return the SRID of a dataset. This works as ...
1
vote
1answer
42 views

Spatialite error: obsolete libspatialite

I am learning to use QGIS with the QGIS training manual (from the QGIS website). One of the excercises is to load vector data from a database (ch 3.1.3 in case you have the manual). When I try to do ...
2
votes
1answer
63 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 ...
2
votes
1answer
76 views

Layer with custom UI not working properly

I have a problem with QGIS 2.4 when introducing layers with a custom UI. More precisely, widgets such as CheckBoxes are not recognised as such (appear as Text Edit in Attributes) and the corresponding ...
2
votes
1answer
39 views

How to rename ogr2ogr tables on export to Spatialite?

I'm exporting data from PostGIS to Spatialite using ogr2ogr. The export is working properly, except I need to be able to rename the tables that are being exported. Here's the command I'm using: ...
1
vote
0answers
55 views

Loading SQLite extensions in QGIS

I have an extension which can be loaded in SQLite using the load_extension function. It would be useful for me if I could load it in QGIS to use in queries made via Database Manager. The Python ...
9
votes
3answers
251 views

A global, grid-like projection for creating heatmaps

I'm putting together an application where I need to create a vector grid which will be used to store and display a heatmap. It has the following requirements: Can cover the entire planet. The vast ...
3
votes
1answer
86 views

Moving SpatiaLite Table into PostgreSQL using ogr2ogr?

How can I move a Spatialite table from a Spatialite db to a PostgreSQL db using ogr2ogr?
1
vote
3answers
48 views

Is there a way to add an autoincrementing primary key field to an existing spatialite table/layer?

I know that I can add a new column to a spatialite table either through the Database Manager (Edit Table – Add Column) or through the Attribute Table – Field Calculator (create new field) but I don´t ...
1
vote
1answer
26 views

Get DE-9IM matrix in spatialite?

Is there a way to get the DE-9IM matrix between two geometries in a Spatialite function, analogous to the st_relate() function in PostGIS? (I find it very helpful to spatially join using intersect() ...
2
votes
1answer
30 views

Is there an equivalent to ST_Rotate in spatialite?

I'd like to do some arbitrary rotation of spatial objects in spatialite (accessed through QGIS). In PostGIS I'd use something like: ... SELECT geom AS ST_Rotate(geom, radians, originX, originY) Is ...
1
vote
0answers
71 views

Can't install pyspatialite with python3 and sqlite3

I can't install pyspatialite. When I try it gives me this error: pip install pyspatialite Downloading/unpacking pyspatialite Could not find a version that satisfies the requirement pyspatialite (from ...
2
votes
0answers
77 views

Exporting spatialite view to shapefile from QGIS modifies the original data types

We have a spatialite .sqlite database where we have views which are nicely rendered by QGis, with all the symbols and everything!! There are integer fields on the view which are based on fields of ...
0
votes
1answer
109 views

PyQGis - Working with Spatialite

I wrote a Vector layer to a spatialite file/db using the dedicated API tool, using valid driver names supported formats by OGR. When connecting to that db, I can't retrieve properly the geometry ...
3
votes
2answers
76 views

Is it possible to decrease detail level (decrease file size) in Spatialite OSM export?

I currently use Spatialite exports from OSM data (together with Google maps like styles by Underdark) which are very useful for me as the files are easily portable with the project and I do not need ...
3
votes
2answers
68 views

problem merging polygons based on a column value - using Spatialite

edit: as I am unfamiliar with any tools I decided to try my luck with PostGis. I imported my data. and executed the query : create merged as select delomrade_code, st_union(geometry) from grunnkrets ...
2
votes
1answer
75 views

SetFeature creates infinite loop when updating sqlite feature using OGR

when using the SQLite driver in python - setting a feature after changing an attribute field value creates an infinite loop on the first record. the same code works fine if i substitute the sqlite ...
3
votes
2answers
126 views

Incorrect display of national characters from Spatialite in QGIS, Windows

I used this tutorial by Underdark (thanks much :-) ) to convert my area of interest from OSM file (whole Czech Republic downloaded from Geofabrik.de server). Used OSGEO4W shell (saying "GDAL 1.11.0, ...
1
vote
1answer
43 views

What causes this error when loading plugin

After installing pyspatialite on my Mac two plugins fail to load with this error:: This plugin is broken invalid literal for int() with base 10: '2-spatialite' I am fairly sure that the offending ...
3
votes
1answer
62 views

Does QGIS automatically use spatialite spatial indexes?

When you write a query in spatialite you have to manually join your query to the spatial index for that index to be used to speed up the query. When QGIS displays data does it take advantage of any ...
0
votes
0answers
28 views

Formula to know if LINE intersects with MBR

I have a table with four columns: SRC_X, SRC_Y, DST_X, DST_Y. (SRC_X,SRCY) have position of the start point of a LINE, (DST_X, DST_Y) have position of the end POINT of a LINE. I know there are ...
0
votes
0answers
44 views

Know if MBR contains any POINT of LINESTRING

I have a table with a Geometry column. This column only has LINESTRING. This LINESTRING only has two POINTS. If i have a MBR, i need to know which of LINESTRING of my Table has some of its POINTS ...
2
votes
0answers
128 views

Performance issue with SQLite + Spatialite + C#

I am having a performance issue with SQLite database (.db) which extends to SPATIALITE I am trying to update Geometry of 1,00,000 records in database (.db) which taking around 50 minutes. Too much ...
0
votes
1answer
49 views

How to define which columns in a Spatialite database are the latitude and longitude?

I have imported a CSV containing points with coordinates specified in columns named Latitude and Longitude. How do tell spatialite that these columns are the coordinates of of my points?
1
vote
1answer
64 views

What is format of Natural Earth SQLite database GEOMETRY column?

I need to extract coordinates of polygon boundary points in order to draw a map in my application. Does anyone know what is format of "GEOMETRY" column in this database? It doesn't look like .SHP ...
0
votes
1answer
64 views

PtDistWithin() with Geometry from query

I'm trying to run two Spatialite queries in Python — the first one picks a single point from a table, and the second tries to find all points that are within a given distance of it. So my queries look ...
0
votes
1answer
43 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) ...
0
votes
1answer
67 views

Find position of a character within a string in Spatialite

I have a bunch of data generated as a .dbf by ArcMap that I imported in Spatialite for processing. One of the columns (text data) is of critical importance since it contains the ID of a point and a ...
1
vote
1answer
167 views

Problem loading spatialite extension with sqlite3 Python connector

I am trying to load the Spaltialite extension using SQLite3 python module. I am getting the following error when I run my script. EOFError: [Errno 10054] An existing connection was forcibly closed ...
0
votes
0answers
56 views

pyspatialite, cannot update geometry

I'm trying to update geometry column with pyspatialite but it returns error: spatialite.dbapi2.IntegrityError: mypoints.the_geom violates Geometry constraint [geom-type or SRID not allowed] My ...
1
vote
2answers
143 views

TatukGIS SQLite Spatial vs. Spatialite

I must apologize in advance, I'm just getting into GIS and trying to figure things out. I have an SQLite spatial database that I'm pretty sure was created in TatukGIS. I've tried to open it in QGIS ...
0
votes
0answers
45 views

How to overlay polygons that are in the same layer

I need to INTERSECT many polygons that are in the same layer. Actually each polygons from my layer represent an area of influence from one specific bird species. Since I used to use ArcMap, I found ...
3
votes
2answers
161 views

Combining MS Office with GIS

I would like to incorporate MS Office into my GIS program. I have been using QGIS and was wondering if this would be possible? I am trying to create a one stop shop for my staff to be able to ...
0
votes
1answer
80 views

no viewable feature when creating line with ogr in python

the python code below produces the expected line shapefile viewable in QGIS import os from osgeo import ogr drv=ogr.GetDriverByName('ESRI Shapefile') if os.path.exists('test.shp'): ...