[Qgis-user] Http access to json return

Yoichi Kayama yoichi.kayama at gmail.com
Wed Jun 24 16:42:24 PDT 2020


I tried GeoJSON. I was able to use it as a layer in QGIS by inputting the
URL that returns geojson in the menu Layer -> Data source manager -> Vector
-> Source type file .I put the URL in the column to enter the file path.

2020年6月24日(水) 20:55 Alessandro Pasotti <apasotti at gmail.com>:

>
> You can have a look to
> https://qgis.org/pyqgis/3.2/core/File/QgsFileDownloader.html , store the
> contents to a temporary file and then load it.
>
> ... or also
> https://qgis.org/pyqgis/3.2/core/Network/QgsNetworkContentFetcher.html?highlight=fetcher#module-QgsNetworkContentFetcher
>
> Both classes handle QGIS authentication configurations and proxies, OAuth2
> is also supported by both.
>
>
>
> On Wed, Jun 24, 2020 at 1:37 PM Karl Magnus Jönsson <
> Karl-Magnus.Jonsson at kristianstad.se> wrote:
>
>> Hi!
>>
>> I’m also interested this functionality. Need to use OAuht2 authentication
>> but that seems not to be available. Guess there is just an solution
>> programmatically then.
>>
>>
>>
>> *Karl-Magnus*
>>
>>
>>
>> *Från:* Qgis-user <qgis-user-bounces at lists.osgeo.org> *För *Ben Hur
>> Pintor
>> *Skickat:* den 24 juni 2020 10:23
>> *Till:* Steve Sgalowski <steve.sgalowski at gmail.com>
>> *Kopia:* QGIS User <Qgis-user at lists.osgeo.org>
>> *Ämne:* Re: [Qgis-user] Http access to json return
>>
>>
>>
>> Hi!
>>
>>
>>
>> If it's a vector layer (e.g. geojson response) that you'll load via API,
>> you can try using the Data Source Manager -> Vector Tab and use *Protocol:
>> HTTP(S), cloud, etc.*. You can select the proper *Type* and input the
>> *URI* similar to the image below. This will load the file/response as a
>> QGIS layer.
>>
>>
>>
>>
>>
>> I haven't tried it yet for CSV / non-spatial data though.
>>
>>
>>
>> All the best,
>>
>> Ben Hur
>>
>>
>>
>> On Wed, Jun 24, 2020 at 2:23 PM Andreas Neumann <a.neumann at carto.net>
>> wrote:
>>
>> Hi Steve,
>>
>> Not that I know of, but:
>>
>> - you could have an onload Python script that runs when the form opens
>>
>> - you could have a web-widget with an onload javascript that does some
>> network requests
>>
>> Such rather "developer centric" questions are more likely to get
>> responses on the qgis-developer mailing lists, btw.
>>
>> Greetings,
>>
>> Andreas
>>
>> On 2020-06-24 07:22, Steve Sgalowski wrote:
>>
>> Is there  widget  on qgis that does http out with api and returns data in
>> json or csv format?.
>>
>>
>>
>> Stephen.
>>
>>
>>
>>
>>
>> _______________________________________________
>> Qgis-user mailing list
>> Qgis-user at lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>>
>>
>> _______________________________________________
>> Qgis-user mailing list
>> Qgis-user at lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>>
>>
>>
>> --
>>
>> ---
>>
>> *Ben Hur S. Pintor*
>>
>> bnhr.xyz
>>
>> hi at bnhr.xyz
>>
>>
>>
>> open spatial & data solutions
>> _______________________________________________
>> Qgis-user mailing list
>> Qgis-user at lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
>
>
> --
> Alessandro Pasotti
> QCooperative:  www.qcooperative.net
> ItOpen:   www.itopen.it
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20200625/1ee1db17/attachment.html>


More information about the Qgis-user mailing list