Skip to content

Could not get download transportion data using DuckDB in ubuntu #99

Answered by jwass
ajayvsv asked this question in Transportation
Discussion options

You must be logged in to vote

Hi @ajayvsv -
@mtravis is right you need to cast the array columns to JSON - but it looks like the struct columns are fine. For your query that's both sources and connectors. But more importantly, you'll need to load up the geometry with ST_GEOMFROMWKB(geometry). This worked for me (Note also the change in the read_parquet() path for this example).

COPY (
        SELECT
                type,
                version,
                level,
                subtype,
                road,
                CAST(connectors AS JSON) AS connectors,
                id,
                CAST(sources AS JSON) AS sources,
                ST_GEOMFROMWKB(geometry) AS geometry
        FROM read_parquet('s…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@ajayvsv
Comment options

Comment options

You must be logged in to vote
1 reply
@jwass
Comment options

jwass Dec 1, 2023
Collaborator

Answer selected by jenningsanderson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants