# SVG layers converted to shapes

**URL:** <https://discourse.processing.org/t/svg-layers-converted-to-shapes/3949>\
**Category:** Coding Questions\
**Created:** [September 29, 2018, 7:09am UTC](https://discourse.processing.org/t/svg-layers-converted-to-shapes/3949 "2018-09-29T07:09:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Geez](https://avatars.discourse-cdn.com/v4/letter/g/a587f6/32.png) [@Geez](https://discourse.processing.org/u/Geez)\
**Post date:** [September 29, 2018, 7:09am UTC](https://discourse.processing.org/t/svg-layers-converted-to-shapes/3949/1 "2018-09-29T07:09:36Z")

</div>

Hello,

Hope y’all doing good!  
I have an SVG geographic map with various islands on it.  
When opening the SVG in a vector graphics editor, each island is a layer that you can select.  
Is there is a way for processing to detect those layers when I load the SVG and convert them as shapes?

The aim would be then to be able to do shape collision detection.  
For instance, finding out easily when a specific island is hit by a natural disaster which would also be represented by a shape.

I found some resources about the shape detection collision such as: [https://www.openprocessing.org/sketch/117434](https://www.openprocessing.org/sketch/117434)

But I’m struggling to find resources explaining how to convert the SVG layers in shapes automatically. Is that even possible?

Thanks in advance,  
G.

---

<div class="post-metadata">

**Author:** ![Sarah](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sarah/32/1675_2.png) [@Sarah](https://discourse.processing.org/u/Sarah)\
**Post date:** [September 29, 2018, 8:25am UTC](https://discourse.processing.org/t/svg-layers-converted-to-shapes/3949/2 "2018-09-29T08:25:15Z")

</div>

Check out:  
[https://processing.org/examples/getchild.html](https://processing.org/examples/getchild.html)  
[https://processing.org/reference/PShape\_getChild\_.html](https://processing.org/reference/PShape_getChild_.html)

---

<div class="post-metadata">

**Author:** ![Geez](https://avatars.discourse-cdn.com/v4/letter/g/a587f6/32.png) [@Geez](https://discourse.processing.org/u/Geez)\
**Post date:** [September 29, 2018, 8:38pm UTC](https://discourse.processing.org/t/svg-layers-converted-to-shapes/3949/3 "2018-09-29T20:38:14Z")

</div>

@Sarah Many thanks! 👌
