1

I wish to produce a set of 32 polygons for each county on the island of Ireland. I found shapefiles here of all 32 counties:

https://www.townlands.ie/page/download/

The problem is that there are no lakes and the Shannon Estuary is missing.

I then found lake data here but the lake resolution is low and still no Shannon Estuary:

http://www.naturalearthdata.com/downloads/10m-physical-vectors/10m-lakes/

How might I acquire the required polygons?

Here what I have so far for the code below: enter image description here

from shapely.geometry import Polygon, MultiPolygon, mapping, shape
import fiona
import matplotlib.pyplot as plt
from descartes.patch import PolygonPatch

ireland = Polygon([(-5.34,55.43), (-10.56,55.43), (-10.56,51.39), (-5.34,51.39)])

lakes = []
with fiona.open("./ne_10m_lakes/ne_10m_lakes.shp") as shapes: 
  for s in shapes: lakes.append(shape(s['geometry']))
with fiona.open("./ne_10m_lakes_europe/ne_10m_lakes_europe.shp") as shapes:
  for s in shapes: lakes.append(shape(s['geometry']))
lakes = MultiPolygon([s for s in lakes if s.intersects(ireland)])

counties = {}
with fiona.open("./counties/counties.shp") as shapes:
  for s in shapes:
    assert s['properties']['NAME_EN'][:7] == "County "
    counties[ s['properties']['NAME_EN'][7:] ] = shape(s['geometry'])

# 32 counties
counties = [c.difference(lakes) for c in counties.values()]

fig = plt.figure()
ax = fig.add_subplot(111)

for s in counties:
    p = PolygonPatch(s)
    ax.add_patch(p)

ax.set_xlim(-11,-5)
ax.set_ylim(50,57)
plt.show()
2

I think the issue may be that the political boundaries won't include water and lakes.

Here are some options

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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