I am storing a bunch of points into a database, and then querying them out. They have to be stored as one string. The points represent the lat long coordinates of the polygon we want to draw. This works great for one shape. However, it is doing very weird things if you try to make two shapes from one string(picture 1). If you try to make two shapes, and one of them has a hole, it looks like this(picture 2). It also tends to do some weird thing where it connects to (0,0) randomly. The points from this page are being used, and this is the verbatim string that is being parsed for all of these points: “((40 40, 20 45, 45 30, 40 40)), ((20 35, 10 30, 10 10, 30 5, 45 20, 20 35), (30 20, 20 15, 20 25, 30 20))”
This is being parsed correctly to be displayed as one polygon.
The goal is to have one entity be able to represent two shapes, and be able to have holes in those shapes.
If this can be accomplished in another way, I would like to know. I have thought about detecting the commas, then making separate shapes and joining them together (after they’re created) somehow. If this is a possibility, please show me how, or point me in the right direction. I’m fairly new to the API and finding somethings are hard sometimes.