1

In preparation for a "Risk Game" programming project, I thought it would be best if I could represent the boundary of countries on a board by a list of pixel coordinates to create a polygon object. But I'm struggling to find software/methods for generating such coordinate-maps.

It seems that inkscape could be of help to me, but I have a few concerns:

1) can I define the boundaries of multiple objects in the same image?

2) can I define the coordinates relative to the top left-corner of the image, the same measurement used by java? It appears that inkscape simply overlays my image over a document rather than working with the image itself.

3) when I trace a gif with the method suggested here and look at the file generated, I'm not sure what to make of the data, they don't look like pairs of coordinates I'd expect.

4) Eventually I want to convert the data into a JSON form, ie

{
    countries: {
        {
            id: 1
            name: "Venezuela",
            border: {
                {2, 3} // Countries that border it by id
            }
            bounds: {
                {x, y},
                {x + 1, y},
                ...,
                {x, y}
            }
        },
        ...
    }
}

by x + 1, i mean to say the incremental difference in points around the border that could allow me to generate the polygon line segment by line segment eventually circling back to the original point

To help simplify the problem I have an image that is just black and white with nothing but the borders.

Is there other software that would be easier to use or is there a way to address these concerns with inkscape?

If there is anything I can do to clarify the question let me know. Also I was debating on whether this is best fit on Stack Overflow or SuperUser (I thought this because it's a matter of finding software that can extract those points for me) but if you think this would be better suited on a different exchange site let me know.

0

You must log in to answer this question.

Browse other questions tagged .