-
-
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
OSM driver: prefer JSON or other standard to HSTORE #7533
Comments
GDAL does support the SELECT DISTINCT case, it is just that the OGR SQL dialect does not. Test with What is the function that you do not find from PostgreSQL documentation? |
Ah, many thanks for the pointers. Sorry for the noise. |
Re-opening as proposing JSON output as an alternative seems a reasonable enhancement as hstore is a kind of ancestor for json, and json is more widely supported |
…open option, as an alternative for HSTORE formatting for other_tags/all_tags fields (fixes OSGeo#7533)
implemented in #7538 |
Expected behavior and actual behavior.
I am a newbie to databases and GDAL. I set up a workflow around a standard SQLite or GeoPackage made out of OpenStreetMap (I tested PBF and GeoJSON sources). As described in the OSM driver docs,
ogr2ogr
made an HSTORE-formatted columnother_tags
to hold the OSM tags that do not have a dedicated column (i.e. are not mentioned inosmconf.ini
).As GDAL's parser
hstore_get_value()
(docs) does not exist insqlite3
, I use regexes when running Python /sqlite3
on another machine, which feels conceptually wrong and is hard or impossible to do safely. Or I could try this workaround to dohstore_to_json
and alter the DB. Also GDAL's implementation does not support SELECT DISTINCT (#3671). I cannot even find the function in the PostgreSQL docs and I feel I'm wasting time to learn idiosyncrasies of a non-reusable tool.What about using JSON or another standard format instead? SQLite has native support for JSON. If the user doesn't know the JSON-specific SQL, they can pass the column to the host programming language, which most likely has a parser. The syntax and concepts are shared to some extent across SQLite's, MySQL's and PostgreSQL's implementations, so time spent to learn this standard would not be wasted.
The text was updated successfully, but these errors were encountered: