[postgis-devel] Removing geometry parsing checks for data loading
Mark Cave-Ayland
mark.cave-ayland at siriusit.co.uk
Mon Jul 7 02:35:57 PDT 2008
David Fuhry wrote:
> I agree that the shapefiles with unclosed polygons are totally
> invalid. But I need those records' attributes, and their siblings
> records' valid geometries in the db. Besides shapefile preprocessing or
> loading all geom records as "bytea"s, relaxing the geometry parser is
> the least-hackish way I see to bulk load them.
At the end of the day, the input data is invalid and so if I were in
your position then I would either a) fix the broken application which is
producing these invalid shapefiles or b) complain to the people who are
supplying the invalid data. I don't particularly see this as a PostGIS
issue I'm afraid :(
> Similar ambiguities exist for the "num_points % num_dimensions == 0" and
> "num_poly_vertices >= 3" checks. And shp2pgsql's logic would always
> have to be synced with the (E)WKB parser's. (To me) seems to be a
> slippery slope to add geometry validation/modification to shp2pgsql.
Well, the recent work in SVN HEAD means that the parser is now built as
a separate library. The theory is that other utilities including
shp2pgsql will be able to make use of this to avoid code
duplication/improve consistency. So this won't be an issue moving forward ;)
ATB,
Mark.
--
Mark Cave-Ayland
Sirius Corporation - The Open Source Experts
http://www.siriusit.co.uk
T: +44 870 608 0063
More information about the postgis-devel
mailing list