OrdnanceSurvey / osdatahub

A python package from Ordnance Survey, designed to make data from the OS Data Hub APIs readily accessible to developers.
Other
27 stars 10 forks source link

Allow Extent to be multipolygon #23

Open FHunt-OS opened 2 years ago

FHunt-OS commented 2 years ago

It would be useful if Extent could be a multipolygon to allow query results from non-contiguous areas, without needing to make multiple extent/API objects.

E-Paine commented 2 years ago

This is not easily solved, at the moment. The underlying API does not support MultiPolygons or multiple geospatial filters. Therefore, a significant amount of post-processing would need to be done, which breaks away from the idea of this being a fairly thin wrapper of the API. This issue should stay open for when this is implemented upstream.

ian-astun commented 1 year ago

Since it only takes the extent of the polygon it should be easy to make it take a multipolygon. I can filter out the bits I don't want later if necessary.

Ilkka-LBL commented 1 year ago

A related issue is that using Extent.from_ons_code() method doesn't work because some ONS codes are interpreted as multipolygons. One example is that of Greenwich (E09000011), which shouldn't even result in a multipolygon.