Basically this: but in ✨javascript✨. Each soil texture is considered a polygon, represented by an array of coordinates of the vertexes. Check it out