I've got some shapefiles, and need to convert the shapes into an SQL Geometry type and insert them into a table in our database. We're using GeoKettle.

I can open the shapefile find and read values in from it into the table (such as a text field in the shapefile into a varchar in the table), but don't know the steps I need to translate the shape, which appears to be coming out of the shapefile as WKT, into a geometry.

Basically, whenever I execute, I get the error that it doesn't seem to be able to insert it. Which is understandable, as I say it seems to be coming out as WKT and trying to insert that into a geometry field. And I know the method to convert it to geometry in SQL (STGeomFromText) - I just essentially need to know how to add that in GeoKettle.

  • 1
    Related gis.stackexchange.com/questions/62315/…
    – Mapperz
    Jun 5, 2017 at 0:01
  • Tried that, not working. It's coming up with a java.lang.ClassCastException - which it shouldn't really be doing as it's just taking the geometry from the shapefile input (the_geom) and trying to save it to the table's geometry field.
    – user25730
    Jun 5, 2017 at 2:33
  • What database are you using? GeoKettle just takes the shapefile geometry and feeds into PostGIS for me.
    – nmtoken
    Jun 5, 2017 at 11:18

1 Answer 1


Not necessarily "the" answer but a way around - just used an "Execute SQL script" control to insert each one. Bit of a pain but it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.