World Wind Forums

Go Back   World Wind Forums > WorldWind .Net Development > Developers' Corner

Developers' Corner General World Wind development.

Reply
 
Thread Tools Display Modes
Old 11-10-2008, 06:30 AM   #1
Jason_Steven
Junior Member
 
Join Date: Nov 2008
Location: United Kingdom
Posts: 29
Jason_Steven is on a distinguished road
Question How to calculate area of an irregular polygon by 3D coordinates?

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?
Jason_Steven is offline   Reply With Quote
Old 11-10-2008, 09:22 AM   #2
m_k
Bored Explorer
 
m_k's Avatar
 
Join Date: Nov 2004
Location: Warsaw, Poland
Posts: 1,808
m_k is an unknown quantity at this point
Default

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)
__________________
Hot stuff: FAQ, forum search, DirectX, .NET, Video Card Compatibility list
m_k is offline   Reply With Quote
Old 11-10-2008, 11:13 PM   #3
mayra
Senior Member
 
Join Date: Feb 2008
Posts: 162
mayra is on a distinguished road
Default

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.
mayra is offline   Reply With Quote
Old 11-11-2008, 12:17 PM   #4
patmurris
WWJ Consultant
 
patmurris's Avatar
 
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
patmurris is an unknown quantity at this point
Default

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?
__________________
My World Wind Java Blog & WW.net Plugins page
patmurris is offline   Reply With Quote
Old 11-11-2008, 01:44 PM
Jason_Steven
This message has been deleted by Jason_Steven. Reason: no
Old 11-11-2008, 01:46 PM   #6
Jason_Steven
Junior Member
 
Join Date: Nov 2008
Location: United Kingdom
Posts: 29
Jason_Steven is on a distinguished road
Unhappy

Quote:
Originally Posted by patmurris View Post
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?
First,thank you very much!
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.
Jason_Steven is offline   Reply With Quote
Old 11-11-2008, 03:19 PM   #7
patmurris
WWJ Consultant
 
patmurris's Avatar
 
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
patmurris is an unknown quantity at this point
Default

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.
__________________
My World Wind Java Blog & WW.net Plugins page

Last edited by patmurris; 11-11-2008 at 03:21 PM.
patmurris is offline   Reply With Quote
Old 11-11-2008, 04:17 PM   #8
m_k
Bored Explorer
 
m_k's Avatar
 
Join Date: Nov 2004
Location: Warsaw, Poland
Posts: 1,808
m_k is an unknown quantity at this point
Default

BTW Pat, how this kind of area computation is (will be) done in WWJ 0.6?
__________________
Hot stuff: FAQ, forum search, DirectX, .NET, Video Card Compatibility list
m_k is offline   Reply With Quote
Old 11-11-2008, 06:15 PM   #9
patmurris
WWJ Consultant
 
patmurris's Avatar
 
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
patmurris is an unknown quantity at this point
Default

Quote:
Originally Posted by m_k View Post
BTW Pat, how this kind of area computation is (will be) done in WWJ 0.6?
Pretty much as i describe above.

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.
__________________
My World Wind Java Blog & WW.net Plugins page
patmurris is offline   Reply With Quote
Old 11-13-2008, 06:19 AM   #10
Jason_Steven
Junior Member
 
Join Date: Nov 2008
Location: United Kingdom
Posts: 29
Jason_Steven is on a distinguished road
Default

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!
Jason_Steven is offline   Reply With Quote
Reply

Tags
irregular polygon area


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 05:14 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.