builder.field("centroid", new double[] { centroid.getLongitude(), centroid.getLatitude() });
builder.field("lengthKm", shape.getLengthKm());
builder.field("areaKm2", shape.getAreaKm2());
builder.startObject("shape");
builder.field("type", shape.isClosed() ? "polygon" : "linestring");
builder.startArray("coordinates");
if (shape.isClosed()) builder.startArray();
for (double[] location : shape.getGeoJsonArray()) {
builder.startArray().value(location[0]).value(location[1]).endArray();
}
if (shape.isClosed()) builder.endArray();