Convert relations to polygons

Jun 10, 2013 at 1:35 PM
Hi,

I'm looking at the Uk OSM data for the first time with the help of this rather marvellous project (thanks!) and have worked out how to find the data for an English county, using a query such as this:

select way.*, tagname.Info from tRelationMember m
inner join tWay way on way.WayId=m.MemberId
inner join tRelationTag tagname on tagname.RelationId=m.RelationId and tagname.Typ='name'
where m.RelationId=10187 -- Herefordshire

So having achieved this I have questions, which I hope someone can help me with.

1) Why are there bits missing from the outline of the county?
2) How can I turn this data into a polygon, such that I can test a Lat/Lon point to see if it is in the county

Note that I'm actually interested in the data nationally, I just picked Herefordshire at random to check that data I have available.

Thanks