Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to plot polygons with holes on a framework that doesn't support holes. The approach to me seems to be to translate the single polygon into several ones adding up to the whole polygon, leaving out the holes.

Is there a standard algorithm for that? Maybe even with code? Or is there another standard way to solve the problem of plotting polygons with holes?

share|improve this question

A standard way to do that is the following: If the polygon external ring is composed of n points (P1,P2,...,Pn,P1) and a hole internal ring of m points (H1,H2,...,Hm,H1), try to draw the polygon composed of the single following external ring: (P1,P2,...,Pn,P1,H1,H2,...,Hm,H1,P1). This is equivalent of drawing a fictive imperceptible corridor between the external and internal ring like there:

enter image description here

It can be generalised in case of several holes: (P1,P2,...,Pn,P1, H11,H12,...,H1m1,H21,H11, H21,H22,...,H2m2,H21, ... , P1)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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