[gdal-dev] GML duplicated FID

Even Rouault even.rouault at spatialys.com
Thu Mar 4 14:10:36 PST 2021


In the below example, the gml_id are not duplicated if you look 
cloosely. The duplication of the OGR FID is a pure GDAL behaviour in the 
way it tries to derive a FID from gml_id. So Geoserver behaves just fine 
here.

Le 04/03/2021 à 23:02, jratike80 a écrit :
> Hi,
>
> It would be interesting to know how you manage to generate duplicate fids
> with Geoserver but perhaps it is better to discuss about that in
> geoserver-users.
>
> -Jukka Rahkonen-
>
>
> Martin Landa wrote
>> Hi all,
>>
>> I have an issue with GML generated by GeoServer. There are features
>> with duplicated FID:
>>
>> ```
>> OGRFeature(lucas_view):36
>>    gml_id (String) = lucas_view.fid--269ff1b9_177af2abc34_-36e6
>>    point_id (Integer) = 45502976
>>    nuts0 (String) = CZ
>>    POINT (4550000 2976000)
>> OGRFeature(lucas_view):36
>>    gml_id (String) = lucas_view.fid--269ff1b9_177af2abc34_-36e5
>>    point_id (Integer) = 45542918
>>    nuts0 (String) = CZ
>>    POINT (4554000 2918000)
>> ```
>>
>> This is a reason why converting such data into GPKG (using
>> CopyLayer()) fails with:
>>
>> ```
>> ERROR 1: failed to execute insert : UNIQUE constraint failed: layer.fid
>> ```
>>
>> Is there any way to force the GML driver to generate a unique FID
>> instead of guessing from  gml_id?
>>
>> Thanks in advance, Martin
>>
>> -- 
>> Martin Landa
>> http://geo.fsv.cvut.cz/gwiki/Landa
>> http://gismentors.cz/mentors/landa
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at .osgeo
>> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
>
>
>
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
http://www.spatialys.com



More information about the gdal-dev mailing list