I'm using psycopg2 to execute some PostGIS queries but I'm running into issues. Lets say I run a query:
cursor.execute("SELECT locations FROM locationtable")
This gives me a python variable which is a list of point geometries. Later, say I want to transform them to a different SRID I want to be able to do:
cursor.execute("SELECT ST_Transform(%s,32146)",(locs))
But this gives me an error:
TypeError: not all arguments converted during string formatting
I realize in this case I could have just combined these two SQL commands, but this is a general problem I have been encountering and want to know if there is a way to pass the list of tuples with psycopg2 and have the SQL command execute on all the values.
executemanywork?