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

Add WMS layer throw python console -> QGIS Crash #20099

Closed
qgib opened this issue Dec 18, 2014 · 5 comments
Closed

Add WMS layer throw python console -> QGIS Crash #20099

qgib opened this issue Dec 18, 2014 · 5 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption Data Provider Related to specific vector, raster or mesh data providers High Priority

Comments

@qgib
Copy link
Contributor

qgib commented Dec 18, 2014

Author Name: Evgeniy Nikulin (Evgeniy Nikulin)
Original Redmine Issue: 11885
Affected QGIS version: 2.6.0
Redmine category:web_services_clients/wms


I try to add wms layer to the map:

http://maps.rosreestr.ru/arcgis/services/Cadastre/CadastreWMS/MapServer/WMSServer?

If I use the GUI, then everything is fine.
But when I try to add throw Python console, the qgis crashes.

My "code":https://gist.github.com/yellow-sky/e2b4ff752c49aef887e0 :

wms_url = 'http://maps.rosreestr.ru/arcgis/services/Cadastre/CadastreWMS/MapServer/WMSServer?format=image/png&layers=1&styles=&crs=EPSG:3857'
layer = QgsRasterLayer('url=%s' % wms_url, 'Test WMS', 'wms')
if not layer.isValid():
    QgsMessageLog.logMessage('ops', level=QgsMessageLog.CRITICAL)
else:
    QgsMapLayerRegistry.instance().addMapLayer(layer)
</code>

If the URL contains only one sublayer - it's work.
Change url to:

http://maps.rosreestr.ru/arcgis/services/Cadastre/CadastreWMS/MapServer/WMSServer?format=image/png&layers=1,2&styles=&crs=EPSG:3857

and oops...

@qgib
Copy link
Contributor Author

qgib commented Dec 23, 2014

Author Name: Sandro Santilli (@strk)


  • tag was changed from to wms

@qgib
Copy link
Contributor Author

qgib commented Mar 17, 2015

Author Name: Nyall Dawson (@nyalldawson)


The issue is that your layer URI isn't complete. Try using:

wms_uri = 'crs=EPSG:3857&format=image/jpeg&layers=1&layers=2&styles=default&styles=default&url=http://maps.rosreestr.ru/arcgis/services/Cadastre/CadastreWMS/MapServer/WMSServer?format%3Dimage/png%26layers%3D1,2%26styles%3D%26crs%3DEPSG:3857'
layer = QgsRasterLayer(wms_uri, 'Test WMS', 'wms')

@qgib
Copy link
Contributor Author

qgib commented Mar 17, 2015

Author Name: Nyall Dawson (@nyalldawson)


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented May 27, 2015

Author Name: Giovanni Manghi (@gioman)


  • priority_id was changed from Normal to High

@qgib
Copy link
Contributor Author

qgib commented Oct 5, 2015

Author Name: Jürgen Fischer (@jef-n)


closing for the lack of feedback


  • resolution was changed from to worksforme
  • status_id was changed from Feedback to Closed

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Data Provider Related to specific vector, raster or mesh data providers Crash/Data Corruption labels May 25, 2019
@qgib qgib closed this as completed May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption Data Provider Related to specific vector, raster or mesh data providers High Priority
Projects
None yet
Development

No branches or pull requests

1 participant