3

I am looking to work with hosted GeoJSON data within QGIS. I have read a number of posts, such as add GeoJSON content in QGIS that shows very easily how to load GeoJSON into QGIS. I have had limited success with this process, however, for the most part I have not been able to consistently load hosted GeoJSON data into QGIS. I have tested with a few sources, including hosting my own data in Github with the same results (see the link below). I repeatedly get a not a valid data source error on load. My question, is there a standard for hosted GeoJSON data in order to load into QGIS, or are there settings that must be configured within QGIS?

https://github.com/ryangarnett/geodata/blob/master/locations.geojson

Ryan Garnett
  • 9,479
  • 8
  • 61
  • 106

1 Answers1

10

the problem is your link points to a web page on github, you need to link to the raw content. if you use curl on that url you'll see html content coming back.

if you click the 'raw' button on the Github page you'll get https://raw.githubusercontent.com/ryangarnett/geodata/master/locations.geojson

Just tried this in qgis 2.18.7, loading with the 'protocol'/'geojson' setting and it loads fine.

EDIT If it works at home but not at work, check with your IT people. It may be that they're using a proxy. Typically browsers get set up to work with a proxy, but they may not have done that for QGIS. You can set this up in Settings > Network > Use a proxy for web access. A quick way to check is to try opening the plugin manager in your work setting. If it fails to connect, it's probably a proxy issue. See this answer for suggested settings.

Steven Kay
  • 20,405
  • 5
  • 31
  • 82
  • Thanks for the info, but I cannot seem to replicate. I used the same URL and process. Only difference...QGIS 2.18.6 and potentially different encoding. I tried "system" and "ISO-8859-1" – Ryan Garnett Jun 05 '17 at 12:19
  • I also tried to verify with data from http://geojson.xyz/ ...unsuccessful using the direct url location – Ryan Garnett Jun 05 '17 at 12:27
  • 1
    i'd suggest using 'utf-8' as the encoding, that's the default in 2.18.7 and it works well for github raw links and direct links on geojson.xyz – Steven Kay Jun 05 '17 at 13:08
  • Thanks...still the same thing. Are there settings within QGIS that need to be altered? – Ryan Garnett Jun 05 '17 at 13:33
  • Update...I have been testing at work with no luck. I just tried at home and it works! Maybe a firewall setting? Will continue to test and share back...thanks! – Ryan Garnett Jun 05 '17 at 16:55