Saturday, 4 June 2016

geotools - The units of getArea() on a multipolygon within a shapefile



I am using GeoTools to find area and intersections of shapefiles. GeoTools uses the JTS geometry library (Vivid Solutions) and that has functions to getArea() but unfortunately I am not able to determine the units. Basically I get the multipolygon and iterate through the GeometryCollection and getArea() on each individual geometry within.


All documentation suggests the units are returned based on what the input data is. But unfortunately my original shapefiles do not have the .PRJ file (I even created one) and also programmatically tried to reproject to an equal area projection (with a standard Molleweide projection via a wkt file and set to meter units) but the returned area just does not make sense.


Any thoughts on what the units maybe? Or is this the right approach to computer areas of shapefiles?





No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...