I have shapefiles which I converted to .csv
format. I want to insert those into a MySQL Database table. I used ST_PolyFromText according to the MySQL reference manual.
## create table
cur.execute("CREATE TABLE `db1`.`table1` ("
"`Id` INT NOT NULL AUTO_INCREMENT,"
"`geometry` POLYGON NOT NULL,"
"PRIMARY KEY (`Id`));")
sql_statement = "INSERT INTO table1(geometry) VALUES (ST_PolyFromText(%s,0))"
When I try to insert polygon values into the Database. I get the error 3037, 'Invalid GIS data provided to function st_polyfromtext.'
- How should I use MySQL Spatial Functions to insert my Polygons ??
df['wkt']=df.geometry.apply(lambda x: x.wkt)
when exporting to csv. What if you open the csv and look at the incomplete row, is it complete in the csv?