Ticket #859 (closed enhancement: worksforme)
shp2pgsql new option to do something with bad geometries.
|Reported by:||jadams||Owned by:||pramsey|
Ticket 110 included a discussion of what to do with invalid geometries on load. I'm splitting that out into its own ticket, since it wasn't directly related to 110 (which was about transactions). Here are the most relavent excerpts:
by robe: "...also have the option to NULL the geometry. I think others have asked for the ability to NULL.
Its a reality we get bad data and the last set I had to deal with was intentionally bad. They had used the same malformed geometry to represent the absense of a geometry -- presumably to satisfy ESRI shapefile that requires a geometry for all records.
After trying to salvage these things -- closing them and so forth -- to my shock they were all the same malformed creatures."
by bobdebm: "I was just wondering if there could be an option in shp2pgsql that puts all of the 'not isvalid(the_geom)' geometries in a same named table with a '_err' suffix?"
by robe: "I like Bob's idea of throwing in an error table or giving the option to do so though as you said we can't do a true st_isvalid check.
I think the fact there is no GEOS binding is fine. The main issue to me is that these are just thrown out and are therefore hard to repair since its easier to repair things in the db - if we could even throw just the WKT in the table that would be better than nothing."