![]() |
|
|||||||
| Developers' Corner General World Wind development. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Junior Member
Join Date: Nov 2008
Location: United Kingdom
Posts: 29
![]() |
I have an array with a set of points(x,y,z coordinates),and the number of points in an irregular polygon.How do I calculate the surface area of this closed polygon?
|
|
|
|
|
|
#2 |
|
Bored Explorer
Join Date: Nov 2004
Location: Warsaw, Poland
Posts: 1,808
![]() |
Check measure tool (or was it measure tool NG?) in the SVN repository - I think it has some function to measure area (it may also have the code to move polygon vertices)
|
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Feb 2008
Posts: 162
![]() |
You would probably be better off asking these kind of questions (ie: general directX/algorithm, not WW specific) in a more general forum, where there is a larger user base.
|
|
|
|
|
|
#4 |
|
WWJ Consultant
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
![]() |
You will probably need to tessellate or triangulate your polygon first, and then compute the sum of all the triangles area. However, if your points are not coplanar you'll have trouble doing so.
Are you trying to measure some terrain area? |
|
|
|
|
|
| Jason_Steven |
|
This message has been deleted by Jason_Steven.
Reason: no
|
|
|
#6 | |
|
Junior Member
Join Date: Nov 2008
Location: United Kingdom
Posts: 29
![]() |
Quote:
Yes,These points may be not coplanar.I am trying to measure some terrain area!I just downloaded the lastest code by SVN.It supplied an algorithm about irregular polygon area,but I doubt it a bit. |
|
|
|
|
|
|
#7 |
|
WWJ Consultant
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
![]() |
Maybe it will be easier to convert you cartesian points to lat-lon pairs and consider your polygon on a 'flat' projection like sinusoidal which is equal area. That would allow to compute the projected area (the one you would measure on a map). If you are looking for the 'real' surface area taking into account the terrain slopes, then things will be a tad more involved.
Last edited by patmurris; 11-11-2008 at 03:21 PM. |
|
|
|
|
|
#8 |
|
Bored Explorer
Join Date: Nov 2004
Location: Warsaw, Poland
Posts: 1,808
![]() |
BTW Pat, how this kind of area computation is (will be) done in WWJ 0.6?
|
|
|
|
|
|
#9 | |
|
WWJ Consultant
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
![]() |
Quote:
For projected area the polygon is tessellated and each triangle area is computed in a sinusoidal projection. For 'real' surface area an approximation is computed using a sampling grid and an overall slope factor for each cell that is 'inside' the ploygon. Note that real area is a very fishy concept due to the fractal nature of terrain and the limited resolution of elevation data. After trying out quite a few methods, the sampling grid is an acceptable approach - and not too slow. Use cases for such area are very few though. ![]() |
|
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Nov 2008
Location: United Kingdom
Posts: 29
![]() |
Can anyone supply some source code about it?
Thank you very much! I don't know that how to triangulate a irregular polygon and calculate the area of each triangle inside this polygon. It's very urgent. Thank you very much again! |
|
|
|
![]() |
| Tags |
| irregular polygon area |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| WW1.3.2-Plugin: Layer Edit | canosso | Add-ons & Scripts | 21 | 02-27-2010 04:37 AM |
| WW 1.3.2-Plugin: Skripter | canosso | Add-ons & Scripts | 33 | 03-22-2007 02:06 PM |
| add Urban Area mode as an icon on the toolbar! | Phil T | Add-ons & Scripts | 10 | 02-25-2005 04:48 PM |