I have a shapely file with several polygons for a given country, together with information on its cities. I run the Voronoi algorithm on the cities' capitals and get the polygons for it. However, polygons run off to "infinity" (outside of the external boundary of the country's polygon). How do I "mask" (is this the right word) the country so that only the Voronoi polygons are shown? In other words, how do I make polygons outside the country's boundary disappear?

  • 1
    You could use the Clip function using your voronoi polygons as input and the country boundary as the clip layer. – Joseph Dec 8 '16 at 12:38

Have you set the buffer region distance to the voronoi tool. This should prevent the voronoi product running to infinity.

'Vector > Geoprocessing Tools > Dissolve' the country polygons so that you have a polygon for the entire country. This is your mask layer. Then 'Vector > Geoprocessing Tools > Clip' the voronoi layer with the dissolved country layer.

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.