title: Is there a predefined method to compute area of a polygon in Nutiteq?
body: <p>I ask <strong>IN NUTITEQ</strong>, I know the way to perform this with <code>GoogleApi</code> with <code>computeArea()</code> but I have not found anything in <code>Nutiteq sdk/snapshot</code>.  </p>
  
  <p>Thanks in advance.  </p>
  
  <p>p.s. I know many methods to compute the area but I want to call something own of <code>Nutiteq</code> </p>
  
  <p><strong>EDIT</strong>:</p>
  
  <p>There are no built-in Method, thanks for the fast answer Jaak, so I researched and found 2 Methods, both of them under WSG84 Projection. I developed a little programm to compare both of them and then I compared to a KML Tool, which computes area of a Polygon.</p>
  
  <p><a href="https://gis.stackexchange.com/questions/711/how-can-i-measure-area-from-geographic-coordinates">how-can-i-measure-area-from-geographic-coordinates</a></p>
  
  <p><a href="http://geographiclib.sf.net/html/classGeographicLib_1_1PolygonArea.html" rel="nofollow noreferrer">A-link-to-a-Geographic-Framework</a></p>
  
  <p>And the <a href="http://extension.unh.edu/kmlTools/index.cfm" rel="nofollow noreferrer">results</a> with a kml tool of University of New Hampshire</p>
  
  <p><code>12197.38184</code></p>
  
  <pre><code>import java.lang.Math.*;
  import net.sf.geographiclib.*;
  
  public class ComputeAreaTest {
  
    private static double[][] moorwiese_coords = {{12.925634f,48.427168f}, 
                                                  {12.926825f,48.427217f},                                          
                                                  {12.926788f,48.428385f}, 
                                                  {12.926069f,48.428374f},
                                                  {12.925431f,48.42825f}, 
                                                  {12.925624f,48.427192f},                                                 
                                                  {12.925634f,48.427168f}};
  
    protected static double computeArea() {
        double area=0.0;
        double earthRadius = 6378137.0f;
  
        int size = moorwiese_coords.length;     
  
        if (size &gt; 2) {
            double[] p1 = new double[2];
            double[] p2 = new double[2];
  
            for (int i=0; i&lt;size-1; i++) {
                p1 = moorwiese_coords[i];
                p2 = moorwiese_coords[i+1];
                area += Math.toRadians(p2[0] - p1[0]) * (2 +  
                Math.sin(Math.toRadians(p1[1]) ) + Math.sin(Math.toRadians(p2[1])) );
            }
  
            area = area * earthRadius * earthRadius / 2.0;
        }   
  
        return area;  
    }
  
    protected static double computeAreaWithGeographicLib() {
  
      int size = moorwiese_coords.length;
      PolygonArea p = new PolygonArea(Geodesic.WGS84, false);
  
      try {
  
          for (int i=0;i&lt;size;i++) {
              p.AddPoint(moorwiese_coords[i][4], moorwiese_coords[i][0]);
          }   
      }
      catch (Exception e) {}
      PolygonResult r = p.Compute();
  
      return r.area;        
    }
  
    public static void main(String[] args) {
  
  
    double areaGeoLib = computeAreaWithGeographicLib();  
  
    double area = computeArea();  
  
        System.out.println("Area: " + (-1)*area + "\nArea(GeoLib): "+areaGeoLib);
    }
  }
  </code></pre>
  
  <p><code>Output
  Area: 12245.282587113787
  Area(GeoLib): 12254.95547034964</code></p>
  
  <p>I found not very suitable for accurate use ( Yes, under 0.5% Error may be unaccurate for many environments) but useful to learn how to compute the area of a irregular Polygon.</p>