5

What is the unit of measurement used by Geometry class for it's buffer calculation ? Api doc currently defines it as " distance - the width of the buffer (may be positive, negative or 0)"

I need to draw polygons around a given Geometry with X miles away. Wondering if there is an easy way to do it with current set of GeoTools API.

Api : http://www.vividsolutions.com/jts/javadoc/com/vividsolutions/jts/geom/Geometry.html#buffer(double)

1
  • I dont have enough reputation to post it as comment but it seems to me like your are looking for this: gis.stackexchange.com/questions/83199/… In this case I have a polygon and want to buffer it with a meter distance so you can adapt it easily for miles I guess.
    – MeiSign
    Jan 17, 2014 at 15:47

1 Answer 1

5

The units of measurement is based on the underlying spatial reference. So, for example, if it is EPSG:4326 it is decimal degrees or if it EPSG:2037 it is meters.

1
  • I tried the following code with GeoTools api CRSAuthorityFactory factory = CRS.getAuthorityFactory(true); CoordinateReferenceSystem crs = factory.createCoordinateReferenceSystem("EPSG:2037"); I get an exception as follows : org.opengis.referencing.FactoryException: Unit conversion from "DMS" to "°" is non-linear. Jul 13, 2012 at 23:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.