Hi Devs

I am currently working on the "ArcGIS REST API Connector Plugin"[1] trying to 
find a way to use QgsVectorLayer. The webservice (callef "ArcGIS Feature 
Service") returns valid GeoJSON and the QgsVectorLayer's datasource url can 
point to the service that provides this GeoJSON (this is done in the current 
version of the plugin). The problem is that there exists no query to retrieve 
all features from an ArcGIS Feature Layer at once/in one service call (if there 
are more than 1000 features). 

So my approach is the following: The feature list is populated through multiple 
service calls and temporarily stored/cached as GeoJSON-File. The 
QgsVectorLayer's datasource url points to this file. The file is repopulated 
occasionally on request/event. Probably the best way to achieve this would be 
to write a CustomVectorDataProvider that inherits from VectorDataProvider and 
is injected into the VectorLayer. But I didn't find a way to do this with 
PyQGIS.  

I then tried to use a QgsPluginLayer as an adapter to a QgsVectorLayer. The 
CustomPluginLayer would hold a reference to an instance of VectorLayer and 
delegates all the functionality of a VectorLayer to this instance. This would 
allow the (re)population of the local GeoJSON file, when the layer is loaded or 
refreshed. But I didn't find a way to achieve this. 

1. What actions are possibly needed to (re)connect? 
2. Or are there methods/structures missing in the Python API wrapper to QGIS 
C++ API?
3. Is there a good overview/doc over the activities/instances involved when an 
VectorLayer is added to a map by calling 
QgsMapLayerRegistry.instance().addMapLayer(layer) or alternatively when a 
VectorLayer is created/added through iface.addVectorLayer? 

Any input/ideas would be very much appreciated. 

Kind regards
Carmelo Schumacher

[1] http://giswiki.hsr.ch/QGIS_ArcGIS_REST_API_Connector_Plugin 
<http://giswiki.hsr.ch/QGIS_ArcGIS_REST_API_Connector_Plugin>

------------
Carmelo Schumacher
Institut für Software (IFS)
Hochschule für Technik Rapperswil 
Oberseestrasse 10, 8640 Rapperswil, CH
_______________________________________________
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to