1

I want to upload data with postgis using an sql query. See below the code

df = gpd.GeoDataFrame.from_postgis('select ST_ASTEXT(point_sm) as geom from df.df' , con=engine, geom_col='geom')

I get this error:

ParseException: Invalid HEX char

WKBReadingError: Could not create geometry because of errors while reading input.

I haven't tried much to be honest. I am new to this and couldn't figure out where to start.

Community
  • 1
  • 1
Reda S
  • 167
  • 12

1 Answers1

1

You are requesting a text but the function expects a geometry expressed in WKB.

Try changing the query to

select point_sm as geom from df.df
JGH
  • 15,928
  • 4
  • 31
  • 48