This project has moved and is read-only. For the latest updates, please go here.

some polygon geometries not filling.

Mar 29, 2011 at 7:41 AM

I'm working on a little bit of a hobby project for a game.

I've managed to use an implementation of the voronoi diagram to display some point data as polygons, each point has now got a referenced polygon.

I'm having some trouble with some of the polygons not filling correctly and can't seem to pin down why, theres some 1500 shapes at leaset and I have visually notice maybe a dozen that aren't displaying correctly.

The polygons should be side by side, is there any issues with rendering geometries that could possibly overlap?

sample image of rendering below.

And a sample of one of the shapes that are not rendering.

POLYGON ((-4.73411251107949E+17 1.31920374474498E+17,-4.62382053013737E+17 1.40603786674937E+17,-4.48322841425269E+17 1.74171569868645E+17,-4.51327234230013E+17 1.85658207894542E+17,-4.58055932016522E+17 2.02159567382751E+17,-4.880208556311E+17 2.03180796901159E+17,-5.31088035797746E+17 1.99582427175063E+17,-6.31159937208696E+17 1.81574214549349E+17,-4.73411251107949E+17 1.31920374474498E+17))

Thanks in advance, Great Project!

Mar 29, 2011 at 8:34 AM

Hello jamo181,

if I get your sample image right, you have set the maps backgroundcolor to black and the rendering style for the polygons is white fill and thin black outline?

If that is true, maybe your VoronoiDiagramBuilder does not work as expected and at those places there is no polygon?

The sample polygon looks alright to me. How did you evaluate that this polygon is not rendered?

cheers FObermaier

Mar 29, 2011 at 9:20 AM

Yes the the polygons are white fill with a black outline.

I'm using the same dataset to show a label for the polygons as well and the labels render in the balck spaces .... I would have thought the labels would not show if the feature is missing.

Mar 29, 2011 at 9:48 AM

Do you use the polygons for labeling or the input points for the voronoi diagram builder?

If you can identify the feature polygon that is not being rendered (its id), maybe you can step through the rendering routine to see what goes on.

I did not experience anything like you mention so far.


Mar 30, 2011 at 7:57 AM

I found the problem.

Nothing to do with the rendering ... Phew.

The program begins with a single geometry featuretable, I was reusing the same geometry table later to create the voronoi cells, I was not creating a new one and instead overwritting the point geometry with polygons.

If that makes sense..... a side note, import row does not import the geometry, probably by design but just FYI :)

FeatureDataTable polyFDT = pointDataSet.Tables[0].Clone();
            foreach (FeatureDataRow dr in systemsDataSet.Tables[0])
                ((FeatureDataRow)polyFDT.Rows[polyFDT.Rows.Count-1]).Geometry = dr.Geometry;

Thanks for your help fObermaier, I'll keep the community posted on the project, It's long term, i'm just a hobbist programmer :)