GeoAPI.GeometryServiceProvider.Instance = new NetTopologySuite.NtsGeometryServices();
IGeometryFactory geometryFactory = new GeometryFactory();
List<IGeometry> lines = new List<IGeometry>();
WKTReader rdr = new WKTReader(geometryFactory);
lines.Add(rdr.Read("LINESTRING (0 0, 10 0)"));
lines.Add(rdr.Read("LINESTRING (10 0, 10 10)"));
lines.Add(rdr.Read("LINESTRING (10 10, 0 10)"));
lines.Add(rdr.Read("LINESTRING (0 10, 0 0)"));
Polygonizer polygonizer = new Polygonizer();
polygonizer.Add(lines);
IList<IGeometry> polys = new System.Collections.Generic.List<IGeometry>(polygonizer.GetPolygons());
This is where I am trying to display the polygon, in the phone xaml file. The first error message I got was "cannot convert from systems.collections.generic.ilist<GeoAPI.geomertys.igeomerty> to windows.ui.xaml.uielement". As you can see, I have tried various different things, and have not been successful. There must be some kind of explicit cast (which I am obviously not familiar with), otherwise why use NetTopologySuite if you cannot display it in the app?
//g1.Children.Add(polygonizer.GetPolygons();
//Polygon p1 = polygonizer.GetPolygons().Cast<Polygon>
//PPPolygon.Points = lines.Cast < Windows.UI.Xaml.Shapes.Polygon.PointsProperty >
PPPolygon.Points = polygonizer.GetPolygons().Cast<PointCollection>;
--
You received this message because you are subscribed to a topic in the Google Groups "NetTopologySuite" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nettopologysuite/pwY5NZUidBc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nettopologysui...@googlegroups.com.
To post to this group, send email to nettopol...@googlegroups.com.
Visit this group at https://groups.google.com/group/nettopologysuite.
For more options, visit https://groups.google.com/d/optout.