Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mapping software suggestion?

Status
Not open for further replies.

woetech

Programmer
Mar 13, 2009
26
US
Hello. I'm looking for a somewhat basic ASP.NET mapping software (or code for doing what I need in Virtual Earth or Google Maps or something) that allows me to not only add layers (such as US Counties) but to also be able to draw a polygon (like a square or circle) and within that polygon have it automatically calculate the percentage of each layer section as well as the area of the polygon.

So, for example, I put a layer on a US map of all counties. I draw a circle around 4 different counties. Based on the circle I drew, it shows the percentage of each county within (like 22%, 43%, 34%, 1%). It sounds or seems like it would not be too difficult, but I've had some experience with drawing polygons on Virtual Earth maps and for the life of me, it was hard enough just finding the damn area of a custom polygon (if I could at all) nevertheless percentages of objects encompassed in a layer.

Anyway, I know this may be a horrible place to post a topic like this, but I just don't really know where to start, other than the fact it must work with our ASP.NET web apps. Thanks!
 
A framework like NetTopologySuite may give you some of the answers you're after. Combining that with a spatially enabled database would enable you to store the polygons of all the counties (in real world coordinates) & calculate their area as well as giving you the area of the intersection between them and custom polygon.

A query similar to (from the top of my head, not checked)
Code:
SELECT
County.STArea() AS CountyArea,
County.STIntersection(@CustomArea).STArea() AS Intersect
FROM
dbo.Counties
WHERE
County.STIntersects(@CustomArea)=1

would work in SQL Server 2008.

hth

Ben

----------------------------------------------
Ben O'Hara
David W. Fenton said:
We could be confused in exactly the same way, but confusion might be like Nulls, and not comparable.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top