Other articles

  1. Add GeoJSON content in QGIS: short recipes

    Add simply GeoJSON dataset from QGIS

    Recipe 1: add QGIS built-in data

    You can reuse the QGIS contributors map dataset directly from QGIS without any downloading using PyQGIS. It's a GeoJSON file available within your installed program.

    Just run in QGIS Python console the following

    import os
    from qgis.core import QgsApplication
    geojson_contributors = os.path.join(
    print geojson_contributors
    iface.addVectorLayer(geojson_contributors, 'QGIS contributors', 'ogr')

    Recipe 2: add remote GeoJSON

    This is quite handy to get the remote data. You need to be aware that it's a good solution when remote content change or for demo. However, it's not always a good idea for production where your data can stop being available.

    • Try to do it by going to the website geojson.xyz to get an URL data source.

    The data are coming from Natural Earth Data, the main advantage here is the fact GeoJSON file are delivered via a CDN (Content Delivery Network) whose goal is according to Wikipedia definition

    to serve content to end-users with high availability and high performance

    • Choose a layer source
    • Copy it URL

    Now, you've got an URL to a remote GeoJSON, you can add the GeoJSON from the UI or via PyQGIS.

    From the GUI

    The following screencast illustrates the way to add remote GeoJSON from GUI

    Add remote GeoJSON from QGIS

    You can't choose the layer name when you load the data source: it's the default one.

    From the QGIS Python console

    The solution throught the QGIS Python console is just this one liner. You just need to change the URL.

    iface.addVectorLayer('https://d2ad6b4ur7yvpq.cloudfront.net/naturalearth-3.3.0/ne_50m_populated_places.geojson', 'Populated places', 'ogr')
    read more
  2. Ajout de services CSW pour chercher des données depuis QGIS

    Même si on peut passer par des sites web pour rechercher des données, il devient de plus en plus facile de les rechercher directement depuis QGIS. On peut s'appuyer sur le format CSW pour cela.

    Nous ne rentrerons pas dans les détails du fonctionnement du standard CSW en lui-même mais simplement sur comment nous avons récupéré une liste de serveurs CSW pour la France que vous pouvez réutiliser, adapter à vos besoins.
    Read more

    read more
  3. Create QGIS curves from Python API

    This article was inspired by the question by a discussion about new QGIS geometries due to the publication of a diagram about main QGIS Python classes.

    We choose to demonstrate how you can build a curve with three points using the new QGIS geometry API.

    QGIS curve demo
    read more
  4. Edit GeoJSON without QGIS native support

    This article was inspired by the question below on Twitter from Nathaniel V. KELSO, the main guy behind "Natural Earth Data" ;) (Thanks for your work!)

    We choose to demonstrate a way to make GeoJSON content editable possible via a workaround.
    Read more

    read more
  5. Python geocoders clients comparison

    In Python ecosystem, there are few libraries for call calling geocoding web services. Sometimes, directly using raw Python instead can be faster.

    Until recently, GeoPy was the library for the job but we recently found a new project called Geocoder and where wondering why it seems to do the same job. We didn't really found a clue but choose instead to compare both solutions.

    Let's see how they differ.
    Read more

    read more

Page 1 / 1