# Polygon exterior and interiors

**URL:** <https://discourse.julialang.org/t/polygon-exterior-and-interiors/65190>\
**Category:** New to Julia\
**Tags:** geometrybasics, polygons\
**Created:** [July 23, 2021, 4:40pm UTC](https://discourse.julialang.org/t/polygon-exterior-and-interiors/65190 "2021-07-23T16:40:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jinml](https://avatars.discourse-cdn.com/v4/letter/j/91b2a8/32.png) [@jinml](https://discourse.julialang.org/u/jinml)\
**Post date:** [July 23, 2021, 4:40pm UTC](https://discourse.julialang.org/t/polygon-exterior-and-interiors/65190/1 "2021-07-23T16:40:25Z")

</div>

Hi, I’m using Julia’s `GeometryBasics` package, and in particular the Polygon class. I can create a square polygon by  
`p=Polygon([[0,0],[1,0],[1,1],[0,1],[0,0] ])`  
where `p.exterior` is a 4-element `LineString` object containing the four edges of the square. But there is also a field `p.interiors`, which seem to be an empty `LineString`.  
Can someone explain to me what is the `interiors` field referring to? How can I generate a polygon with nonempty `interiors`, and in particular, more than one interior **s**?

---

<div class="post-metadata">

**Author:** ![sijo](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sijo](https://discourse.julialang.org/u/sijo)\
**Post date:** [July 23, 2021, 5:25pm UTC](https://discourse.julialang.org/t/polygon-exterior-and-interiors/65190/2 "2021-07-23T17:25:17Z")

</div>

I think interiors are typically used to describe holes in the polygon, see the image on this page: [shape types](https://help.arcgis.com/en/geodatabase/10.0/sdk/arcsde/concepts/geometry/shapes/types.htm)

The docstring for `Polygon` says you can construct one with `Polygon(exterior::AbstractVector{<:Point}, interiors::Vector{<:AbstractVector{<:AbstractPoint}})`, but it seems that’s wrong: there’s no such constructor. The tests in `test/runtests.jl` show a working example:

```julia
pts_ext = Point{2, Int}[(5, 1), (3, 3), (4, 8), (1, 2), (5, 1)]
ls_ext = LineString(pts_ext)
pts_int1 = Point{2, Int}[(2, 2), (3, 8),(5, 6), (3, 4), (2, 2)] 
ls_int1 = LineString(pts_int1)
pts_int2 = Point{2, Int}[(3, 2), (4, 5),(6, 1), (1, 4), (3, 2)] 
ls_int2 = LineString(pts_int2)
poly_ext = Polygon(ls_ext)
poly_ext_int = Polygon(ls_ext, [ls_int1, ls_int2])

```

Try plotting this in Makie…
