Skip to content

Instantly share code, notes, and snippets.

@marklit
Last active December 6, 2022 10:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marklit/67591c234176d34abbc6bf8c4c26ea40 to your computer and use it in GitHub Desktop.
Save marklit/67591c234176d34abbc6bf8c4c26ea40 to your computer and use it in GitHub Desktop.
BigQuery WKB reading error
$ vi test.csv
0101000020777F0000B0BFEC9E3C3C52C0A8CFD556ECA74440
0101000020777F0000982A1895D43D53C0100BB5A6796F4340
0101000020777F000038B4C876BE3B53C0F05A423EE8714340
0101000020777F0000842F4CA60A3E53C058423EE8D96C4340
0101000020777F000094F6065F986C56C0D05D4BC8077D4140
0101000020777F0000443EE8D9AC7658C020DBF97E6A9C3E40
0101000020777F0000D4E76A2BF66758C0E0BE0E9C33724040
0101000020777F0000482575029A1C56C0283A92CB7F704540
$ bq load --source_format=CSV --quiet <ds>.wkb_test ./test.csv geom:GEOGRAPHY

Error while reading data, error message: Could not parse '0101000020777F0000B0BFEC9E3C3C52C0A8CFD556ECA74440' as GEOGRAPHY for field geom (position 0) starting at location 0 with message 'Unknown object type 0x20000001; during WKB parsing'

The above hex value converts into the following GeoJSON with https://rodic.fr/wp-content/uploads/2015/11/geom_converter.html

{"type":"Point","coordinates":[-72.94119999999998,41.31189999999998]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment