Skip to content

Instantly share code, notes, and snippets.

@joaofig
Created July 2, 2023 17:37
Show Gist options
  • Select an option

  • Save joaofig/cafc3f25948244f83206f6e21381c0ed to your computer and use it in GitHub Desktop.

Select an option

Save joaofig/cafc3f25948244f83206f6e21381c0ed to your computer and use it in GitHub Desktop.
Inserts the mapping between H3 tokens and map node coordinates
def insert_h3_nodes(h3_nodes: list[tuple[int,tuple[float,float]]]):
db = TrajDb()
sql = "insert or ignore into h3_node (h3, lat, lon) values (?, ?, ?)"
db.execute_sql(sql, [(n[0], n[1][1], n[1][0]) for n in h3_nodes], many=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment