﻿{"id":8455,"date":"2019-04-03T01:04:23","date_gmt":"2019-04-02T23:04:23","guid":{"rendered":"http:\/\/www.sigterritoires.fr\/?p=8455"},"modified":"2023-06-29T15:10:54","modified_gmt":"2023-06-29T13:10:54","slug":"spatialite-databases-with-qgis-2-8-wien-tutorial","status":"publish","type":"post","link":"https:\/\/www.sigterritoires.fr\/index.php\/en\/spatialite-databases-with-qgis-2-8-wien-tutorial\/","title":{"rendered":"SpatiaLite databases with QGis 2.8 Wien tutorial"},"content":{"rendered":"\n<p>This tutorial provides you with the necessary steps\nto manage databases in QGIS. Although QGIS can handle several\ntypes of databases, we used SpatiaLite because it provides a lot of features\nwithout the need for a particular installation and very little administration\nwork. <br>\nBy\nusing the database manager included in QGis, you can perform a certain number\nof database operations. <br>\nThe\nmain operations are: indexes creation, spatial and non-spatial views, import\nand export data, queries execution. After\ndiscussing the QGis database manager and the SpatiaLite usage guidelines in\nthis tutorial, you&rsquo;ll be well equipped to write more complex queries and take\nfull advantage of the SQL and SpatiaLite SQL commands. <\/p>\n\n\n\n<!--more-->\n\n\n\n<div class='stb-container stb-style-warning stb-caption-box'><div class='stb-caption'><div class='stb-logo'><img class='stb-logo__image' src='data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN\/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz\/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH\/w\/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopF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lQ8aMmRIImnjvPQL\/O3vQUq0dWHESWIMHE1oxFQIR\/A3\/hV33QvBBas11wTPQevQhZSH1hDq2AWr8cTxYcN+9uOqqqov2lTGjy4qKh48ZPCQhAf+ljfxt60FM3ru0\/QB20bP6Ufo3hcgpzd0zMUsmoMxoBiSja1bQw8jh2vwVpfiCsQ7deowfsKE+9tsWnfdffcYQUcl6nHX\/QEhFGTlc\/mGAnE96JyPpEQRO0iMyvfQcnojnrRuDR\/EjOJuXoU6UE3Cdhkx4pbbYhkZ6a0GycjIyOjbp+9AW4GqLkfVfHrKvs8RrVBaUMLvr4bkicAUzTAYJmpPZVBctmYNpQEGnDiG2rIaVzRyc3O75\/fI793qJnZ+fv4Pu+Tk5HhKUF9WB8nPSG1D4RPG31eF86eHMG+aAGYK6pN38Ta\/FVyDVVuaWDr+vioM3yOSmqp3u6rbj4CKVoE0NDT4lmV5KSnRkBhhcBWk0Kwr0ophpOJv\/Dt+xargnu5akBIJHL0tIJ4C9CCxiuDYtrTatHbs2LFn7549+0Liow8YgZbdA2mo\/+alqDU2bqQheijI5qHoqcq3tWs4Qd7Rry9CE6GhocGvrv5sd6tBPM9rfOONFStTwwbEryB0\/ysY\/YYHdZKVhGRbxALLauOcJFgWWkYXQr9ahDagkGhIo6Ji46adO3dUtimPhMPh+GuvLVt9e1HRkGMNieCSd\/ALpO4g+N6F\/xdUSgStaz7EOhE1Nb766lB90e2331FZWVnW4p7P1tdKT0+\/8okn5i4aN25cSWpaGo4SXF+h1IV\/ycA0dMK6hmlobN68ZcekSRN\/8+m2bW+dqa\/VmgZd2jXXXHNzYeHNhTcMvWFIz55X58ViseiFemNCC2KKOnDgwNFPtm6tWrNmzftvv\/3W67Zt7zpbg66tncYO8Xi8SywWizXNkwvE4h86dOioZVmHALs1nUbt8rsol0Eug1wG+Z8a\/x0A3thDl\/BwJ7kAAAAASUVORK5CYII=' alt='img'\/><\/div><div class='stb-caption-content'>Update 26\/01\/2018<\/div><div class='stb-tool'><\/div><\/div><div class='stb-content'><\/div><\/div>\n\n\n\n<p> Ales Nordeen informed me about the availability of a set of tutorials on SQLite. The tutorial covers the basics of SQLite (introduction, installation guide, database and table operations). It also introduces data types, keys, clauses, queries, and joins, SQLite Index, Trigger, View, and Functions.<\/p>\n\n\n\n<p>[\/ stextbox] <\/p>\n\n\n\n<p><strong>Database fundamentals <\/strong><\/p>\n\n\n\n<p>A database is a structured set of data. Databases\noffer several advantages over data stored in a simple file format, such as\n<a href=\"https:\/\/www.sigterritoires.fr\/index.php\/en\/shapefile-vs-geopackage\/\">shapefile<\/a> or KML. Benefits include complex\nqueries, complex relationships, scalability, security, and data integrity, to\nname a few. <br>\nThere\nare several types of databases. However, the most common type of\ndatabase is the Relational Database. In\nthis tutorial we\u2019ll refer to this type. <\/p>\n\n\n\n<p><strong>Database tables<\/strong>\n<\/p>\n\n\n\n<p>A relational database stores the data in tables.\nA table is made up of rows and columns, where each row is a\nsingle data record and each column stores a field value associated with each\nrecord. A table can contain any number of records. However,\neach field is uniquely named and stores a specific data type. <\/p>\n\n\n\n<p>A data type restricts the information that can be stored in a\nfield, and it is very important that the appropriate data type and its\nassociated parameters be correctly chosen for each field in a table.\nThe common data types are: <br>\n\u2022\nInteger <br>\n\u2022\nVariable \/ real \/ decimal <br>\n\u2022\nText <br>\n\u2022\nDate <br>\nEach\nof these data types can have a set of additional constraints, such as setting a\ndefault value, limiting the size of the field, or prohibiting null values.\n<br>\nIn\naddition to the common data types that were mentioned earlier, some databases\nsupport the \u00ab\u00a0geometry\u00a0\u00bb field type, allowing the following types of\ngeometry to be stored: <br>\n\u2022\nPoint <br>\n\u2022\nMulti-point <br>\n\u2022\nLine <br>\n\u2022\nMulti-line <br>\n\u2022\nPolygon <br>\n\u2022\nMulti-polygon <br>\nThe\nmultipoint \/ line \/ polygon types store multipart geometries: for a single\nrecord of the table, several geometry parts are associated with it.\n<br>\nShapefiles\nstore geospatial data in multi-type geometry. Using\nthis type of geometry is a good practice if you plan to convert to or from this\nformat <\/p>\n\n\n\n<p><strong>Relationships between tables<\/strong>\n<\/p>\n\n\n\n<p>A given relationship between tables connects the records of\nthese tables. The advantage of linking tables\nis to reduce data redundancy and increase data integrity. In\norder to link two tables, each table must contain an indexed key field.\n<br>\nOrganizing\ntables to reduce redundancy is called normalization. Usually,\nnormalization involves splitting large tables into smaller and, therefore, less\nredundant tables, followed by defining relationships between tables.\n<br>\nA\nfield can be defined as an index. A field defined as an index must\ncontain only unique values \u200b\u200bfor each record, and therefore, it can be used to\nuniquely identify each record in a table. An\nindex is useful for two reasons. First, it allows records to be\nquickly found during a query (if the indexed field is part of the query).\nSecond, an index can be defined to be a primary key for a\ntable, making it possible to build relationships between tables. <br>\nA\nprimary key consists of one or more fields that identify a record within a\ntable. <br>\nAn\nexternal key consists of one or more fields that identify a record in another table.\n<br>\nWhen\na relationship is created, a record in one table is linked to a record in\nanother table. With related tables, more\ncomplex queries can be executed and redundancy in the database can be reduced.\n<\/p>\n\n\n\n<p><strong>Structured query language\n(SQL)<\/strong> <\/p>\n\n\n\n<p>Structured Query Language (SQL) is a language designed to\nmanage databases as well as the data they contain. Addressing\nSQL exhaustively is a task beyond the scope of this tutorial. We\nwill resume here some basic elements of the language that we will use in this\ntutorial. <\/p>\n\n\n\n<p><em>Note: A complete list of SQLite SQL commands is available\nat<\/em> <a href=\"https:\/\/translate.google.com\/translate?hl=fr&amp;prev=_t&amp;sl=fr&amp;tl=en&amp;u=http:\/\/www.sqlite.org\/lang.html\"><em>http:\/\/www.sqlite.org\/lang.html<\/em><\/a>\n<em>.<\/em> <em>A complete list of SQL commands for the SpatialLite\nextension is available at<\/em> <a href=\"https:\/\/translate.google.com\/translate?hl=fr&amp;prev=_t&amp;sl=fr&amp;tl=en&amp;u=http:\/\/www.gaia-gis.it\/gaia-sins\/spatialite-sql-4.2.0.html\"><em>http:\/\/www.gaia-gis.it\/gaia-sins\/spatialite-sql-4.2.0.html<\/em><\/a>\n<em>.<\/em> <\/p>\n\n\n\n<p>SQL provides functions to select, insert, delete, and update\ndata. Four frequently used functions of SQL data are:\n<br>\n\u2022\nSELECT: This function retrieves a dataset of one or more tables based on an\nexpression. A query is basically a structure\nof type <br>\n<strong>SELECT &lt;field (s)&gt; FROM &lt;table&gt;<\/strong>\n<\/p>\n\n\n\n<p><strong>WHERE &lt;operator&gt; &lt;value&gt;;<\/strong> <\/p>\n\n\n\n<p>where <strong>&lt;field (s)&gt;<\/strong> is the name of the field whose\nvalues \u200b\u200bare to be retrieved and <strong>&lt;table&gt;<\/strong> is the table on which the\nquery is to be executed. The <strong>&lt;operator&gt; part<\/strong>\nchecks the condition (such as =,&gt; =, like) and <strong>&lt;value&gt;<\/strong> is the\nvalue to compare to the field. <\/p>\n\n\n\n<p>\u2022 INSERT: This function inserts new records into a table.\nfor example <\/p>\n\n\n\n<p>INSERT INTO &lt;table&gt; (&lt;field1&gt;, &lt;field2&gt;,\n&lt;field3&gt;) VALUES (&lt;value1&gt;, &lt;value2&gt;, <br>\n&lt;value3&gt;);\n<\/p>\n\n\n\n<p>inserts three values \u200b\u200bin their respective domains, where <strong>&lt;value1&gt;<\/strong>\n, <strong>&lt;value2&gt;<\/strong> , and <strong>&lt;value3&gt;<\/strong> are stored in\n&nbsp; <strong>&lt;field1&gt;<\/strong> , &nbsp; <strong>&lt;field2&gt;<\/strong>\n, and <strong>&lt;field3&gt;<\/strong> of <strong>&lt;table&gt;<\/strong> . <\/p>\n\n\n\n<p>\u2022 UPDATE: This function modifies an existing record in a\ntable. for example <\/p>\n\n\n\n<p> <strong>UPDATE &lt;table&gt;<\/strong> <br>\n<strong>SET &lt;field&gt; = &lt;value&gt;;<\/strong> <\/p>\n\n\n\n<p>This statement updates the value of a field, where <strong>&lt;value&gt;<\/strong>\nis stored in &nbsp; <strong>&lt;field&gt;<\/strong> of <strong>&lt;table&gt;<\/strong>\n. <\/p>\n\n\n\n<p>\u2022 DELETE: Deletes records from a table. For\nexample, the following statement deletes all records that satisfy the WHERE\nclause: <\/p>\n\n\n\n<p><strong>DELETE FROM &lt;table&gt; WHERE<\/strong> <br>\n<strong>&lt;field&gt; &lt;operator&gt; &lt;value&gt;;<\/strong>\n<\/p>\n\n\n\n<p>where <strong>&lt;table&gt;<\/strong> is the table where the records\nmust be deleted, <strong>&lt;field&gt;<\/strong> is the name of the field, <strong>&lt;operator&gt;<\/strong>\nchecks the equality, and <strong>&lt;value&gt;<\/strong> is the value to check for the\nfield. <\/p>\n\n\n\n<p>Another SQL function of interest is <strong>VIEW<\/strong> .\nA view is a stored query that looks like a table but is\nactually dynamically built when called to view. To\ncreate a view, we simply precede a <strong>SELECT statement<\/strong> with <strong>CREATE VIEW\nAS &lt;view_name&gt;<\/strong> and this will create a view named <strong>&lt;view_name&gt;<\/strong>\n&nbsp; . You can then process the new\nview as if it were a table. <\/p>\n\n\n\n<p>We will now turn to the following points: <\/p>\n\n\n\n<p><a href=\"https:\/\/translate.google.com\/translate?hl=fr&amp;prev=_t&amp;sl=fr&amp;tl=en&amp;u=http:\/\/www.sigterritoires.fr\/index.php\/creer-une-base-de-donnees-spatialite-avec-qgis-2-8\/\">Chapter\n1: Creating a spatial database Spatialite<\/a> &#8211; Creating a database, Importing\ndata from a shapefile <\/p>\n\n\n\n<p>Chapter\n2: Import Tabular (Non-Spatial) Data into a Database \nspatial\n&#8211; Import an Excel table, create geometry from XY fields, export data from\nSpatiaLite to shapefile. <\/p>\n\n\n\n<p><a href=\"https:\/\/translate.google.com\/translate?hl=fr&amp;prev=_t&amp;sl=fr&amp;tl=en&amp;u=http:\/\/www.sigterritoires.fr\/index.php\/la-gestion-des-tables-dune-base-de-donnees-spatialite-avec-qgis-2-8\/\">Chapter\n3: Managing Tables with SpatiaLite<\/a> &#8211; Create, Rename, Edit Properties,\nDelete, Empty &nbsp; a SpatiaLite table\n<\/p>\n\n\n\n<p><a href=\"https:\/\/translate.google.com\/translate?hl=fr&amp;prev=_t&amp;sl=fr&amp;tl=en&amp;u=http:\/\/www.sigterritoires.fr\/index.php\/requetes-et-vues-dune-base-spatialite-dans-qgis-2-8\/\">Chapter\n4: Creating Queries and Spatial Views<\/a> &#8211; Creating an SQL Query, Creating a\nSpatial View, Removing a Spatial View <\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial provides you with the necessary steps to manage databases in QGIS. Although QGIS can handle several types of databases, we used SpatiaLite because it provides a lot of features without the need for a&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"give_campaign_id":0,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"sfsi_plus_gutenberg_text_before_share":"","sfsi_plus_gutenberg_show_text_before_share":"","sfsi_plus_gutenberg_icon_type":"","sfsi_plus_gutenberg_icon_alignemt":"","sfsi_plus_gutenburg_max_per_row":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1260],"tags":[],"class_list":["post-8455","post","type-post","status-publish","format-standard","hentry","category-non-classe-en"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p6XU0A-2cn","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts\/8455","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/comments?post=8455"}],"version-history":[{"count":0,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts\/8455\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/media?parent=8455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/categories?post=8455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/tags?post=8455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}