1

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.

2

Re: Importing Country Shape Files

Hi Jim,
I should be able to get you an up to date boundary for NI including all the islands. Certainly, my colleague in NIEA would be keen to get an accurate boundary included.

Let me know if you want me to progress this.

Fiona

Fiona McCrory
CEDaR Website Officer
www.nmni.com/cedar

3

Re: Importing Country Shape Files

Hi Fiona

Can you view http://warehouse1.indicia.org.uk/index. … edit/1612?
The map zooms to the centroid so you have to zoom out a lot to see the boundary.
Also the zoom is a bit erratic but appears to work if you do a slow click on the +/- buttons when you are close.
It includes islands but not offshore areas where you might have records of marine species.

It is fairly straightforward to upload boundaries from a GIS shape file.
If you have boundaries you would like to report against and can get them in that format then we can load them.
The original I worked from was given to me by David Roy but I am not sure of his source.
If it looks like it can be improved on this then that would certainly be a benefit to everyone in NI.

Jim

4

Re: Importing Country Shape Files

Hi Jim,
We have put in a request to our colleagues at Land & Property Services (OSNI) to get an up to date and accurate boundary to include the marine buffer.

I'll get back to you when I hear from them.

Thanks,
Fiona

Fiona McCrory
CEDaR Website Officer
www.nmni.com/cedar