简体   繁体   中英

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

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM