Topic: Importing Country Shape Files
Hi
I have just been importing some country shape files to allow me to answer a question about how many records have been received in Wales.
There are files for Wales, England, Scotland, Eire and Northern Ireland. These have been built by merging the existing vice-county shape files. I'm not sure how accurately this reflects the current country boundaries. The Gt Britain boundaries contain a 3-mile coastal strip but the Ireland boundaries do not.
In the process I came across a hard-coded 4Mb limit in upload shape file size which is removed in the current development trunk but may affect users of the current release.
I also found that my shape files, which began with a MULTIPOLYGON representing the islands of each country, had become POLYGONS after import. These were invalid geometries as the islands were now holes outside the main ring.
They could be shown to be invalid by the following query
SELECT ST_IsValidReason(boundary_geom) FROM locations WHERE id = 1234
To my surprise, this and some self-intersections were fixed simply by the following
UPDATE locations SET boundary_geom = ST_MakeValid(boundary_geom) WHERE id = 1234
Jim Bacon.