-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
MapInfo Tab file GDAL "OGR_Dr_CopyDataSource" fucntion fails. #11693
Comments
I don't program and I cannot read your code, but I tried to convert your data with GDAL version 3.11.0dev.
|
Those IDs are the IDs of the data records, so the data should remain the same. I do not know which functions ogr2ogr -f "MapInfo File" test.tab LteMeasurementsEventLocationsLteConnectionSegments.tab -nln test uses. The issue, I think, is with the FID (Feature IDs). As I understand it, these are simple IDs ranging from 1 (or 0) to X. In my case, the original results have 10 records, so there will be 10 features with FIDs from 1 to 10. The issue seems to occur when using the OGR_Dr_CopyDataSource PInvoke function (calling the GDAL C++ function from C#). |
As I told, I am not a programmer. The source code is available here https://github.com/OSGeo/gdal/blob/master/apps/ogr2ogr_bin.cpp and for a libraty version here I turned your data into MIF
GDAL reads the FID from the "Id" field. |
You're obviously using a patched version of GDAL, since your code passes a FID_ASSIGNMENT layer creation option that doesn't exist in upstream GDAL. Supporting unmodified GDAL is already a difficult enough task, so, sorry but we can't support people that are talented enough to patch GDAL... |
Tried "FID_ASSIGNMENT" parameter as AI suggested it :) - tried different params what I could find - sadly non of them helped. Simple try my LinqPad code which uses GDAL official nuget and I can repeate same issue when using "OGR_Dr_CopyDataSource" GDAL function. |
Oh my god. Could people stop using that crap... Such a collective loss of time |
What is the bug?
Hello.
We had GDAL build with some customizations. We recently used GDAL v3.5.1.
Now I build with GDAL v3.5.3.
We use this method to copy source data:
Issue:
And now "OGR_Dr_CopyDataSource" copying data source fails with error: "CreateFeature() failed: invalid feature id 1".
Attached GDAL_tab.zip, which contains simple LinqPad (I am opening with LinqPad v7 x64) C# Program it uses GDAL nuget. Also added simple TAB file format results generated by our app which I want to clone/ export as TAB file format results.
Note:
So would you suggest, how to fix "OGR_Dr_CopyDataSource" usage or need to manually create destination Data Source and copy objects/create from source?
Steps to reproduce the issue
GDAL_tab.zip
Versions and provenance
OS: Windows
App language: C#
GDAL: v3.5.3
Additional context
No response
The text was updated successfully, but these errors were encountered: