Discussion:
[Geotools-gt2-users] how to calculate area of a polygon by coordinates
Thiago Turim
2011-09-07 19:50:56 UTC
Permalink
how to calculate area of a polygon by coordinates ?
I have 4 coordenates (latitude, longitude) and i'd like to calculate area.
can Geotools do this calculation ?

Thanks.
Oleksandr Huziy
2011-09-07 19:58:56 UTC
Permalink
Yes,

you will need to densify your polygon (put many points along the edges) and
then transform it to
the equal area projection. Then you can use its getArea() method.

At least this is the way I would use... Maybe someone knows an easier way.
--
Oleksandr Huziy

2011/9/7 Thiago Turim <***@hotmail.com>

> how to calculate area of a polygon by coordinates ?
> I have 4 coordenates (latitude, longitude) and i'd like to calculate area.
> can Geotools do this calculation ?
>
> Thanks.
>
>
> ------------------------------------------------------------------------------
> Using storage to extend the benefits of virtualization and iSCSI
> Virtualization increases hardware utilization and delivers a new level of
> agility. Learn what those decisions are and how to modernize your storage
> and backup environments for virtualization.
> http://www.accelacomm.com/jaw/sfnl/114/51434361/
> _______________________________________________
> Geotools-gt2-users mailing list
> Geotools-gt2-***@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>
Thiago Turim
2011-09-07 20:14:51 UTC
Permalink
Huziy,

Thanks for reply.

But, i'm a beginner with Geotools. You can put a sample code for this? I do not know where to start.

Thanks.




From: ***@hotmail.com
To: geotools-gt2-***@lists.sourceforge.net
Date: Wed, 7 Sep 2011 19:50:56 +0000
Subject: [Geotools-gt2-users] how to calculate area of a polygon by coordinates








how to calculate area of a polygon by coordinates ?
I have 4 coordenates (latitude, longitude) and i'd like to calculate area.
can Geotools do this calculation ?

Thanks.
Michael Bedward
2011-09-08 03:28:48 UTC
Permalink
Hello,

Oleksandr's suggestion is how I would do this as well, and you'll find
some commented example code below. However, if you are looking at
GeoTools just to do this one task I think you would be much better off
doing it some other way (e.g. with one of the many free GIS programs
such as uDig). Learning GeoTools, plus the Maven build tool which you
are more or less forced to use, just to do this would be like digging
up iron ore and chopping down a tree to make your own hammer just to
hit one nail :)

If you do want to learn GeoTools, can I suggest that to help you
understand the code below, you first look at two of the tutorials,
Quickstart and Geometry CRS. You'll find both of them on this page:

http://docs.geotools.org/latest/userguide/tutorial/index.html

Finally, the example code below illustrates one way of creating the
geographic polygon, transforming it into an equal-area map projection,
and calculating its area. To run this code with Maven you will need to
include the gt-main and gt-referencing modules. If you are making use
of the GeoTools library of map projections (see comments in code) you
will also need to include the gt-epsg-hsql module. Including modules
in an application is explained in the Quickstart tutorial.

Hope this helps to get you started.

Michael


package org.geotools.userlist;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

import com.vividsolutions.jts.densify.Densifier;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.GeometryFactory;
import com.vividsolutions.jts.geom.LinearRing;

import org.geotools.geometry.jts.JTS;
import org.geotools.referencing.CRS;
import org.geotools.referencing.crs.DefaultGeographicCRS;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.referencing.operation.MathTransform;

public class AreaFromLatLons {

public static void main(String[] args) throws Exception {
// Example data: vertex coords of a unit rectangle
double[] x = { -43, -43, -44, -44}; // longitudes
double[] y = { -23, -22, -22, -23}; // latitudes

// calculate area
double area = new AreaFromLatLons().getArea(x, y);
System.out.println("Polygon area: " + area);
}

private double getArea(double[] lon, double[] lat) throws Exception {
if (lon.length < 3 || lon.length != lat.length) {
throw new IllegalArgumentException("Bummer: bad arguments");
}
final int N = lon.length;

// Create the polygon
GeometryFactory geomFactory = new GeometryFactory();
Coordinate[] coords = new Coordinate[N + 1];

for (int i = 0; i < N; i++) {
// remember X = longitude, Y = latitude !
coords[i] = new Coordinate(lon[i], lat[i]);
}
// closing coordinate (same as first coord
coords[N] = new Coordinate(coords[0]);

LinearRing polygonBoundary = geomFactory.createLinearRing(coords);
LinearRing[] polygonHoles = null;
Geometry polygon = geomFactory.createPolygon(polygonBoundary,
polygonHoles);

// Densify the polygon by adding extra vertices to its edges so
// that when it is reprojected they will approximate curves
// more closely
double vertexSpacing = polygon.getLength() / 1000.0; // for example
Geometry densePolygon = Densifier.densify(polygon, vertexSpacing);
// Create a MathTransform to convert the vertex coordinates from
// lat-lon (assumed to be WGS84 in this example) to an equal area
// projection.
//
// If there is a suitable map projection availble in GeoTools you
// can retrieve it like this...
// US National Atlas Equal Area projection (code EPSG:2163)
// CoordinateReferenceSystem equalAreaCRS =
CRS.decode("EPSG:2163", true);
//
// In this example we brew one for Brazil using a non-standard
projection
// cooked up by ESRI which we read from a file (see bottom of
code for file
// contents)
String wkt = getWKTFromResource("esri-102033.wkt");
CoordinateReferenceSystem equalAreaCRS = CRS.parseWKT(wkt);
MathTransform transform =
CRS.findMathTransform(DefaultGeographicCRS.WGS84, equalAreaCRS, true);

// Reproject the polygon and return its area
Geometry transformedPolygon = JTS.transform(densePolygon, transform);
return transformedPolygon.getArea();
}

private String getWKTFromResource(String resName) throws Exception {
InputStream strm = this.getClass().getResourceAsStream(resName);
BufferedReader reader = new BufferedReader(new InputStreamReader(strm));

StringBuilder sb = new StringBuilder();

String line;
while ((line = reader.readLine()) != null) {
sb.append(line);
}

return sb.toString();
}
}

// Contents of the file esri-102033.wkt
//
// PROJCS["South_America_Albers_Equal_Area_Conic",
// GEOGCS["GCS_South_American_1969",
// DATUM["South_American_Datum_1969",
// SPHEROID["GRS_1967_Truncated",6378160,298.25]],
// PRIMEM["Greenwich",0],
// UNIT["Degree",0.017453292519943295]],
// PROJECTION["Albers_Conic_Equal_Area"],
// PARAMETER["False_Easting",0],
// PARAMETER["False_Northing",0],
// PARAMETER["longitude_of_center",-60],
// PARAMETER["Standard_Parallel_1",-5],
// PARAMETER["Standard_Parallel_2",-42],
// PARAMETER["latitude_of_center",-32],
// UNIT["Meter",1],
// AUTHORITY["EPSG","102033"]]
Thiago Turim
2011-09-08 13:27:47 UTC
Permalink
Michael Bedward
2011-09-09 03:25:29 UTC
Permalink
Hi Thiago,

> Sorry for bother you again.
>
> This is correcte implementation:
>     private static CoordinateReferenceSystem getDefaultCRS() {
>         return DefaultGeographicCRS.WGS84;
>     }

No. That method (in the class we talked about off-list) should return
a CRS that you want to be the default for area calculations. You
convert the WGS84 coordinates into this projection. E.g. in the
previous example, with the AreaFromLatLons class, we used the South
America Albers Equal Area Conic projection.

> More question, the result is in meters ?
>

Yes, in the example code the result is in square metres. The CRS you
choose for calculations defines the distance unit. If you look at the
WKT definition for the CRS used in the example you will see this:

// UNIT["Meter",1],

Hope that helps, but if you have more questions or code snippets that
you want to check please feel free to post them to the list - that's
what it is here for :)

Michael
Thiago Turim
2011-09-09 11:49:33 UTC
Permalink
Michael Bedward
2011-09-09 12:36:02 UTC
Permalink
Hello Thiago,

> I execute class and the result was similar to this site,
> http://www.daftlogic.com/projects-google-maps-area-calculator-tool.htm
>
> I think it must be correct.

Cool !

> I got some exceptions:
>
>  org.opengis.referencing.FactoryException: Failed to connect to the EPSG
> database.

My first guess is that you don't have the gt-epsg-hsql jar on your
classpath. The complete set of jars required (according to Maven) is
this...

com.vividsolutions:jts:jar:1.12
commons-pool:commons-pool:jar:1.5.4
hsqldb:hsqldb:jar:1.8.0.7
java3d:vecmath:jar:1.3.2
javax.media:jai_core:jar:1.1.3
jdom:jdom:jar:1.0
net.java.dev.jsr-275:jsr-275:jar:1.0-beta-2
org.geotools:gt-api:jar:8-SNAPSHOT
org.geotools:gt-epsg-hsql:jar:8-SNAPSHOT
org.geotools:gt-main:jar:8-SNAPSHOT
org.geotools:gt-metadata:jar:8-SNAPSHOT
org.geotools:gt-opengis:jar:8-SNAPSHOT
org.geotools:gt-referencing:jar:8-SNAPSHOT
xerces:xercesImpl:jar:2.4.0

Michael
Thiago Turim
2011-09-09 12:57:25 UTC
Permalink
Michael Bedward
2011-09-10 06:11:59 UTC
Permalink
Hello Thiago,

> In this sample, works only for South America, right ?

Yes. I chose an equal-area CRS that covered Brazil for the example.

> This link
> http://svn.geotools.org/trunk/modules/plugin/epsg-extension/src/main/resources/org/geotools/referencing/factory/epsg/esri.properties
> contains many ESRI.
> Each line belongs to a location on the globe?

Yes that's right. But not all of those are equal-area projections
which is the type that you want to use for your application.

You can also search sites such as spatialreference.org to find useful
projections...

http://spatialreference.org/ref/?page=1&search=equal+area

Michael
Thiago Turim
2011-09-10 13:19:07 UTC
Permalink
Michael Bedward
2011-09-11 03:14:19 UTC
Permalink
On 10 September 2011 23:19, Thiago Turim <***@hotmail.com> wrote:
>
> I can run this class in web project ?
>

I think it should be ok but I don't work with web applications myself.
Lots of other list members use GeoTools in web frameworks, so the best
thing to do is try it and if you have any problems start a new thread
here.

Michael
Thiago Turim
2011-09-12 19:22:37 UTC
Permalink
Michael Bedward
2011-09-13 02:06:21 UTC
Permalink
Hi Thiago,

That's great - thanks for posting the feedback. I might turn this into
a tutorial or example for the GeoTools docs.

Michael

On 13 September 2011 05:21, Thiago Turim <***@hotmail.com> wrote:
> Ok Michael.
>
> I tested one simple web application, and seems it works.
>
> Thnaks for help.
>
unknown
1970-01-01 00:00:00 UTC
Permalink
--_ae1ca32b-ea86-4296-b2e9-4e13a6fd7f77_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


Micheal,

Sorry for bother you again.

This is correcte implementation:
private static CoordinateReferenceSystem getDefaultCRS() {
return DefaultGeographicCRS.WGS84;
}


Main.java
public static void main(String[] args) throws Exception {
PolygonAreaCalculator calc = new PolygonAreaCalculator();

double[] latitude = new double[4];
double[] longitude = new double[4];

latitude[0] = 51.5174723;
latitude[1] = 51.515259;
latitude[2] = 51.513329;
latitude[3] = 51.51738;

longitude[0] = -0.0899537;
longitude[1] = -0.086623;
longitude[2] = -0.08896;
longitude[3] = -0.08186;

double area = calc.getArea(longitude, latitude);

System.out.println(area);
}

More question, the result is in meters ?

Thanks.


> Date: Thu, 8 Sep 2011 22:33:16 +1000
> Subject: Re: [Geotools-gt2-users] how to calculate area of a polygon by coordinates
> From: ***@gmail.com
> To: ***@hotmail.com
>
> Hi Thiago,
>
> OK, I understand. Well, you could adapt the example into an API
> convenient for your application and then compile it as a jar either on
> its own or bundled with its dependencies. I just checked and there
> are not many dependencies required:
>
> +- org.geotools:gt-main:jar:8-SNAPSHOT:compile
> | +- org.geotools:gt-api:jar:8-SNAPSHOT:compile
> | +- com.vividsolutions:jts:jar:1.12:compile
> | | \- xerces:xercesImpl:jar:2.4.0:compile
> | +- jdom:jdom:jar:1.0:compile
> | \- javax.media:jai_core:jar:1.1.3:compile
> +- org.geotools:gt-referencing:jar:8-SNAPSHOT:compile
> | +- java3d:vecmath:jar:1.3.2:compile
> | +- commons-pool:commons-pool:jar:1.5.4:compile
> | \- org.geotools:gt-metadata:jar:8-SNAPSHOT:compile
> | \- org.geotools:gt-opengis:jar:8-SNAPSHOT:compile
> | \- net.java.dev.jsr-275:jsr-275:jar:1.0-beta-2:compile
> \- org.geotools:gt-epsg-hsql:jar:8-SNAPSHOT:compile
> \- hsqldb:hsqldb:jar:1.8.0.7:compile
>
> Plus, you are probably using some of those already. So, if you don't
> use Maven as your build tool, you could just download those jars
> manually from the GeoTools repository:
> http://download.osgeo.org/webdav/geotools/
>
> The code below shows how you might modify the original example into
> something that you could compile into a jar for your app to use. You
> need to write the static getDefaultCRS() method to do something
> appropriate for your use case (e.g. to read WKT for a map projection
> as in the example).
>
> Hope this helps.
>
> Michael
>
>
> import com.vividsolutions.jts.densify.Densifier;
> import com.vividsolutions.jts.geom.Coordinate;
> import com.vividsolutions.jts.geom.Geometry;
> import com.vividsolutions.jts.geom.GeometryFactory;
> import com.vividsolutions.jts.geom.LinearRing;
>
> import org.geotools.geometry.jts.JTS;
> import org.geotools.referencing.CRS;
> import org.geotools.referencing.crs.DefaultGeographicCRS;
> import org.opengis.referencing.FactoryException;
> import org.opengis.referencing.crs.CoordinateReferenceSystem;
> import org.opengis.referencing.operation.MathTransform;
>
> /**
> * Provides methods to calculate the area, in square metres,
> * of polygons defined by lat-lon vertices.
> */
> public class PolygonAreaCalculator {
> private static final double TOL = 1.0e-8;
>
> private static final CoordinateReferenceSystem
> DEFAULT_CALCULATION_CRS = getDefaultCRS();
>
> private static CoordinateReferenceSystem getDefaultCRS() {
> // EDIT THIS METHOD TO SOMETHING SUITABLE FOR YOUR
> // APPLICATION AND DATA
> throw new UnsupportedOperationException("Not yet implemented");
> }
>
> private final GeometryFactory geomFactory;
> private final CoordinateReferenceSystem calculationCRS;
> private final MathTransform transform;
>
>
> public PolygonAreaCalculator() {
> this(null);
> }
>
> /**
> * Creates a new instance and sets the coordinate reference system to
> * use for area calculations. A null argument or empty string means
> * use the default reference system.
> *
> * @param epsgCode EPSG code for the coordinate reference system
> */
> public PolygonAreaCalculator(String epsgCode) {
> try {
> if (epsgCode == null || epsgCode.trim().length() == 0) {
> calculationCRS = DEFAULT_CALCULATION_CRS;
> } else {
> if (!epsgCode.startsWith("EPSG:")) {
> epsgCode = "EPSG:" + epsgCode;
> }
> calculationCRS = CRS.decode(epsgCode, true);
> }
>
> transform = CRS.findMathTransform(
> DefaultGeographicCRS.WGS84, calculationCRS, true);
> } catch (FactoryException ex) {
> throw new RuntimeException(ex);
> }
>
> this.geomFactory = new GeometryFactory();
> }
>
> /**
> * Calculates the area of a polygon defined by the provided
> * geographic vertex coordinates.
> *
> * @param longitude longitudes of vertices
> * @param latitude latitudes of vertices
> */
> public double getArea(double[] longitude, double[] latitude)
> throws Exception {
> if (longitude == null || latitude == null) {
> throw new IllegalArgumentException("arguments must not be null");
> }
> if (longitude.length != latitude.length) {
> throw new IllegalArgumentException("Bummer: bad arguments");
> }
>
> int n = longitude.length;
> boolean firstCoordRepeated =
> Math.abs(longitude[0] - longitude[n-1]) < TOL &&
> Math.abs(latitude[0] - latitude[n-1]) < TOL;
>
> final int N;
> if (firstCoordRepeated) {
> N = longitude.length - 1;
> } else {
> N = longitude.length;
> }
>
> if (N < 3) {
> // not a polygon - should probably log a warning or
> // throw an exception
> return 0;
> }
>
>
> // Create the polygon
> Coordinate[] coords = new Coordinate[N + 1];
>
> for (int i = 0; i < N; i++) {
> coords[i] = new Coordinate(longitude[i], latitude[i]);
> }
> coords[N] = new Coordinate(coords[0]);
>
> LinearRing polygonBoundary = geomFactory.createLinearRing(coords);
> LinearRing[] polygonHoles = null;
> Geometry polygon = geomFactory.createPolygon(polygonBoundary,
> polygonHoles);
>
> // Densify the polygon by adding extra vertices to its edges so
> // that when it is reprojected they will approximate curves
> // more closely
> double vertexSpacing = polygon.getLength() / 1000.0; // for example
> Geometry densePolygon = Densifier.densify(polygon, vertexSpacing);
>
>
> // Reproject the polygon and return its area
> Geometry transformedPolygon = JTS.transform(densePolygon, transform);
> return transformedPolygon.getArea();
> }
>
> }

--_ae1ca32b-ea86-4296-b2e9-4e13a6fd7f77_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
Micheal,<br><br>Sorry for bother you again.<br><br>This is correcte implementation: <br>&nbsp;&nbsp;&nbsp; private static CoordinateReferenceSystem getDefaultCRS() {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return DefaultGeographicCRS.WGS84;<br>&nbsp;&nbsp;&nbsp; }<br><br><br>Main.java<br>public static void main(String[] args) throws Exception {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; PolygonAreaCalculator calc = new PolygonAreaCalculator();<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; double[] latitude = new double[4];<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; double[] longitude = new double[4];<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; latitude[0] = 51.5174723;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; latitude[1] = 51.515259;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; latitude[2] = 51.513329;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; latitude[3] = 51.51738;<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; longitude[0] = -0.0899537;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; longitude[1] = -0.086623;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; longitude[2] = -0.08896;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; longitude[3] = -0.08186;<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; double area = calc.getArea(longitude, latitude);<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; System.out.println(area);<br>&nbsp;&nbsp;&nbsp; }<br><br>More question, the result is in meters ?<br><br>Thanks.<br><br><br><div>&gt; Date: Thu, 8 Sep 2011 22:33:16 +1000<br>&gt; Subject: Re: [Geotools-gt2-users] how to calculate area of a polygon by coordinates<br>&gt; From: ***@gmail.com<br>&gt; To: ***@hotmail.com<br>&gt; <br>&gt; Hi Thiago,<br>&gt; <br>&gt; OK, I understand. Well, you could adapt the example into an API<br>&gt; convenient for your application and then compile it as a jar either on<br>&gt; its own or bundled with its dependencies. I just checked and there<br>&gt; are not many dependencies required:<br>&gt; <br>&gt; +- org.geotools:gt-main:jar:8-SNAPSHOT:compile<br>&gt; | +- org.geotools:gt-api:jar:8-SNAPSHOT:compile<br>&gt; | +- com.vividsolutions:jts:jar:1.12:compile<br>&gt; | | \- xerces:xercesImpl:jar:2.4.0:compile<br>&gt; | +- jdom:jdom:jar:1.0:compile<br>&gt; | \- javax.media:jai_core:jar:1.1.3:compile<br>&gt; +- org.geotools:gt-referencing:jar:8-SNAPSHOT:compile<br>&gt; | +- java3d:vecmath:jar:1.3.2:compile<br>&gt; | +- commons-pool:commons-pool:jar:1.5.4:compile<br>&gt; | \- org.geotools:gt-metadata:jar:8-SNAPSHOT:compile<br>&gt; | \- org.geotools:gt-opengis:jar:8-SNAPSHOT:compile<br>&gt; | \- net.java.dev.jsr-275:jsr-275:jar:1.0-beta-2:compile<br>&gt; \- org.geotools:gt-epsg-hsql:jar:8-SNAPSHOT:compile<br>&gt; \- hsqldb:hsqldb:jar:1.8.0.7:compile<br>&gt; <br>&gt; Plus, you are probably using some of those already. So, if you don't<br>&gt; use Maven as your build tool, you could just download those jars<br>&gt; manually from the GeoTools repository:<br>&gt; http://download.osgeo.org/webdav/geotools/<br>&gt; <br>&gt; The code below shows how you might modify the original example into<br>&gt; something that you could compile into a jar for your app to use. You<br>&gt; need to write the static getDefaultCRS() method to do something<br>&gt; appropriate for your use case (e.g. to read WKT for a map projection<br>&gt; as in the example).<br>&gt; <br>&gt; Hope this helps.<br>&gt; <br>&gt; Michael<br>&gt; <br>&gt; <br>&gt; import com.vividsolutions.jts.densify.Densifier;<br>&gt; import com.vividsolutions.jts.geom.Coordinate;<br>&gt; import com.vividsolutions.jts.geom.Geometry;<br>&gt; import com.vividsolutions.jts.geom.GeometryFactory;<br>&gt; import com.vividsolutions.jts.geom.LinearRing;<br>&gt; <br>&gt; import org.geotools.geometry.jts.JTS;<br>&gt; import org.geotools.referencing.CRS;<br>&gt; import org.geotools.referencing.crs.DefaultGeographicCRS;<br>&gt; import org.opengis.referencing.FactoryException;<br>&gt; import org.opengis.referencing.crs.CoordinateReferenceSystem;<br>&gt; import org.opengis.referencing.operation.MathTransform;<br>&gt; <br>&gt; /**<br>&gt; * Provides methods to calculate the area, in square metres,<br>&gt; * of polygons defined by lat-lon vertices.<br>&gt; */<br>&gt; public class PolygonAreaCalculator {<br>&gt; private static final double TOL = 1.0e-8;<br>&gt; <br>&gt; private static final CoordinateReferenceSystem<br>&gt; DEFAULT_CALCULATION_CRS = getDefaultCRS();<br>&gt; <br>&gt; private static CoordinateReferenceSystem getDefaultCRS() {<br>&gt; // EDIT THIS METHOD TO SOMETHING SUITABLE FOR YOUR<br>&gt; // APPLICATION AND DATA<br>&gt; throw new UnsupportedOperationException("Not yet implemented");<br>&gt; }<br>&gt; <br>&gt; private final GeometryFactory geomFactory;<br>&gt; private final CoordinateReferenceSystem calculationCRS;<br>&gt; private final MathTransform transform;<br>&gt; <br>&gt; <br>&gt; public PolygonAreaCalculator() {<br>&gt; this(null);<br>&gt; }<br>&gt; <br>&gt; /**<br>&gt; * Creates a new instance and sets the coordinate reference system to<br>&gt; * use for area calculations. A null argument or empty string means<br>&gt; * use the default reference system.<br>&gt; *<br>&gt; * @param epsgCode EPSG code for the coordinate reference system<br>&gt; */<br>&gt; public PolygonAreaCalculator(String epsgCode) {<br>&gt; try {<br>&gt; if (epsgCode == null || epsgCode.trim().length() == 0) {<br>&gt; calculationCRS = DEFAULT_CALCULATION_CRS;<br>&gt; } else {<br>&gt; if (!epsgCode.startsWith("EPSG:")) {<br>&gt; epsgCode = "EPSG:" + epsgCode;<br>&gt; }<br>&gt; calculationCRS = CRS.decode(epsgCode, true);<br>&gt; }<br>&gt; <br>&gt; transform = CRS.findMathTransform(<br>&gt; DefaultGeographicCRS.WGS84, calculationCRS, true);<br>&gt; } catch (FactoryException ex) {<br>&gt; throw new RuntimeException(ex);<br>&gt; }<br>&gt; <br>&gt; this.geomFactory = new GeometryFactory();<br>&gt; }<br>&gt; <br>&gt; /**<br>&gt; * Calculates the area of a polygon defined by the provided<br>&gt; * geographic vertex coordinates.<br>&gt; *<br>&gt; * @param longitude longitudes of vertices<br>&gt; * @param latitude latitudes of vertices<br>&gt; */<br>&gt; public double getArea(double[] longitude, double[] latitude)<br>&gt; throws Exception {<br>&gt; if (longitude == null || latitude == null) {<br>&gt; throw new IllegalArgumentException("arguments must not be null");<br>&gt; }<br>&gt; if (longitude.length != latitude.length) {<br>&gt; throw new IllegalArgumentException("Bummer: bad arguments");<br>&gt; }<br>&gt; <br>&gt; int n = longitude.length;<br>&gt; boolean firstCoordRepeated =<br>&gt; Math.abs(longitude[0] - longitude[n-1]) &lt; TOL &amp;&amp;<br>&gt; Math.abs(latitude[0] - latitude[n-1]) &lt; TOL;<br>&gt; <br>&gt; final int N;<br>&gt; if (firstCoordRepeated) {<br>&gt; N = longitude.length - 1;<br>&gt; } else {<br>&gt; N = longitude.length;<br>&gt; }<br>&gt; <br>&gt; if (N &lt; 3) {<br>&gt; // not a polygon - should probably log a warning or<br>&gt; // throw an exception<br>&gt; return 0;<br>&gt; }<br>&gt; <br>&gt; <br>&gt; // Create the polygon<br>&gt; Coordinate[] coords = new Coordinate[N + 1];<br>&gt; <br>&gt; for (int i = 0; i &lt; N; i++) {<br>&gt; coords[i] = new Coordinate(longitude[i], latitude[i]);<br>&gt; }<br>&gt; coords[N] = new Coordinate(coords[0]);<br>&gt; <br>&gt; LinearRing polygonBoundary = geomFactory.createLinearRing(coords);<br>&gt; LinearRing[] polygonHoles = null;<br>&gt; Geometry polygon = geomFactory.createPolygon(polygonBoundary,<br>&gt; polygonHoles);<br>&gt; <br>&gt; // Densify the polygon by adding extra vertices to its edges so<br>&gt; // that when it is reprojected they will approximate curves<br>&gt; // more closely<br>&gt; double vertexSpacing = polygon.getLength() / 1000.0; // for example<br>&gt; Geometry densePolygon = Densifier.densify(polygon, vertexSpacing);<br>&gt; <br>&gt; <br>&gt; // Reproject the polygon and return its area<br>&gt; Geometry transformedPolygon = JTS.transform(densePolygon, transform);<br>&gt; return transformedPolygon.getArea();<br>&gt; }<br>&gt; <br>&gt; }<br></div> </div></body>
</html>
--_ae1ca32b-ea86-4296-b2e9-4e13a6fd7f77_--
t***@hotmail.com
1970-01-01 00:00:00 UTC
Permalink
--_fbbcb455-4129-4746-b4e9-0a2708cc11ee_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable




Ok, Michael,

I execute class and the result was similar to this site, http://www.daftlogic.com/projects-google-maps-area-calculator-tool.htm

I think it must be correct.

I got some exceptions:

org.opengis.referencing.FactoryException: Failed to connect to the EPSG database.

Caused by: org.postgresql.util.PSQLException: Connection denied

Caused by: java.net.ConnectException: Connection refused: connect

org.opengis.referencing.FactoryException: Failed to connect to the EPSG database.


But, show the result.

Is it normal ?


From: ***@hotmail.com
To: ***@gmail.com
Subject: RE: [Geotools-gt2-users] how to calculate area of a polygon by coordinates
Date: Fri, 9 Sep 2011 11:48:48 +0000









Ok, Michael,

I execute class and the result was similar to this site, http://www.daftlogic.com/projects-google-maps-area-calculator-tool.htm

I think it must be correct.

I got some exceptions:

org.opengis.referencing.FactoryException: Failed to connect to the EPSG database.

Caused by: org.postgresql.util.PSQLException: Connection denied

Caused by: java.net.ConnectException: Connection refused: connect

org.opengis.referencing.FactoryException: Failed to connect to the EPSG database.


But, show the result.

Is it normal ?



> Date: Fri, 9 Sep 2011 13:25:29 +1000
> Subject: Re: [Geotools-gt2-users] how to calculate area of a polygon by coordinates
> From: ***@gmail.com
> To: ***@hotmail.com
> CC: geotools-gt2-***@lists.sourceforge.net
>
> Hi Thiago,
>
> > Sorry for bother you again.
> >
> > This is correcte implementation:
> > private static CoordinateReferenceSystem getDefaultCRS() {
> > return DefaultGeographicCRS.WGS84;
> > }
>
> No. That method (in the class we talked about off-list) should return
> a CRS that you want to be the default for area calculations. You
> convert the WGS84 coordinates into this projection. E.g. in the
> previous example, with the AreaFromLatLons class, we used the South
> America Albers Equal Area Conic projection.
>
> > More question, the result is in meters ?
> >
>
> Yes, in the example code the result is in square metres. The CRS you
> choose for calculations defines the distance unit. If you look at the
> WKT definition for the CRS used in the example you will see this:
>
> // UNIT["Meter",1],
>
> Hope that helps, but if you have more questions or code snippets that
> you want to check please feel free to post them to the list - that's
> what it is here for :)
>
> Michael

--_fbbcb455-4129-4746-b4e9-0a2708cc11ee_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
<br><br>Ok, Michael,<br><br><span id="ecxresult_box" class="ecxlong_text ecxshort_text" lang="en"><span class="ecxhps">I execute </span><span class="ecxhps">class and</span> <span class="ecxhps">the result was</span> <span class="ecxhps">similar to</span></span> this site, http://www.daftlogic.com/projects-google-maps-area-calculator-tool.htm<br><br><span id="ecxresult_box" class="ecxlong_text ecxshort_text" lang="en"><span class="ecxhps">I think it must</span> <span class="ecxhps">be correct.<br><br></span></span><span id="ecxresult_box" class="ecxlong_text ecxshort_text" lang="en"><span class="ecxhps">I got</span> <span class="ecxhps">some exceptions:<br><br>&nbsp;org.opengis.referencing.FactoryException: Failed to connect to the EPSG database.<br><br>Caused by: org.postgresql.util.PSQLException: Connection denied<br><br>Caused by: java.net.ConnectException: Connection refused: connect<br><br>org.opengis.referencing.FactoryException: Failed to connect to the EPSG database.<br><br><br>But, show the result.<br><br>Is it normal ?</span></span><br><br><br><div><hr id="stopSpelling">From: ***@hotmail.com<br>To: ***@gmail.com<br>Subject: RE: [Geotools-gt2-users] how to calculate area of a polygon by coordinates<br>Date: Fri, 9 Sep 2011 11:48:48 +0000<br><br>

<meta http-equiv="Content-Type" content="text/html; charset=unicode">
<meta name="Generator" content="Microsoft SafeHTML">
<style>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}

</style>

<div dir="ltr">
<br>Ok, Michael,<br><br><span id="ecxresult_box" class="ecxlong_text ecxshort_text" lang="en"><span class="ecxhps">I execute </span><span class="ecxhps">class and</span> <span class="ecxhps">the result was</span> <span class="ecxhps">similar to</span></span> this site, http://www.daftlogic.com/projects-google-maps-area-calculator-tool.htm<br><br><span id="ecxresult_box" class="ecxlong_text ecxshort_text" lang="en"><span class="ecxhps">I think it must</span> <span class="ecxhps">be correct.<br><br></span></span><span id="ecxresult_box" class="ecxlong_text ecxshort_text" lang="en"><span class="ecxhps">I got</span> <span class="ecxhps">some exceptions:<br><br>&nbsp;org.opengis.referencing.FactoryException: Failed to connect to the EPSG database.<br><br>Caused by: org.postgresql.util.PSQLException: Connection denied<br><br>Caused by: java.net.ConnectException: Connection refused: connect<br><br>org.opengis.referencing.FactoryException: Failed to connect to the EPSG database.<br><br><br>But, show the result.<br><br>Is it normal ?<br></span></span><br><br><br><div>&gt; Date: Fri, 9 Sep 2011 13:25:29 +1000<br>&gt; Subject: Re: [Geotools-gt2-users] how to calculate area of a polygon by coordinates<br>&gt; From: ***@gmail.com<br>&gt; To: ***@hotmail.com<br>&gt; CC: geotools-gt2-***@lists.sourceforge.net<br>&gt; <br>&gt; Hi Thiago,<br>&gt; <br>&gt; &gt; Sorry for bother you again.<br>&gt; &gt;<br>&gt; &gt; This is correcte implementation:<br>&gt; &gt; &nbsp;&nbsp;&nbsp; private static CoordinateReferenceSystem getDefaultCRS() {<br>&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return DefaultGeographicCRS.WGS84;<br>&gt; &gt; &nbsp;&nbsp;&nbsp; }<br>&gt; <br>&gt; No. That method (in the class we talked about off-list) should return<br>&gt; a CRS that you want to be the default for area calculations. You<br>&gt; convert the WGS84 coordinates into this projection. E.g. in the<br>&gt; previous example, with the AreaFromLatLons class, we used the South<br>&gt; America Albers Equal Area Conic projection.<br>&gt; <br>&gt; &gt; More question, the result is in meters ?<br>&gt; &gt;<br>&gt; <br>&gt; Yes, in the example code the result is in square metres. The CRS you<br>&gt; choose for calculations defines the distance unit. If you look at the<br>&gt; WKT definition for the CRS used in the example you will see this:<br>&gt; <br>&gt; // UNIT["Meter",1],<br>&gt; <br>&gt; Hope that helps, but if you have more questions or code snippets that<br>&gt; you want to check please feel free to post them to the list - that's<br>&gt; what it is here for :)<br>&gt; <br>&gt; Michael<br></div> </div></div> </div></body>
</html>
--_fbbcb455-4129-4746-b4e9-0a2708cc11ee_--
unknown
1970-01-01 00:00:00 UTC
Permalink
--_9770b56f-b1fd-4ccc-a9ab-f8490fe63e4e_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


Yes, very cool.

In this sample, works only for South America, right ?

This link
http://svn.geotools.org/trunk/modules/plugin/epsg-extension/src/main/resources/org/geotools/referencing/factory/epsg/esri.properties

contains many ESRI.

Each line belongs to a location on the globe?




> Date: Fri, 9 Sep 2011 22:36:02 +1000
> Subject: Re: [Geotools-gt2-users] how to calculate area of a polygon by coordinates
> From: ***@gmail.com
> To: ***@hotmail.com; geotools-gt2-***@lists.sourceforge.net
>
> Hello Thiago,
>
> > I execute class and the result was similar to this site,
> > http://www.daftlogic.com/projects-google-maps-area-calculator-tool.htm
> >
> > I think it must be correct.
>
> Cool !
>
> > I got some exceptions:
> >
> > org.opengis.referencing.FactoryException: Failed to connect to the EPSG
> > database.
>
> My first guess is that you don't have the gt-epsg-hsql jar on your
> classpath. The complete set of jars required (according to Maven) is
> this...
>
> com.vividsolutions:jts:jar:1.12
> commons-pool:commons-pool:jar:1.5.4
> hsqldb:hsqldb:jar:1.8.0.7
> java3d:vecmath:jar:1.3.2
> javax.media:jai_core:jar:1.1.3
> jdom:jdom:jar:1.0
> net.java.dev.jsr-275:jsr-275:jar:1.0-beta-2
> org.geotools:gt-api:jar:8-SNAPSHOT
> org.geotools:gt-epsg-hsql:jar:8-SNAPSHOT
> org.geotools:gt-main:jar:8-SNAPSHOT
> org.geotools:gt-metadata:jar:8-SNAPSHOT
> org.geotools:gt-opengis:jar:8-SNAPSHOT
> org.geotools:gt-referencing:jar:8-SNAPSHOT
> xerces:xercesImpl:jar:2.4.0
>
> Michael

--_9770b56f-b1fd-4ccc-a9ab-f8490fe63e4e_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
Yes, very cool.<br><br>In this sample, works only for South America, right ?<br><br>This link
http://svn.geotools.org/trunk/modules/plugin/epsg-extension/src/main/resources/org/geotools/referencing/factory/epsg/esri.properties<br>
contains many ESRI.<br>
<span id="result_box" class="long_text short_text" lang="en"><span class="hps">Each line</span> <span class="hps">belongs to</span> <span class="hps">a</span> <span class="hps">location on the globe</span><span>?</span></span><br><br><br><br><br><div>&gt; Date: Fri, 9 Sep 2011 22:36:02 +1000<br>&gt; Subject: Re: [Geotools-gt2-users] how to calculate area of a polygon by coordinates<br>&gt; From: ***@gmail.com<br>&gt; To: ***@hotmail.com; geotools-gt2-***@lists.sourceforge.net<br>&gt; <br>&gt; Hello Thiago,<br>&gt; <br>&gt; &gt; I execute class and the result was similar to this site,<br>&gt; &gt; http://www.daftlogic.com/projects-google-maps-area-calculator-tool.htm<br>&gt; &gt;<br>&gt; &gt; I think it must be correct.<br>&gt; <br>&gt; Cool !<br>&gt; <br>&gt; &gt; I got some exceptions:<br>&gt; &gt;<br>&gt; &gt; &nbsp;org.opengis.referencing.FactoryException: Failed to connect to the EPSG<br>&gt; &gt; database.<br>&gt; <br>&gt; My first guess is that you don't have the gt-epsg-hsql jar on your<br>&gt; classpath. The complete set of jars required (according to Maven) is<br>&gt; this...<br>&gt; <br>&gt; com.vividsolutions:jts:jar:1.12<br>&gt; commons-pool:commons-pool:jar:1.5.4<br>&gt; hsqldb:hsqldb:jar:1.8.0.7<br>&gt; java3d:vecmath:jar:1.3.2<br>&gt; javax.media:jai_core:jar:1.1.3<br>&gt; jdom:jdom:jar:1.0<br>&gt; net.java.dev.jsr-275:jsr-275:jar:1.0-beta-2<br>&gt; org.geotools:gt-api:jar:8-SNAPSHOT<br>&gt; org.geotools:gt-epsg-hsql:jar:8-SNAPSHOT<br>&gt; org.geotools:gt-main:jar:8-SNAPSHOT<br>&gt; org.geotools:gt-metadata:jar:8-SNAPSHOT<br>&gt; org.geotools:gt-opengis:jar:8-SNAPSHOT<br>&gt; org.geotools:gt-referencing:jar:8-SNAPSHOT<br>&gt; xerces:xercesImpl:jar:2.4.0<br>&gt; <br>&gt; Michael<br></div> </div></body>
</html>
--_9770b56f-b1fd-4ccc-a9ab-f8490fe63e4e_--
t***@hotmail.com
1970-01-01 00:00:00 UTC
Permalink
--_d1f7145e-f3e1-48d5-b29f-2f2529b8eced_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable



I can run this class in web project ?



From: ***@hotmail.com
To: geotools-gt2-***@lists.sourceforge.net
Date: Fri, 9 Sep 2011 12:57:25 +0000
Subject: Re: [Geotools-gt2-users] how to calculate area of a polygon by coordinates








Yes, very cool.

In this sample, works only for South America, right ?

This link
http://svn.geotools.org/trunk/modules/plugin/epsg-extension/src/main/resources/org/geotools/referencing/factory/epsg/esri.properties

contains many ESRI.

Each line belongs to a location on the globe?




> Date: Fri, 9 Sep 2011 22:36:02 +1000
> Subject: Re: [Geotools-gt2-users] how to calculate area of a polygon by coordinates
> From: ***@gmail.com
> To: ***@hotmail.com; geotools-gt2-***@lists.sourceforge.net
>
> Hello Thiago,
>
> > I execute class and the result was similar to this site,
> > http://www.daftlogic.com/projects-google-maps-area-calculator-tool.htm
> >
> > I think it must be correct.
>
> Cool !
>
> > I got some exceptions:
> >
> > org.opengis.referencing.FactoryException: Failed to connect to the EPSG
> > database.
>
> My first guess is that you don't have the gt-epsg-hsql jar on your
> classpath. The complete set of jars required (according to Maven) is
> this...
>
> com.vividsolutions:jts:jar:1.12
> commons-pool:commons-pool:jar:1.5.4
> hsqldb:hsqldb:jar:1.8.0.7
> java3d:vecmath:jar:1.3.2
> javax.media:jai_core:jar:1.1.3
> jdom:jdom:jar:1.0
> net.java.dev.jsr-275:jsr-275:jar:1.0-beta-2
> org.geotools:gt-api:jar:8-SNAPSHOT
> org.geotools:gt-epsg-hsql:jar:8-SNAPSHOT
> org.geotools:gt-main:jar:8-SNAPSHOT
> org.geotools:gt-metadata:jar:8-SNAPSHOT
> org.geotools:gt-opengis:jar:8-SNAPSHOT
> org.geotools:gt-referencing:jar:8-SNAPSHOT
> xerces:xercesImpl:jar:2.4.0
>
> Michael


------------------------------------------------------------------------------
Why Cloud-Based Security and Archiving Make Sense
Osterman Research conducted this study that outlines how and why cloud
computing security and archiving is rapidly being adopted across the IT
space for its ease of implementation, lower cost, and increased
reliability. Learn more. http://www.accelacomm.com/jaw/sfnl/114/51425301/
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
--_d1f7145e-f3e1-48d5-b29f-2f2529b8eced_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
<br>I can run this class in web project ?<br><br><br><br><div><hr id="stopSpelling">From: ***@hotmail.com<br>To: geotools-gt2-***@lists.sourceforge.net<br>Date: Fri, 9 Sep 2011 12:57:25 +0000<br>Subject: Re: [Geotools-gt2-users] how to calculate area of a polygon by coordinates<br><br>

<meta http-equiv="Content-Type" content="text/html; charset=unicode">
<meta name="Generator" content="Microsoft SafeHTML">
<style>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}

</style>

<div dir="ltr">
Yes, very cool.<br><br>In this sample, works only for South America, right ?<br><br>This link
http://svn.geotools.org/trunk/modules/plugin/epsg-extension/src/main/resources/org/geotools/referencing/factory/epsg/esri.properties<br>
contains many ESRI.<br>
<span id="ecxresult_box" class="ecxlong_text ecxshort_text" lang="en"><span class="ecxhps">Each line</span> <span class="ecxhps">belongs to</span> <span class="ecxhps">a</span> <span class="ecxhps">location on the globe</span><span>?</span></span><br><br><br><br><br><div>&gt; Date: Fri, 9 Sep 2011 22:36:02 +1000<br>&gt; Subject: Re: [Geotools-gt2-users] how to calculate area of a polygon by coordinates<br>&gt; From: ***@gmail.com<br>&gt; To: ***@hotmail.com; geotools-gt2-***@lists.sourceforge.net<br>&gt; <br>&gt; Hello Thiago,<br>&gt; <br>&gt; &gt; I execute class and the result was similar to this site,<br>&gt; &gt; http://www.daftlogic.com/projects-google-maps-area-calculator-tool.htm<br>&gt; &gt;<br>&gt; &gt; I think it must be correct.<br>&gt; <br>&gt; Cool !<br>&gt; <br>&gt; &gt; I got some exceptions:<br>&gt; &gt;<br>&gt; &gt; &nbsp;org.opengis.referencing.FactoryException: Failed to connect to the EPSG<br>&gt; &gt; database.<br>&gt; <br>&gt; My first guess is that you don't have the gt-epsg-hsql jar on your<br>&gt; classpath. The complete set of jars required (according to Maven) is<br>&gt; this...<br>&gt; <br>&gt; com.vividsolutions:jts:jar:1.12<br>&gt; commons-pool:commons-pool:jar:1.5.4<br>&gt; hsqldb:hsqldb:jar:1.8.0.7<br>&gt; java3d:vecmath:jar:1.3.2<br>&gt; javax.media:jai_core:jar:1.1.3<br>&gt; jdom:jdom:jar:1.0<br>&gt; net.java.dev.jsr-275:jsr-275:jar:1.0-beta-2<br>&gt; org.geotools:gt-api:jar:8-SNAPSHOT<br>&gt; org.geotools:gt-epsg-hsql:jar:8-SNAPSHOT<br>&gt; org.geotools:gt-main:jar:8-SNAPSHOT<br>&gt; org.geotools:gt-metadata:jar:8-SNAPSHOT<br>&gt; org.geotools:gt-opengis:jar:8-SNAPSHOT<br>&gt; org.geotools:gt-referencing:jar:8-SNAPSHOT<br>&gt; xerces:xercesImpl:jar:2.4.0<br>&gt; <br>&gt; Michael<br></div> </div>
<br>------------------------------------------------------------------------------
Why Cloud-Based Security and Archiving Make Sense
Osterman Research conducted this study that outlines how and why cloud
computing security and archiving is rapidly being adopted across the IT
space for its ease of implementation, lower cost, and increased
reliability. Learn more. http://www.accelacomm.com/jaw/sfnl/114/51425301/<br>_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users</div> </div></body>
</html>
--_d1f7145e-f3e1-48d5-b29f-2f2529b8eced_--
t***@hotmail.com
1970-01-01 00:00:00 UTC
Permalink
--_9fba4452-b937-437a-90eb-07982a67db42_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable







From: ***@hotmail.com
To: ***@gmail.com
Subject: RE: [Geotools-gt2-users] how to calculate area of a polygon by coordinates
Date: Mon, 12 Sep 2011 19:21:41 +0000








Ok Michael.

I tested one simple web application, and seems it works.

Thnaks for help.




> Date: Sun, 11 Sep 2011 13:14:19 +1000
> Subject: Re: [Geotools-gt2-users] how to calculate area of a polygon by coordinates
> From: ***@gmail.com
> To: ***@hotmail.com; geotools-gt2-***@lists.sourceforge.net
>
> On 10 September 2011 23:19, Thiago Turim <***@hotmail.com> wrote:
> >
> > I can run this class in web project ?
> >
>
> I think it should be ok but I don't work with web applications myself.
> Lots of other list members use GeoTools in web frameworks, so the best
> thing to do is try it and if you have any problems start a new thread
> here.
>
> Michael

--_9fba4452-b937-437a-90eb-07982a67db42_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
<br><br><br><br><br><div><hr id="stopSpelling">From: ***@hotmail.com<br>To: ***@gmail.com<br>Subject: RE: [Geotools-gt2-users] how to calculate area of a polygon by coordinates<br>Date: Mon, 12 Sep 2011 19:21:41 +0000<br><br>

<meta http-equiv="Content-Type" content="text/html; charset=unicode">
<meta name="Generator" content="Microsoft SafeHTML">
<style>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Tahoma;}

</style>

<div dir="ltr">
Ok Michael. <br><br>I tested one simple web application, and seems it works.<br><br>Thnaks for help.<br><br><br><br><br><div>&gt; Date: Sun, 11 Sep 2011 13:14:19 +1000<br>&gt; Subject: Re: [Geotools-gt2-users] how to calculate area of a polygon by coordinates<br>&gt; From: ***@gmail.com<br>&gt; To: ***@hotmail.com; geotools-gt2-***@lists.sourceforge.net<br>&gt; <br>&gt; On 10 September 2011 23:19, Thiago Turim &lt;***@hotmail.com&gt; wrote:<br>&gt; &gt;<br>&gt; &gt; I can run this class in web project ?<br>&gt; &gt;<br>&gt; <br>&gt; I think it should be ok but I don't work with web applications myself.<br>&gt; Lots of other list members use GeoTools in web frameworks, so the best<br>&gt; thing to do is try it and if you have any problems start a new thread<br>&gt; here.<br>&gt; <br>&gt; Michael<br></div> </div></div> </div></body>
</html>
--_9fba4452-b937-437a-90eb-07982a67db42_--
Loading...