bjornharrtell/jsts — Issue #95: geatArea and Multipolygon
Author: Tiolebucheron
Created: 2012-01-09 16:00:11+00:00
State: open

Hello

For information, getArea () method with "jsts.geom.MultiPolygon" always returns 0. For example:

var reader = new jsts.io.WKTReader();
var multi = "MULTIPOLYGON(((508569.333383 6955176.6343521,524444.32481051 6949179.4153684,507158.22303389 6943887.7515592,508569.333383 6955176.6343521)),((512097.10925578 6931893.3135918,524444.32481051 6941418.3084483,523033.2144614 6927307.2049571,512097.10925578 6931893.3135918)))"
var input = reader.read(multi);
input.getArea(); result => 0
input.geometries[0].getArea(); result => 93836827.6686182
input.geometries[1].getArea(); result => 80396008.8518629

As it stands, I use getArea () with "jsts.geom.Polygon" for my needs.

Thank you for your response.

Richard Lehaut - Tiolebucheron