First some context. I am jumping in the middle of an existing project that is using ThinkGeo for some mapping. I have done a little with ThinkGeo, but this is the first time that i've needed to add a shape / layer. The documentation I did find wasn't overly helpful, so if someone could point me in the right direction, I'd appreciate it.
Ok, so here's what I need to do. I have a map that displays a bunch of points (50k+). These points are grouped into related collections. So lets say that 50k points are split into 50 groups. What I need to do is draw a box around the outside of each group. These points are not always in a straight line, and keeping the box tight to the points is important.
The plan we came up with is to create a LineShape for each group of points, and then do something (not sure what exactly) with the display to give the appearance of a box around the points.
What I've done so far is to create a LineShape out of each groups vertices:
List<Vertex> linePoints = new List<Vertex>();
LineShape line;
foreach (myObject dataPoint in stripPoints)
{
PointShape point = new PointShape(Convert.ToDouble(dataPoint.Longitude, CultureInfo.InvariantCulture),
Convert.ToDouble(dataPoint.Latitude, CultureInfo.InvariantCulture));
linePoints.Add(new Vertex(point));
}
line = new LineShape(linePoints);
Feature feature = new Feature(line);
Where I seem to be stuck is knowing what to do with this shape. I made the assumption that i needed a new layer, could add it to an existing overlay, and then add my shape to the layer. When i do this i get an error "FeatureSource is not in a transaction". So then i started digging deeper into the ThinkGeo forums and found a post talking about creating a shapefile and adding that to the map. Should this really be the route that I need to go? It makes sense to me, but in the end, I just need some guidance from the experts on what's the best way to go.