You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using DuckDB to fetch spatial data from OpenStreetMap Nominatim:
load spatial;
select display_name,regexp_extract(geom,'^(\w+)\s') as typ from st_read('/vsicurl/https://nominatim.openstreetmap.org/[email protected]&q=Vienna&format=geojson&polygon_geojson=1');
This works perfectly as long as I don't use any special characters (e.g. umlauts) for the search.
Therefore, the Nominatim search URL requires the search string in URL-encoded format.
As there is no urlencode function yet, I'm using regex_replace and hex as a workaround:
load spatial;
select display_name,regexp_extract(geom,'^(\w+)\s') as typ from st_read('/vsicurl/https://nominatim.openstreetmap.org/[email protected]&q='||regexp_replace(hex('Vöcklabruck'),'(.{2})','%\1','g')||'&format=geojson&polygon_geojson=1');
What do you think?
Does it make sense to implement functions for URL encoding/decoding?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm using DuckDB to fetch spatial data from OpenStreetMap Nominatim:
This works perfectly as long as I don't use any special characters (e.g. umlauts) for the search.
Therefore, the Nominatim search URL requires the search string in URL-encoded format.
As there is no
urlencode
function yet, I'm usingregex_replace
andhex
as a workaround:What do you think?
Does it make sense to implement functions for URL encoding/decoding?
Regards,
Christoph
Beta Was this translation helpful? Give feedback.
All reactions