Skip to content
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

FlatGeobuf: does not support lco ENCODING #2254

Closed
tobwen opened this issue Feb 18, 2020 · 8 comments
Closed

FlatGeobuf: does not support lco ENCODING #2254

tobwen opened this issue Feb 18, 2020 · 8 comments

Comments

@tobwen
Copy link
Contributor

tobwen commented Feb 18, 2020

Expected behavior and actual behavior.

Right now, it's not possbile to set the encoding using -lco ENCODING. It's unknown if FlatGeobuf supports UTF-8 only by design.

Steps to reproduce the problem.

ogr2ogr -F FlatGeobuf test_01.fgb test.geojson -lco ENCODING=UTF-8
ogr2ogr -F FlatGeobuf test_02.fgb test.geojson

Testfile (test.geojson)

{ "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "name": "Straße ÄÖÜß €" }, "geometry": { "type": "Point", "coordinates": [ 0,0 ] } } ]}

Operating system

Microsoft Windows 10, 64 bit - Version 10.0.17763.678

GDAL version and provenance

GDAL 3.1.0dev, released 2019/99/99 from OSGeo4W (update 2020-02-17)

@bjornharrtell
Copy link
Contributor

FlatGeobuf only supports UTF-8 by design.

Can you clarify what the expected behavior is here and supply the test data?

@tobwen
Copy link
Contributor Author

tobwen commented Feb 18, 2020

Warning: This now will be offtopic here and I should move it to QGIS' issue list. It just wasn't clear to me, whether_FlatGeobuf_ supports other encodings than UTF-8.

There is a snippet in my initial post, which can be used to reproduce the problem. I've loaded the FGB into QGIS and it used "system" encoding as a standard, like it does on most shapefiles. I first thought, FlatGeobuf is behaving to a shapefile, which allows any encoding. But I think, it's an issue of the way, GDAL (or QGIS itself) identifies the codepage.

Since you clarifyed, FlatGeobuf can be UTF-8 only, it should be reported to QGIS that the incoming dataset is UTF-8. I don't know, if this is QGIS' or GDAL's job. It's correctly handled in GDAL, so there seems to be the missing flat for QGIS that the incoming data is encoded in UTF-8.

@tobwen
Copy link
Contributor Author

tobwen commented Feb 18, 2020

Ah, maybe here we go? qgis/QGIS#34381

@bjornharrtell
Copy link
Contributor

Nice find @tobwen, I've often been fooled by how QGIS tries to guess shapefile encoding. Now, if it will solve this issue I'm not sure yet.

@bjornharrtell
Copy link
Contributor

@tobwen if you have the possiblity, please test with QGIS nightly on Windows and report back.

@nyalldawson
Copy link
Collaborator

I don't think there's a QGIS issue here -- even in versions with the confusing shapefile encoding handling, these only applied to shapefile sources (not other ogr sources)

@rouault
Copy link
Member

rouault commented Feb 20, 2020

@bjornharrtell OGRFlatGeoBufLayer::TestCapability() should likely advertize OLCStringsAsUTF8

@bjornharrtell
Copy link
Contributor

@rouault thanks that definitely seems to be the right thing to do.

@rouault rouault closed this as completed Feb 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants