====== Cours GéoInf :: Edition 2017 ====== Bienvenue sur le portail de cours **GéoInformation & Open Webmapping** * Enseignants : J. Cela Lopez, O. Ertz, S. Oulevay, D. Rappo * Salle de cours : HEIG-VD, St-Roch, T155 * Horaire : [[http://comem.ch/horaire/afficher_horaire.asp?classe=&inter=&module=&module2=&cours=G%E9oinf%7ECC3174&cours2=G%E9oinf%7ECC3174&date1=15.11.2017&date2=|http://www.comem.ch/horaire]] ===== Evaluation ===== * Partie 1 (travail individuel) : [[geoinf17:exa1|exercices]] / [[geoinf17:exa1bis|rattrapage]] * Partie 2 (travail en groupe) : [[geoinf17:exa2|projet]] ===== Cours ===== ==== Plan ==== Après une première partie découverte de la dimension géospatiale de l'information et conception cartographique (cartographic design) avec QGIS, une suite plus orientée au coeur de la technologie : - Outil desktop QGIS et son API avec Python - Base de données SQL géospatiale avec PostGIS - Services géographiques/cartographiques avec GeoServer/CartoDB - Interface cartographique avec OpenLayers - Découvertes : - NoSQL spatial avec MongoDB - Géoinformation et réalité augmenté avec Wikitude :!: **Participez : vers une [[geoinf17:stateoftheart|bibliographie partagée]] sur tous ces sujets ...** ==== QGIS API & plugins ==== * Tutoriel (auteure Sarah Composto / HEIG-VD / INSIT) - {{:geoinf17:qgis_plugins.pdf|}} * ça peut aider : * si la commande pyrcc4 n'est pas installlée, voici le fichier Python généré - {{:geoinf17:resources.zip|}} (à désarchiver) * si QtDesigner n'est pas installé, il s'installe avec QtCreator - https://www.qt.io/qt-features-libraries-apis-tools-and-ide/#tools ==== Spatial database ==== Mise en place de PostgreSQL/PostGIS avec le service de cloud PaaS Heroku : * Déployer une app Heroku avec PHP et PostgreSQL - Getting Started on Heroku with PHP https://devcenter.heroku.com/articles/getting-started-with-php#introduction * Accéder au tableau de bord Heroku Data - https://data.heroku.com * Choisir une interface PostreSQL * avec l'application pgAdmin3 - https://www.pgadmin.org/ * avec psql dans un shell interactif ([[https://devcenter.heroku.com/articles/getting-started-with-php#start-an-interactive-shell|bash]]) : * dans le dossier local de votre app heroku, lancer heroku run bash * après connexion, à l'invite de commande bash, lancer psql -U #heroku_dbuser# -h #heroku_dbhost.amazonaws.com# -d #dbname# * à l'invite de commande psql, saisir une commande select postgis_version(); # for informations about installed PostGIS \h # for help with SQL commands \? # for help with psql commands * Ajouter l'extension PostGIS à la base - https://devcenter.heroku.com/articles/heroku-postgres-extensions-postgis-full-text-search#postgis * exécuter simplement la commande SQL ci-dessous create extension postgis * voyez l'apparition de nouvelles tables et vues (commande psql \d) Exercices pratiques : - **[[geoinf15:postgis0|Premières commandes SQL avec PostGIS]]** - **[[geoinf15:postgis1|Quelques questions plus intéressantes]]** - **[[geoinf17:geoservice0|Sous forme d'un service de géodonnées]]** - [[ogo11:gql:exo2|Et bien d'autres opérateurs ...]] Avec un "cloud cartographique" : * [[geoinf16:sqlcartodb|SQL Spatial avec CartoDB]] ==== Geospatial web ==== A convergence story ({{:geoinf15:openwebmapping-intro.pdf|Intro slides}}) - [[http://142.207.145.31/index.php/acme/article/view/1237/1032|Hacker Cartography]]: Crowdsourced Geography, OpenStreetMap, and the Hacker Political Imaginary (McConchie 2015) * Publier des géodonnées avec des services standardisés grâce à GeoServer * Installation sur Heroku en 20 minutes : * Télécharger/désarchiver geoserver-2.12.0-war.zip (au choix depuis [[http://sourceforge.net/projects/geoserver/files/GeoServer/2.12.1/geoserver-2.12.1-war.zip|sourceforge.net]], [[https://drive.switch.ch/index.php/s/Pvhls2YUiezJYi7|drive.switch.ch]]) * Ouvrir une invite de commande dans le dossier contenant le fichier geoserver.war * Se connecter à heroku, créer une nouvelle app heroku, puis y déployer GeoServer (inspiré de [[https://devcenter.heroku.com/articles/war-deployment#deployment-with-the-heroku-cli|cette documentation]]) heroku login heroku create heroku plugins:install heroku-cli-deploy heroku war:deploy geoserver.war --app * Naviguer sur votre app et se connecter à GeoServer (admin/geoserver) * https://young-springs-76494.herokuapp.com/web/ * Publier la géotable my4capitals * Add new workspace: geoinf / http://mediamaps.ch/geoinf * Stores -> Add new store: fournir les credentials d'accès à la BD PostGIS * (new layer) -> Publish: sur my4capitals * configurer les "bounding boxes" * Layer Preview: prévisualisation du géoservice (avec le [[http://docs.geoserver.org/latest/en/user/services/wfs/reference.html#operations|géoservice standardisé OGC WFS - Web Feature Service]]) * Ci-dessous les 3 indispensables opérations d'un **géoservice de données** (utiliser un [[https://www.freeformatter.com/url-parser-query-string-splitter.html|Query String Splitter]] pour y voir plus clair) | [[http://geoteach.heig-vd.ch:8080/geoserver/geoinfo/ows?service=WFS&version=1.0.0&request=GetCapabilities|WFS:GetCapabilities]] | ''service=WFS&version=1.0.0&request=GetCapabilities'' | | [[http://geoteach.heig-vd.ch:8080/geoserver/geoinfo/ows?service=WFS&version=1.0.0&request=DescribeFeatureType&typeName=geoinfo:cities|WFS:DescribeFeatureType]] | ''service=WFS&version=1.0.0&request=DescribeFeatureType&typeName=geoinfo:cities'' | | [[http://geoteach.heig-vd.ch:8080/geoserver/geoinfo/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=geoinfo:cities&maxFeatures=50&outputFormat=application%2Fjson|WFS:GetFeature]] | ''service=WFS&version=1.0.0&request=GetFeature&typeName=geoinfo:cities&maxFeatures=50&outputFormat=application/json'' | * En résumé : * Geoserver est "conçu pour l'interopérabilité, il publie les données de toutes les sources principales de données spatiales utilisant des normes ouvertes" (//wikipedia//) ... de l'[[http://www.opengeospatial.org/docs/is|OGC]] (Open Geospatial Consortium) * What is (not) interoperability? - https://drive.switch.ch/index.php/s/3s1as53UkjJJyn3 (CCG 2017) ==== QGIS MapRenderer ==== * Utilisation du **moteur de rendu cartographique** [[geoinf15:qgsmaprenderer|QgsMapRenderer]] et compréhension du "portrayal model" {{:ogo13:portrayalogc.png?linkonly|}} * Vers un langage cartographique commun avec les standards OGC SLD/SE ? * A redesign of OGC Symbology Encoding standard for sharing cartography - https://peerj.com/preprints/2415/ ==== Open Webmapping ==== * Des géoservices standardisés pour la cartographie en ligne [[http://www.opengeospatial.org/docs/is|OGC]] (Open Geospatial Consortium) * Ci-dessous les 3 indispensables opérations d'un **géoservice de cartographie** (utiliser un [[https://www.freeformatter.com/url-parser-query-string-splitter.html|Query String Splitter]] pour y voir plus clair) | [[http://demo.boundlessgeo.com/geoserver/wms?service=WMS&version=1.1.0&request=GetCapabilities|WMS:GetCapabilities]] | ''service=WMS&version=1.1.0&request=GetCapabilities'' | | [[http://demo.boundlessgeo.com/geoserver/wms? service=WMS&version=1.1.0&request=GetMap&layers=ne_10m_admin_0_countries&styles=&bbox=-180,-90,180,90&width=800&height=400&srs=EPSG:4326&format=image/png|WMS:GetMap]] | ''service=WMS&version=1.1.0&request=GetMap&layers=ne_10m_admin_0_countries&styles=&bbox=-180,-90,180,90&width=800&height=400&srs=EPSG:4326&format=image/png'' | | [[http://demo.boundlessgeo.com/geoserver/wms?service=WMS&version=1.1.0&request=GetFeatureInfo&bbox=-22.5,28.75,22.5,51.25&srs=EPSG:4326&height=400&width=800&layers=ne_10m_admin_0_countries&format=image/png&styles=&query_layers=ne_10m_admin_0_countries&x=517&y=80&feature_count=50&info_format=application/json|WMS:GetFeatureInfo]] | ''service=WMS&version=1.1.0&request=GetFeatureInfo&bbox=-22.5,28.75,22.5,51.25&srs=EPSG:4326&height=400&width=800&layers=ne_10m_admin_0_countries&format=image/png&styles=&query_layers=ne_10m_admin_0_countries&x=517&y=80&feature_count=50&info_format=application/json'' | * Sharing cartography: Open standards for cartographic portrayal interoperability * https://drive.switch.ch/index.php/s/3s1as53UkjJJyn3 (CCG 2017) * "Sharing cartography" - les 4 niveaux d'utilisation qui nécessitent une intéropérabilité des représentations cartographiques * Avec GeoServer ... publier la couche world_simple à partir d'une géotable dans la base PostGIS (utiliser ce script SQL - https://drive.switch.ch/index.php/s/23PlCBsdRrgkigd). * Analyser les paramètres WMS au regard du "portrayal model" * Simuler "à la main" une navigation cartographique (zoom sur l'Europe, la Suisse au centre, Lat: 47 / Lon: 10) === OpenLayers === * [[geoinf17:ol3tuto|Workshop OpenLayers v3 (part 1)]] : navigation, composition, style image, couche vector, style vector * [[geoinf17:ol3tuto2|Workshop OpenLayers v3 (part 2)]] : interrogation de couche et autres interactions ==== Geospatial AR Lab ==== * Before we start the lesson (07.12.2017), we ask you to arrive with all the requirements ready: * {{:geoinf17:arlab-installrequirements.pdf|follow these instructions}} (it takes a while) * Ready? Let's start and download: {{:geoinf17:geospatialarlab-utils.zip|}} ===== Opportunité CCG ===== Certificat Complémentaire en Géomatique, University of Geneva - Institute for Environmental Sciences/EnviroSPACE Lab : * se libérer du 12 au 15 février 2018 -> semaine 7 (= interruption de cours) * s'inscrire comme auditeur libre (droits d'entrée 50CHF) * recevoir une attestation de suivi du cours (mais pas d'équivalence de crédit) * un syllabus de la même veine que l'année passée, cf {{:geoinf17:geotools_sdi_programme_2017.pdf|programme 2017}}