I'm currently having a problem with Geotools.
I try to generate a buffer (in meter using Lambert 72) on a map that has WGS84 as it's coordinatesystem. (problem is a bit like this one: http://email@example.com/msg08046.html, however I can't manage to solve my problem with it).
I have a couple of points in a map (in WGS84), and I want to add buffers around it using meters. As said here ( http://docs.geotools.org/latest/userguide/library/jts/operation.html ) you should transform the Geometry into the other CRS, buffer and then go back.
So what I do:
CoordinateReferenceSystem WGS = DefaultGeographicCRS.WGS84; CoordinateReferenceSystem lambert = CRS.decode("EPSG:31300"); MathTransform convertToMeter = CRS.findMathTransform(WGS, lambert,false); MathTransform convertFromMeter = CRS.findMathTransform(lambert, WGS,false); //Start targetGeometry=(Point) simpleFeature.getDefaultGeometry(); //transform to meter targetGeometry = JTS.transform(targetGeometry, convertToMeter); //add a buffer of 1000meters targetGeometry= targetGeometry.buffer(1000d); //go back to WGS 84 targetGeometry = JTS.transform(targetGeometry, convertFromMeter);
So now I expect to get a buffer of 1000meters, however what I get is a buffer of around 750meter, and I don't have any clue why.
Anyone could give me some advice (or could tell me the stupid error I'm making)?