Open mhogeweg opened 9 years ago
I don't understand the issue: This plugin does not support styling based client requests. But to my understanding ArcGIS Dynamic Map services always have a default styling attached since the raster map response needs to be generated anyhow. Pls. clarify.
the example service above is not a raster map service with precooked tiles. it is dynamic in the sense that client applications can show/hide layers, do identify operations, and (depending on how the publisher configured the service) even allow modifying styling. all this handled through basic REST call to the service like this example:
notice I'm not submitting any layer ids or such and the service still draws all of them with the styling I defined in this particular service. as you zoom in you'll notice the major rivers disappear at some point:
same request, only different is the bounding extent (and resulting from that the map scale).
I understand that there are no precooked tiles; to me it's like an OGC WMS. But I still can't follow what you expect from the plugin, which styling is "lost" and which of the parameters of the examples above are styling parameters.
more illustrated example using my local SampleWorldCities service.
this is how it shows in a browser using the ArcGIS JS API (all just making the simple REST calls illustrated above):
Adding this service to ArcMap gives the same styling:
but adding this service to QGIS results in improper layer order (backward, see #7) and with incorrect styling:
I see. What is then the difference to issue #7 ?
Ok. But where is the styling parameter in the URL examples you gave? What should the plugin do?
that's the beauty of Dynamic Map Services: you don't have to provide the styling since that is already defined in the service itself.
I was playing with adding a dynamic map service in QGIS myself. This works except for capturing the signal to redraw when the map extent changes. I'll send you the full code, but here's a snippet (note the server is my laptop, so replace that with a public service URL):
fileName = 'http://hogeweg.esri.com/arcgis/rest/services/SampleWorldCities/MapServer/export?dpi=96&transparent=true&format=png8&bboxSR=4326&imageSR=4326&f=image'
fileInfo = QFileInfo(fileName)
baseName = fileInfo.baseName()
canvasSize = qgis.utils.iface.mapCanvas().size()
canvasWidth = canvasSize.width()
canvasHeight = canvasSize.height()
canvasExtent = qgis.utils.iface.mapCanvas().extent()
agsbbox = str('&bbox=%d,%d,%d,%d' % (canvasExtent.xMinimum(), canvasExtent.yMinimum(),canvasExtent.xMaximum(),canvasExtent.yMaximum()))
agssize = str('&size=%s,%s' % (canvasWidth,canvasHeight))
fileName += agsbbox
fileName += agssize
rlayer = qgis.core.QgsRasterLayer(fileName, baseName)
rlayer.setCrs(qgis.core.QgsCoordinateReferenceSystem(4326, qgis.core.QgsCoordinateReferenceSystem.EpsgCrsId) )
qgis.core.QgsMapLayerRegistry.instance().addMapLayer(rlayer)
This should support both the predefined styling in the service as well as user defined styling at query time.
In an ArcGIS Dynamic Map service, the author chooses cartography, scale-dependent rendering of layers, labeling etc. When adding an ArcGIS Dynamic Map service using the plugin, the styling is lost. This may be verified with: http://geoss.esri.com/arcgis/rest/services/WorldBackGroundGrey/MapServer