Le 19/01/2024 à 16:54, Abel Pau via gdal-dev a écrit :
Hello,
we have tried to generate some layers from MiraMon to SHP, KML, or
GPKG, and we have noticed that they do not support "List" field cases.
They give a warning like: "The output driver does not seem to natively
support IntegerList type for field “XX”.
It could be interesting if a driver could output a feature with "List"
type fields as the same feature repeated as many times as the elements
in the List, if the user requests it (via –lco). This would be
beneficial to avoid losing elements from fields that are of type List.
The current implementation generates an IntegerList, but this
modification could be done.
As we want to export the information somehow, even if it's not
perfect, we are wondering which of these solutions we can apply:
1. (preferable) export N objects, each with a single attribute, not as
an "IntegerList" but as N "Integer/Float, etc" objects.
2. export a single object with a single attribute (which could be
chosen with a -lco).
However, we are wondering how we should handle the GetFeatureCount()
function in case 1 (from the above).
And we also wonder how to handle the GetNextRawFeature() function.
Since this function can indicate that it has returned more than one
element (in case 1).
Don't complicate your driver. This is just a usage issue of ogr2ogr. As
hinted by it, you need to pass for example -mapFieldType
IntegerList=String to ask ogr2ogr to transform IntegerLst fields into string
$ cat test.json
{
"type": "FeatureCollection",
"name": "test",
"features": [
{ "type": "Feature", "properties": { "id": 1, "attr": [2,3] },
"geometry": null }
]
}
$ ogr2ogr out.shp test.json -mapFieldType IntegerList=String
$ ogrinfo out.shp -al -q
Layer name: out
Metadata:
DBF_DATE_LAST_UPDATE=2024-01-19
OGRFeature(out):0
id (Integer) = 1
attr (String) = (2:2,3)
Even
Thanks for taking it in consideration.
*Abel Pau Garcia*
*GIS developer*
https://www.creaf.cat/sites/default/files/creaf-signature.png
*a....@creaf.uab.cat* <mailto:a....@creaf.uab.cat>
*Let's chat on Teams!*
<https://teams.microsoft.com/l/chat/0/0?users=a....@creaf.uab.cat>
*Tel. +34 934814277*
https://www.creaf.cat/sites/default/files/so-en-signature.png
https://www.creaf.cat/sites/default/files/twitter-icon-signature.png
<https://twitter.com/CREAF_ecologia>https://www.creaf.cat/sites/default/files/linkedin-icon-signature.png
<https://www.linkedin.com/company/1363052?trk=tyah&trkInfo=clickedVertical:company,clickedEntityId:1363052,idx:2-1-2,tarId:1465807877789,tas:creaf>https://www.creaf.cat/sites/default/files/youtube-icon-signature.png
<https://www.youtube.com/c/creafecologia>https://www.creaf.cat/sites/default/files/instagram-icon-signature.png
<https://www.instagram.com/CREAF_ecologia/>
*www.creaf.cat* <http://www.creaf.cat>*| **http://blog.creaf.cat*
<http://blog.creaf.cat>
https://www.creaf.cat/sites/default/files/uab_logo_signatura.png
CREAF. Campus UAB. Edifici C. 08193 Bellaterra (Barcelona)
Before printing this electronic message, think about the environment.
http://www.creaf.uab.cat/_signatura/line.gif
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev
--
http://www.spatialys.com
My software is free, but my time generally not.
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev