You are here

Polygon display

Dear members,

Have got sets of X and Y coordinates for the polygon boundary. I have five polygons connected to each other. I would like to display these polygons so that I see the spaitial variation of the population in these different polygons.

If there is any one out there please help. I have tried to follow the example of the Hexagon but not succeeded.

Thanks

 

Forums: 

Oyoo,

Can you show me the format your coordinates are in? In the hexagons example, the coordinates are generated by the model. Is this the case with yours, or are they in a file?

Cheers

    --Jasper

Dear Jasper,

Thanks for the response. My coordinates have save in .cvs format.  I am importing to the model using the table function, and put the x-coord separately from the Y-coordinates.  A sample of the coordinates I am importing is shown below.  The file is big, if you could avail me the email address I can mail the file.

X-cood

Y-cood

453860.5

238787.7

453883.5

238787.8

453944.4

238778.3

454135.5

238769.6

454197.6

238761.6

454264.9

238713.9

 

Just send it to support@simulistics.com. How is it specified which coordinates belong to which polygon? This is the thing that has to be dealt with carefully when loading the file into the model, because you would typically have a fixed membership submodel for the polygons, and then inside that, a variable-membership or per-record submodel (unless they are regular) for the vertices of each polygon.

    --Jasper

 

Dear Jasper,

Have sent the coordinates data to the support group mail. The coordinates of the each polygons are defined. Have highlighted them with different colours.

Cheers

I sorted it!

Fortunately your data has index numbers in columns for both the outer (polygon) and inner (vertex) levels. This means that both levels of submodels can use number of records in file to set their memberships, rather than having to have a fixed number. See the attached model.

Unfortunately Simile cannot use number 0 as an index (except for a time series). I simply deleted the rows containing vertex 0 for each polygon, as their co-ordinates were the same as those of the last vertex for their polygon.

I then exported the data from my spreadsheet as Text CSV format (extension .csv) which can be read by Simile.

To load the data when the model runs, click on the 'get values from file' icon beside each parameter name, stay in the 'data in column' tab, and browse to your .csv file. Now drag two column headers to the "Use as indices" box; first the "Code" because it is actually the polygon number, then the "Polygon" because it is the vertex number, i.e., index of the inner submodel. Drag the appropriate data point (X or Y -cood) to the "Use as data" field.

Having done this you can use the 'Save values' button in the parameter dialogue to remember this setup. The model is now running and you can add the polygon display tool. Choose 'coords from model' and select the X and Y variables. I also added a variable to use as colour; it is just the polygon index, and it has the range 1 to 5 built in so they each get a visible colour.

You do not see the map because the display tool does not automatically adjust its offset and zoom to show the actual position. You have to hit 'zoom to fit' (3rd button from left) to get it on-screen.

OK you can now use this to start building your model's functionality. Please ask again if anything gives you trouble.

Cheers

   --Jasper

 

Jasper,

Thank for the support. I loaded the data per the instructions but on running the model I am getting the error message attached.

The other thing which prompted on openning template model was that the template is on version 5.2 whereas I am using version 4.9.

 

I'm sorry, I cannot read the text in those .jpegs!

  --Jasper

The error which apear after loading the x and y coordinates is "while  attempting to load the parameter value "\map template\polygons\vertices\x" at incidice 2855 the following problem occured: Data value (empty) is not a number."

Does your data have a value for indice 2855?

It does not have. But I am using the dataset I email where some polygons have less points. I have followed the instruction you gave event with using the template you attached.

Hi

When I load the data empty values appears as not all the polygons have equal number of points. On running the model it detects the empty value. Could be that version of the simile I am using cannot handle the cell with empty value.

I am having trouble understanding this message. Why is it looking for a value at index 2855? It would only need this if there were an index greater than 2855 present. There are no indices that large in the data, and the .csv file only has 1744 lines! Also these are 2-d arrays (actually lists of lists) we are loading here, so there should be two indices.

I see that polygon 5 has 284 vertices. Perhaps the missing indices was 285,5? That might happen if you had the index column headers the wrong way round. I suspect this is the case because the column headed "Polygon" actually contains the vertices, while the polygon numbers are in a column headed "Code" so this should be the first (topmost) index. Please check that you have them the right way round.

Cheers

    --Jasper

 

I have rearranged the polygon vertices starting with one with the lowest.  I loaded into the fields with red mark starting with the code for the polygons then polygon column for the vertices. When I click on the view/edit button, I get five rows which depict the number of polygons and 445 rows for the polygon with highest vectices. The polygons having vertices less than 445 have the word "empty" in the cells position after maximum vertice e.g.  polygon with 284 vertices the cell 285 is having the word "'empty". When you load the file, the error sent on clicking ok button is the polygon number followed by the vertices. For instance, in this case the error would show x 1 285 where 1 is the polygon number and 285 is the next cell just after the end of the vertices. This is repeated for the y value as y 1 285.

Cheers

 

You need Simile 5

I just got a copy of Simile 4.9 out and tried your problem; I got the same result you report here. It seems that version 4 does not allow you to have different member counts of a per-record submodel in each of its parent submodels.

Please contact sales to get an upgrade to v5. I will make sure we give you a discount for the trouble you have had with this.

    --Jasper