Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble with connecting to Geopunt metadata #17

Open
BrechtCuyvers opened this issue Oct 10, 2019 · 3 comments
Open

Trouble with connecting to Geopunt metadata #17

BrechtCuyvers opened this issue Oct 10, 2019 · 3 comments

Comments

@BrechtCuyvers
Copy link

Hi there,

Currently I'm using QGIS 3.4.12 Madeira and I installed the Geopunt4QGIS plugin. When I try to open the Geopunt catalogue, I get this error. Does someone know what to do? The other features from this plugin do work!

kind regards
Schermafbeelding 2019-10-07 om 16 33 48

@JGMieco
Copy link

JGMieco commented Dec 9, 2019

Hello,

Currently, I have the same problem. Have you find the solution in the meanwhile?

Thank you!

@rduivenvoorde
Copy link

I can confirm this to, when working on a belgian government machine (which retrieves it's proxies via a so called pac file).
Apparently current code does not retrieve the proxies?

As an example, the following works:

url = "https://basisregisters.vlaanderen.be/api/v1/gemeenten/?limit=50&offset=0"
request = QNetworkRequest(QtCore.QUrl(url))
r = QgsBlockingNetworkRequest()
r.get(request)
reply = r.reply()
print(f'content: {reply.content()}')

On this QGIS machine which works fine with network requests.

But this code (taken from basisregisters.py) results in a timeout

from urllib.request import getproxies
proxies = getproxies()
data = {'limit' : 500 , 'offset': 0}
requests.get("https://basisregisters.vlaanderen.be/api/v1/gemeenten/", params=data, timeout=3, verify=False, proxies=proxies ).json()

Another advantage of using the QGIS classes is that the requests can be viewed/debugged in the networkdebugger window of QGIS (F12).

When searching for a solution I also found this Python issue, which is maybe related: https://bugs.python.org/issue42627

@rduivenvoorde
Copy link

For others, the plugin code does NOT pickup the proxy.vlaanderen.be proxy defined in QGIS settings, BUT !!!
you can just set it in the geopunt4Qgis-plugin settings.
Via menu Web /geopunt4Qgis / Settings:

928FDAD8D3694254A2CE98824475D67C

You can go to overrule the system-proxy, probably you should use http://proxy.vlaanderen.be:8080 as seen below

11E70337408C4C30B01EE763ADD224FE

Now the plugin is working :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants