I must be missing something simple. I have created a series of vertices to build a polygon. If i create a LineShape from them and add them to my layer, everything works perfectly:
Now, if i load that line into a PolygonShape and do the same process to add it to the layer, nothing shows up on my map. Do i need to do something differently when working with a PolygonShape vs a LineShape??
PolygonShape pathPart = new PolygonShape(line.GetWellKnownText().Replace("LINESTRING", "POLYGON(") + ")");
In both instances, the FeatureSource has the transaction open, and the layer is open. Also in both cases I set the defaultLineStyle and add the layer to the overlay, then refresh the map
Perfect. With this info I’m able to ditch the LineShape and WKT altogether and just new up a RingShape with my vertices.
The API Documentation and Code Community didn’t help much when I was looking for samples for doing this, or for some other simple things. Is there any other documentation that I can access that goes over some of these 101 type processes?
Unfortunately, we currently don’t have the documentation to explain high level, 101 type of topics such as explaining what style to use for what type of shape and why.You are right to express concern that we lack such a documentation. We have had in plan to have such a documentation for a long time. Soon, we will start working on that and the documentation will be in a Wikipedia format. Thank you for reminding us of how important this is that we finally bring to our users the most complete documentation.
But get an inxedOutOfRange exception on distance. So, I took a look at the NegativeBuffer code sample. What it's doing makes sense, however, in the GetPerimeter method, OuterRing is called to get a collection of vertices on the PolygonShape. My issue is that I'm using a MultiPolygonShape and not a PolygonShape. Is there an easy conversion here? Or better yet, is there an easy way to get a list of vertices for my MultiPolygonShape?
One other thing to add is that with the developer build we have fixed the Buffer method to support negative buffering. In the past we did not allow it but it is part of the next release to have the API accept negative values. If you get the latest developer build this should work for you if interested.
I would like to also comment that in the older versions of Map Suite, it is still possible to apply negative buffering. You can see that in the project of the Code Community, Negative Buffering.