﻿{"id":3529,"date":"2016-09-01T07:47:21","date_gmt":"2016-09-01T06:47:21","guid":{"rendered":"http:\/\/www.sigterritoires.fr\/?p=3529"},"modified":"2016-09-01T07:49:00","modified_gmt":"2016-09-01T06:49:00","slug":"recettes-python-pour-qgis-inspecter-les-donnees-vecteur","status":"publish","type":"post","link":"https:\/\/www.sigterritoires.fr\/index.php\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\/","title":{"rendered":"Recettes Python pour QGis: inspecter les donn\u00e9es vecteur"},"content":{"rendered":"<p>Une fois une couche charg\u00e9e, on souhaite le plus souvent acc\u00e9der aux donn\u00e9es contenues dans la couche, soit les g\u00e9om\u00e9tries, soit les attributs. Nous verrons ici comment coder en Python l&rsquo;acc\u00e8s \u00e0 ces deux types de donn\u00e9es.<\/p>\n<p><!--more--><\/p>\n<h2>Acc\u00e9der \u00e0 la g\u00e9om\u00e9trie d&rsquo;une couche vecteur<\/h2>\n<p>Nous allons reprendre le script de chargement d&rsquo;un <a href=\"https:\/\/www.sigterritoires.fr\/index.php\/frshapefile-vs-geopackage-quel-format-choisir\/\">shapefile<\/a> cr\u00e9e pr\u00e9c\u00e9demment (charger_vecteur.py)<\/p>\n<div class='stb-container stb-style-grey'><div class='stb-caption'><div class='stb-logo'><img class='stb-logo__image' src='data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN\/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz\/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH\/w\/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGD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CA\/c\/v27b12uz3a2Nh4GtgHnAO8H7XQJL4okGsZSvkclyELhEnOsdgV8t9zZRH8vwpytZIgXCUU+cwgX\/7z4UuQL0H++UD+awDc\/MMFLMO8WgAAAABJRU5ErkJggg==' alt='img'\/><\/div><div class='stb-caption-content'><\/div><div class='stb-tool'><\/div><\/div><div class='stb-content'style='background-image:linear-gradient(to bottom, 8C8C8C 30%, #dddddd 90%);'># Customize this starter script by adding code<br \/>\n# to the run_script function. See the Help for<br \/>\n# complete information on how to create a script<br \/>\n# and use Script Runner.<\/p>\n<p>\u00ab\u00a0\u00a0\u00bb\u00a0\u00bb Your Description of the script goes here \u00ab\u00a0\u00a0\u00bb\u00a0\u00bb<\/p>\n<p># Some commonly used imports<\/p>\n<p>from PyQt4.QtCore import *<br \/>\nfrom PyQt4.QtGui import *<br \/>\nfrom qgis.core import *<br \/>\nfrom qgis.gui import *<\/p>\n<p>def run_script(iface):<br \/>\nqfd = QFileDialog()<br \/>\ntitle = &lsquo;Ouvrir un fichier&rsquo;<br \/>\npath = \u00ab\u00a0C:\/\u00a0\u00bb<br \/>\nf = QFileDialog.getOpenFileName(qfd, title, path)<br \/>\nlayer = QgsVectorLayer(f, \u00ab\u00a0Musees de la ville de New York\u00a0\u00bb, \u00ab\u00a0ogr\u00a0\u00bb)<br \/>\nif not layer.isValid():<br \/>\nprint \u00ab\u00a0erreur de chargement de la couche %s \u00a0\u00bb % layer.name()<br \/>\nQgsMapLayerRegistry.instance().addMapLayers([layer])<br \/>\n<\/div><\/div>\n<p>Remplacez la derni\u00e8re ligne<\/p>\n<p><em><strong>QgsMapLayerRegistry.instance().addMapLayers([layer])<\/strong><\/em><\/p>\n<p>par<\/p>\n<div class='stb-container stb-style-grey'><div class='stb-caption'><div class='stb-logo'><img class='stb-logo__image' src='data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3Ag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0pM9i4uZJeTy\/\/etcyTtW8z6KFd7KhqvL0unXrW+S9kp+3HSRdMa8Eisoe65Etrr5iauT3tJefRuXvxuVrARDzeDymdWvXOg1anbDg27fR7e6gpqaG225bxNGjx5g0cSrPrF4V3bRpY6fsUeHzhtYnVX6u2Fj42NrfM8TlG2YAo4GvARNXrVo1PJVMalrb2jSTJk0Rurs7EUWJ7du2uHfu2nkI2AjsAtzSVX705wX5JLArX0tXgfl47hlkOS\/Nzc0d0eV2Z40dNz6voCA\/c\/v27b12uz3a2Nh4GtgHnAO8H7XQJL4okGsZSvkclyELhEnOsdgV8t9zZRH8vwpytZIgXCUU+cwgX\/7z4UuQL0H++UD+awDc\/MMFLMO8WgAAAABJRU5ErkJggg==' alt='img'\/><\/div><div class='stb-caption-content'><\/div><div class='stb-tool'><\/div><\/div><div class='stb-content'style='background-image:linear-gradient(to bottom, 919191 30%, #dddddd 90%);'>features=layer.getFeatures()<br \/>\nfeat=features.next()<br \/>\ng=feat.geometry()<br \/>\nprint g.asPoint()<\/div><\/div>\n<p>On \u00e9vite de charger la couche dans QGis et on affiche dans la console Python les coordonn\u00e9es x et y du premier point de la couche.<\/p>\n<p>Le script doit ressembler \u00e0 \u00e7a:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv12.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3530\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\/pv12\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv12.png?fit=777%2C561&amp;ssl=1\" data-orig-size=\"777,561\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"pv12\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv12.png?fit=640%2C462&amp;ssl=1\" class=\"aligncenter size-full wp-image-3530\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv12.png?resize=640%2C462\" alt=\"pv12\" width=\"640\" height=\"462\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv12.png?w=777&amp;ssl=1 777w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv12.png?resize=300%2C217&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv12.png?resize=768%2C555&amp;ssl=1 768w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>La proc\u00e9dure est la suivante:<\/p>\n<p><em><strong>features=layer.getFeatures()<\/strong><\/em><\/p>\n<p>Cr\u00e9e un pointeur nomm\u00e9 <em><strong>features<\/strong> <\/em>sur la couche <em><strong>layer<\/strong><\/em><\/p>\n<p><em><strong> feat=features.next()<\/strong><\/em><\/p>\n<p>On d\u00e9place le curseur sur l&rsquo;entit\u00e9 suivante, ici c&rsquo;est la premi\u00e8re entit\u00e9 de la table et on charge cette entit\u00e9 dans l&rsquo;objet <em><strong>feat<\/strong><\/em>.<\/p>\n<p><em><strong> g=feat.geometry()<\/strong><\/em><\/p>\n<p>Charge la g\u00e9om\u00e9trie de l&rsquo;entit\u00e9 courante du curseur dans l&rsquo;objet <em><strong>g<\/strong><\/em>.<\/p>\n<p>Une fois ex\u00e9cut\u00e9, on obtient le r\u00e9sultat dans la console Python:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv13.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3531\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\/pv13\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv13.png?fit=786%2C161&amp;ssl=1\" data-orig-size=\"786,161\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"pv13\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv13.png?fit=640%2C131&amp;ssl=1\" class=\"aligncenter size-full wp-image-3531\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv13.png?resize=640%2C131\" alt=\"pv13\" width=\"640\" height=\"131\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv13.png?w=786&amp;ssl=1 786w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv13.png?resize=300%2C61&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv13.png?resize=768%2C157&amp;ssl=1 768w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><strong>NOTES:<\/strong><\/p>\n<p>On pourrait acc\u00e9der par d&rsquo;autres moyens \u00e0 la g\u00e9om\u00e9trie d&rsquo;une entit\u00e9, mais l&rsquo;utilisation des pointeurs dans Python permet de travailler sur des volumes de donn\u00e9es tr\u00e8s importants sans charger toute la table en m\u00e9moire.<\/p>\n<p>Ici on a charg\u00e9 un fichier shapefile, mais quelle qu&rsquo;elle soit la source de donn\u00e9es, une fois cr\u00e9\u00e9e la couche (layer) le code Python ne change pas.<\/p>\n<h2>Acc\u00e9der aux attributs\u00a0 d&rsquo;une couche vecteur<\/h2>\n<p>Pour acc\u00e9der aux attributs non g\u00e9om\u00e9triques des entit\u00e9s, nous allons modifier le script pr\u00e9c\u00e9dent<\/p>\n<p>Remplacez les deux derni\u00e8res lignes<\/p>\n<p><em><strong>g=feat.geometry()<\/strong><\/em><br \/>\n<em><strong>\u00a0 print g.asPoint()<\/strong><\/em><\/p>\n<p>par<\/p>\n<p><em><strong>print feat.attributes()<\/strong><\/em><\/p>\n<p>Le script doit ressembler \u00e0 \u00e7a:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv14.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3533\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\/pv14\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv14.png?fit=767%2C546&amp;ssl=1\" data-orig-size=\"767,546\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"pv14\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv14.png?fit=640%2C456&amp;ssl=1\" class=\"aligncenter size-full wp-image-3533\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv14.png?resize=640%2C456\" alt=\"pv14\" width=\"640\" height=\"456\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv14.png?w=767&amp;ssl=1 767w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv14.png?resize=300%2C214&amp;ssl=1 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>Et son ex\u00e9cution donne le r\u00e9sultat suivant dans la console Python:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv15.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3534\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\/pv15\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv15.png?fit=768%2C186&amp;ssl=1\" data-orig-size=\"768,186\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"pv15\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv15.png?fit=640%2C155&amp;ssl=1\" class=\"aligncenter size-full wp-image-3534\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv15.png?resize=640%2C155\" alt=\"pv15\" width=\"640\" height=\"155\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv15.png?w=768&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv15.png?resize=300%2C73&amp;ssl=1 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>On obtient bien une liste Python avec l&rsquo;ensemble des attributs de la premi\u00e8re entit\u00e9 de la table.<\/p>\n<p>Cette information est g\u00e9n\u00e9ralement reli\u00e9e aux noms des champs de la table. Pour obtenir la liste des noms des champs, remplacez dans le script pr\u00e9c\u00e9dent la ligne<\/p>\n<p><em><strong>print feat.attributes()<\/strong><\/em><\/p>\n<p>par<\/p>\n<p><em><strong>print [c.name() for c in feat.fields().toList()]<\/strong><\/em><\/p>\n<p>Le script doit ressembler \u00e0 \u00e7a:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv16.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3535\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\/pv16\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv16.png?fit=762%2C519&amp;ssl=1\" data-orig-size=\"762,519\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"pv16\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv16.png?fit=640%2C436&amp;ssl=1\" class=\"aligncenter size-full wp-image-3535\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv16.png?resize=640%2C436\" alt=\"pv16\" width=\"640\" height=\"436\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv16.png?w=762&amp;ssl=1 762w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv16.png?resize=300%2C204&amp;ssl=1 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>Et son ex\u00e9cution donne le r\u00e9sultat suivant dans la console Python<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv17.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3536\" data-permalink=\"https:\/\/www.sigterritoires.fr\/index.php\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\/pv17\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv17.png?fit=766%2C175&amp;ssl=1\" data-orig-size=\"766,175\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"pv17\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv17.png?fit=640%2C146&amp;ssl=1\" class=\"aligncenter size-full wp-image-3536\" src=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv17.png?resize=640%2C146\" alt=\"pv17\" width=\"640\" height=\"146\" srcset=\"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv17.png?w=766&amp;ssl=1 766w, https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv17.png?resize=300%2C69&amp;ssl=1 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Une fois une couche charg\u00e9e, on souhaite le plus souvent acc\u00e9der aux donn\u00e9es contenues dans la couche, soit les g\u00e9om\u00e9tries, soit les attributs. Nous verrons ici comment coder en Python l&rsquo;acc\u00e8s \u00e0 ces deux types de&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_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_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[222,62],"tags":[342,232,131,58,223,21],"class_list":["post-3529","post","type-post","status-publish","format-standard","hentry","category-python","category-qgis-2","tag-atribut","tag-geometrie","tag-python","tag-qgis","tag-script","tag-vecteur"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.9 - aioseo.com -->\n\t<meta name=\"description\" content=\"Une fois une couche charg\u00e9e, on souhaite le plus souvent acc\u00e9der aux donn\u00e9es contenues dans la couche, soit les g\u00e9om\u00e9tries, soit les attributs. Nous verrons ici comment coder en Python l&#039;acc\u00e8s \u00e0 ces deux types de donn\u00e9es.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Atilio Francois\"\/>\n\t<meta name=\"google-site-verification\" content=\"ByXHZUbGNn7RNv-Xk5A-ysTZrM65VLIO2RxfSJ2nIEQ\" \/>\n\t<meta name=\"keywords\" content=\"qgis,python,script,vecteur,attribut,g\u00e9om\u00e9trie,atribut\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.sigterritoires.fr\/index.php\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.9\" \/>\n\t\t<meta property=\"og:locale\" content=\"fr_FR\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Blog SIG &amp; Territoires | le portail des professionnels du SIG\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Recettes Python pour QGis: inspecter les donn\u00e9es vecteur | Blog SIG &amp; Territoires\" \/>\n\t\t<meta property=\"og:description\" content=\"Une fois une couche charg\u00e9e, on souhaite le plus souvent acc\u00e9der aux donn\u00e9es contenues dans la couche, soit les g\u00e9om\u00e9tries, soit les attributs. Nous verrons ici comment coder en Python l&#039;acc\u00e8s \u00e0 ces deux types de donn\u00e9es.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.sigterritoires.fr\/index.php\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2016-09-01T06:47:21+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2016-09-01T06:49:00+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/atilio.francois\/\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@SigTerritoires\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Recettes Python pour QGis: inspecter les donn\u00e9es vecteur | Blog SIG &amp; Territoires\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Une fois une couche charg\u00e9e, on souhaite le plus souvent acc\u00e9der aux donn\u00e9es contenues dans la couche, soit les g\u00e9om\u00e9tries, soit les attributs. Nous verrons ici comment coder en Python l&#039;acc\u00e8s \u00e0 ces deux types de donn\u00e9es.\" \/>\n\t\t<meta name=\"twitter:creator\" content=\"@SigTerritoires\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\\\/#article\",\"name\":\"Recettes Python pour QGis: inspecter les donn\\u00e9es vecteur | Blog SIG & Territoires\",\"headline\":\"Recettes Python pour QGis: inspecter les donn\\u00e9es vecteur\",\"author\":{\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/author\\\/admin\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.sigterritoires.fr\\\/wp-content\\\/uploads\\\/2016\\\/08\\\/pv12.png?fit=777%2C561&ssl=1\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\\\/#articleImage\",\"width\":777,\"height\":561},\"datePublished\":\"2016-09-01T07:47:21+02:00\",\"dateModified\":\"2016-09-01T07:49:00+02:00\",\"inLanguage\":\"fr-FR\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\\\/#webpage\"},\"articleSection\":\"Python, QGis, atribut, g\\u00e9om\\u00e9trie, python, qgis, script, vecteur, Fran\\u00e7ais\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.sigterritoires.fr\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/category\\\/outils-et-methodes\\\/#listItem\",\"name\":\"Outils et m\\u00e9thodes\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/category\\\/outils-et-methodes\\\/#listItem\",\"position\":2,\"name\":\"Outils et m\\u00e9thodes\",\"item\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/category\\\/outils-et-methodes\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/category\\\/outils-et-methodes\\\/python\\\/#listItem\",\"name\":\"Python\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/category\\\/outils-et-methodes\\\/python\\\/#listItem\",\"position\":3,\"name\":\"Python\",\"item\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/category\\\/outils-et-methodes\\\/python\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\\\/#listItem\",\"name\":\"Recettes Python pour QGis: inspecter les donn\\u00e9es vecteur\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/category\\\/outils-et-methodes\\\/#listItem\",\"name\":\"Outils et m\\u00e9thodes\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\\\/#listItem\",\"position\":4,\"name\":\"Recettes Python pour QGis: inspecter les donn\\u00e9es vecteur\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/category\\\/outils-et-methodes\\\/python\\\/#listItem\",\"name\":\"Python\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/#person\",\"name\":\"Atilio Francois\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\\\/#personImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f76dc2a720162999bce81d6c99b6d7b9517d6600ad7ceb5ed5268f02cefaa0ee?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Atilio Francois\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/author\\\/admin\\\/#author\",\"url\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/author\\\/admin\\\/\",\"name\":\"Atilio Francois\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f76dc2a720162999bce81d6c99b6d7b9517d6600ad7ceb5ed5268f02cefaa0ee?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Atilio Francois\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\\\/#webpage\",\"url\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\\\/\",\"name\":\"Recettes Python pour QGis: inspecter les donn\\u00e9es vecteur | Blog SIG & Territoires\",\"description\":\"Une fois une couche charg\\u00e9e, on souhaite le plus souvent acc\\u00e9der aux donn\\u00e9es contenues dans la couche, soit les g\\u00e9om\\u00e9tries, soit les attributs. Nous verrons ici comment coder en Python l'acc\\u00e8s \\u00e0 ces deux types de donn\\u00e9es.\",\"inLanguage\":\"fr-FR\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/author\\\/admin\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/index.php\\\/author\\\/admin\\\/#author\"},\"datePublished\":\"2016-09-01T07:47:21+02:00\",\"dateModified\":\"2016-09-01T07:49:00+02:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/#website\",\"url\":\"https:\\\/\\\/www.sigterritoires.fr\\\/\",\"name\":\"Blog SIG & Territoires\",\"description\":\"le portail des professionnels du SIG\",\"inLanguage\":\"fr-FR\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.sigterritoires.fr\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Recettes Python pour QGis: inspecter les donn\u00e9es vecteur | Blog SIG & Territoires","description":"Une fois une couche charg\u00e9e, on souhaite le plus souvent acc\u00e9der aux donn\u00e9es contenues dans la couche, soit les g\u00e9om\u00e9tries, soit les attributs. Nous verrons ici comment coder en Python l'acc\u00e8s \u00e0 ces deux types de donn\u00e9es.","canonical_url":"https:\/\/www.sigterritoires.fr\/index.php\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\/","robots":"max-image-preview:large","keywords":"qgis,python,script,vecteur,attribut,g\u00e9om\u00e9trie,atribut","webmasterTools":{"google-site-verification":"ByXHZUbGNn7RNv-Xk5A-ysTZrM65VLIO2RxfSJ2nIEQ","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.sigterritoires.fr\/index.php\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\/#article","name":"Recettes Python pour QGis: inspecter les donn\u00e9es vecteur | Blog SIG & Territoires","headline":"Recettes Python pour QGis: inspecter les donn\u00e9es vecteur","author":{"@id":"https:\/\/www.sigterritoires.fr\/index.php\/author\/admin\/#author"},"publisher":{"@id":"https:\/\/www.sigterritoires.fr\/#person"},"image":{"@type":"ImageObject","url":"https:\/\/i0.wp.com\/www.sigterritoires.fr\/wp-content\/uploads\/2016\/08\/pv12.png?fit=777%2C561&ssl=1","@id":"https:\/\/www.sigterritoires.fr\/index.php\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\/#articleImage","width":777,"height":561},"datePublished":"2016-09-01T07:47:21+02:00","dateModified":"2016-09-01T07:49:00+02:00","inLanguage":"fr-FR","mainEntityOfPage":{"@id":"https:\/\/www.sigterritoires.fr\/index.php\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\/#webpage"},"isPartOf":{"@id":"https:\/\/www.sigterritoires.fr\/index.php\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\/#webpage"},"articleSection":"Python, QGis, atribut, g\u00e9om\u00e9trie, python, qgis, script, vecteur, Fran\u00e7ais"},{"@type":"BreadcrumbList","@id":"https:\/\/www.sigterritoires.fr\/index.php\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.sigterritoires.fr#listItem","position":1,"name":"Home","item":"https:\/\/www.sigterritoires.fr","nextItem":{"@type":"ListItem","@id":"https:\/\/www.sigterritoires.fr\/index.php\/category\/outils-et-methodes\/#listItem","name":"Outils et m\u00e9thodes"}},{"@type":"ListItem","@id":"https:\/\/www.sigterritoires.fr\/index.php\/category\/outils-et-methodes\/#listItem","position":2,"name":"Outils et m\u00e9thodes","item":"https:\/\/www.sigterritoires.fr\/index.php\/category\/outils-et-methodes\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.sigterritoires.fr\/index.php\/category\/outils-et-methodes\/python\/#listItem","name":"Python"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.sigterritoires.fr#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.sigterritoires.fr\/index.php\/category\/outils-et-methodes\/python\/#listItem","position":3,"name":"Python","item":"https:\/\/www.sigterritoires.fr\/index.php\/category\/outils-et-methodes\/python\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.sigterritoires.fr\/index.php\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\/#listItem","name":"Recettes Python pour QGis: inspecter les donn\u00e9es vecteur"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.sigterritoires.fr\/index.php\/category\/outils-et-methodes\/#listItem","name":"Outils et m\u00e9thodes"}},{"@type":"ListItem","@id":"https:\/\/www.sigterritoires.fr\/index.php\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\/#listItem","position":4,"name":"Recettes Python pour QGis: inspecter les donn\u00e9es vecteur","previousItem":{"@type":"ListItem","@id":"https:\/\/www.sigterritoires.fr\/index.php\/category\/outils-et-methodes\/python\/#listItem","name":"Python"}}]},{"@type":"Person","@id":"https:\/\/www.sigterritoires.fr\/#person","name":"Atilio Francois","image":{"@type":"ImageObject","@id":"https:\/\/www.sigterritoires.fr\/index.php\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\/#personImage","url":"https:\/\/secure.gravatar.com\/avatar\/f76dc2a720162999bce81d6c99b6d7b9517d6600ad7ceb5ed5268f02cefaa0ee?s=96&d=mm&r=g","width":96,"height":96,"caption":"Atilio Francois"}},{"@type":"Person","@id":"https:\/\/www.sigterritoires.fr\/index.php\/author\/admin\/#author","url":"https:\/\/www.sigterritoires.fr\/index.php\/author\/admin\/","name":"Atilio Francois","image":{"@type":"ImageObject","@id":"https:\/\/www.sigterritoires.fr\/index.php\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/f76dc2a720162999bce81d6c99b6d7b9517d6600ad7ceb5ed5268f02cefaa0ee?s=96&d=mm&r=g","width":96,"height":96,"caption":"Atilio Francois"}},{"@type":"WebPage","@id":"https:\/\/www.sigterritoires.fr\/index.php\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\/#webpage","url":"https:\/\/www.sigterritoires.fr\/index.php\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\/","name":"Recettes Python pour QGis: inspecter les donn\u00e9es vecteur | Blog SIG & Territoires","description":"Une fois une couche charg\u00e9e, on souhaite le plus souvent acc\u00e9der aux donn\u00e9es contenues dans la couche, soit les g\u00e9om\u00e9tries, soit les attributs. Nous verrons ici comment coder en Python l'acc\u00e8s \u00e0 ces deux types de donn\u00e9es.","inLanguage":"fr-FR","isPartOf":{"@id":"https:\/\/www.sigterritoires.fr\/#website"},"breadcrumb":{"@id":"https:\/\/www.sigterritoires.fr\/index.php\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\/#breadcrumblist"},"author":{"@id":"https:\/\/www.sigterritoires.fr\/index.php\/author\/admin\/#author"},"creator":{"@id":"https:\/\/www.sigterritoires.fr\/index.php\/author\/admin\/#author"},"datePublished":"2016-09-01T07:47:21+02:00","dateModified":"2016-09-01T07:49:00+02:00"},{"@type":"WebSite","@id":"https:\/\/www.sigterritoires.fr\/#website","url":"https:\/\/www.sigterritoires.fr\/","name":"Blog SIG & Territoires","description":"le portail des professionnels du SIG","inLanguage":"fr-FR","publisher":{"@id":"https:\/\/www.sigterritoires.fr\/#person"}}]},"og:locale":"fr_FR","og:site_name":"Blog SIG &amp; Territoires | le portail des professionnels du SIG","og:type":"article","og:title":"Recettes Python pour QGis: inspecter les donn\u00e9es vecteur | Blog SIG &amp; Territoires","og:description":"Une fois une couche charg\u00e9e, on souhaite le plus souvent acc\u00e9der aux donn\u00e9es contenues dans la couche, soit les g\u00e9om\u00e9tries, soit les attributs. Nous verrons ici comment coder en Python l'acc\u00e8s \u00e0 ces deux types de donn\u00e9es.","og:url":"https:\/\/www.sigterritoires.fr\/index.php\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\/","article:published_time":"2016-09-01T06:47:21+00:00","article:modified_time":"2016-09-01T06:49:00+00:00","article:publisher":"https:\/\/www.facebook.com\/atilio.francois\/","twitter:card":"summary","twitter:site":"@SigTerritoires","twitter:title":"Recettes Python pour QGis: inspecter les donn\u00e9es vecteur | Blog SIG &amp; Territoires","twitter:description":"Une fois une couche charg\u00e9e, on souhaite le plus souvent acc\u00e9der aux donn\u00e9es contenues dans la couche, soit les g\u00e9om\u00e9tries, soit les attributs. Nous verrons ici comment coder en Python l'acc\u00e8s \u00e0 ces deux types de donn\u00e9es.","twitter:creator":"@SigTerritoires"},"aioseo_meta_data":{"post_id":"3529","title":"Recettes Python pour QGis: inspecter les donn\u00e9es vecteur | #site_title","description":"Une fois une couche charg\u00e9e, on souhaite le plus souvent acc\u00e9der aux donn\u00e9es contenues dans la couche, soit les g\u00e9om\u00e9tries, soit les attributs. Nous verrons ici comment coder en Python l'acc\u00e8s \u00e0 ces deux types de donn\u00e9es.","keywords":[{"label":"qgis","value":"qgis"},{"label":"python","value":"python"},{"label":"script","value":"script"},{"label":"vecteur","value":"vecteur"},{"label":"attribut","value":"attribut"},{"label":"g\u00e9om\u00e9trie","value":"g\u00e9om\u00e9trie"}],"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2020-12-21 13:58:33","updated":"2025-06-04 16:26:24","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.sigterritoires.fr\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.sigterritoires.fr\/index.php\/category\/outils-et-methodes\/\" title=\"Outils et m\u00e9thodes\">Outils et m\u00e9thodes<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.sigterritoires.fr\/index.php\/category\/outils-et-methodes\/python\/\" title=\"Python\">Python<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tRecettes Python pour QGis: inspecter les donn\u00e9es vecteur\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.sigterritoires.fr"},{"label":"Outils et m\u00e9thodes","link":"https:\/\/www.sigterritoires.fr\/index.php\/category\/outils-et-methodes\/"},{"label":"Python","link":"https:\/\/www.sigterritoires.fr\/index.php\/category\/outils-et-methodes\/python\/"},{"label":"Recettes Python pour QGis: inspecter les donn\u00e9es vecteur","link":"https:\/\/www.sigterritoires.fr\/index.php\/recettes-python-pour-qgis-inspecter-les-donnees-vecteur\/"}],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p6XU0A-UV","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts\/3529","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=3529"}],"version-history":[{"count":0,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/posts\/3529\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/media?parent=3529"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/categories?post=3529"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sigterritoires.fr\/index.php\/wp-json\/wp\/v2\/tags?post=3529"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}