[Qgis-developer] Vector buffer commitChanges (was Interaction between QGis and ArcGis)

Radim Blazek radim.blazek at gmail.com
Sun Apr 21 02:13:00 PDT 2013


On Sat, Apr 20, 2013 at 9:03 PM, Olivier Dalang
<olivier.dalang at gmail.com> wrote:
> Is this a solution for http://hub.qgis.org/issues/7540 ?

Probably.

Radim

> 2013/4/20 Radim Blazek <radim.blazek at gmail.com>
>>
>> On Fri, Apr 19, 2013 at 12:07 PM, JVerholle <julien.verholle at eaurmc.fr>
>> wrote:
>> > Hi all,
>> >
>> > If I want to open the same shapefile in both softwares at the same time,
>> > the
>> > file is locked in ArcGis (even if the edition mode isn't used in QGis).
>>
>> QGIS opens layers (files) in update mode ("r+") if possible (file
>> permission + OGR driver support). It may (but also may not) be a
>> problem also for #6448 (slow shp over network) I am currently
>> struggling with. In general, I think that it is bad to open files
>> always in update mode even if in most cases they are not going to be
>> edited.
>>
>> Currently there are no QgsVectorDataProvider::startEditing() and
>> commitChanges() which may also be a problem for database providers
>> because QgsVectorLayerEditBuffer::commitChanges() calls more provider
>> methods changing
>> data (deleteAttributes, addAttributes, deleteFeatures,
>> addFeatures...).  The commitChanges() should do everything in one
>> transaction IMO.
>>
>> My proposal is to:
>> 1) Add QgsVectorDataProvider::startEditing() and
>> QgsVectorDataProvider::commitChanges()
>> 2) In OGR provider try to open layer in update mode only to get
>> capabilities (get info if it can be modified when the provider is
>> constructed) but then to reopen in read only mode.
>> 3) Call QgsVectorDataProvider::startEditing() from
>> QgsVectorLayer::startEditing() to be sure that the layer is still
>> editable (permissions could change or it was opened by another
>> application for editing since the layer was opened) and to reopen
>> files in update mode (files based) or to start transaction (DB based).
>> 4) Call QgsVectorDataProvider::commitChanges() from
>> QgsVectorLayer::commitChanges()
>> 4) In QgsOgrProvider::startEditing() reopen the layer in update mode
>> 5) In QgsOgrProvider::commitChanges() reopen the layer in read only mode
>>
>> I am not sure if reopening of layers in OGR provider may be a
>> performance problem, but I hope that it should not be.
>>
>> We don't really have to implement startEditing() and commitChanges()
>> in all providers for 2.0, but it should be in the vector API.
>>
>> Radim
>>
>> PS: Unfortunately, according to my current knowledge, this is not full
>> solution for #6448.
>>
>> > ArcGis is enable to recognize the feature's type (we can see a "?"
>> > instead
>> > of polylign, polygon or point).
>> > This issue has been only noticed on Windows (and with ArcMap 9.2).
>> >
>> > Someone has already seen this problem ? Is it due to QGis or Gdal ?
>> >
>> > Thanks.
>> >
>> > Julien
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> > http://osgeo-org.1560.x6.nabble.com/Interaction-between-QGis-and-ArcGis-tp5048256.html
>> > Sent from the Quantum GIS - Developer mailing list archive at
>> > Nabble.com.
>> > _______________________________________________
>> > Qgis-developer mailing list
>> > Qgis-developer at lists.osgeo.org
>> > http://lists.osgeo.org/mailman/listinfo/qgis-developer
>> _______________________________________________
>> Qgis-developer mailing list
>> Qgis-developer at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>


More information about the Qgis-developer mailing list