Michael Bedward ha scritto: > I'm afraid that your basic problem is that the JTS classes are not > geo-spatially aware. They assume that you are using a Cartesian > coordinate system. > > Depending on the specifics of your app, perhaps the GeodeticCalculator > class might help ? > http://javadoc.geotools.fr/2.5/org/geotools/referencing/GeodeticCalculator.html > > Of course, there is no problem using JTS classes for proximity and > containment tests if you can transform your data to another coordinate > system. For instance, if your calculations only ever involve features > that are geographically close, you might re-project to the appropriate > UTM tile. If you are working with geographically distant features > then you could, I suppose, use one of the whole-earth projections such > as "google mercator" (EPSG:3785). > > Perhaps someone here who know more about referencing than me (almost > everyone :) can provide some more advice.
Hmmm... I have basically the same advice as you. You can use GeodeticCalculator to compute a buffer for a point, or for a simple line or polygon, as long as the resulting buffer is not self intersecting (e.g., think of buffering a C shaped line with a distance big enough). To use the GeodeticCalculator for points, just compute the points at a certain distance at azimut 0, then azimut 5, and so on, until you close the "circle". For lines, move along the line step by step and compute perpedincular points at the desired distance (step by step because buffering a meridian, for example, won't result in a straight line in lat/lon, but something that is wider closer to the poles and thinner closer to the equator). Yet, as I said, the moment you need to deal with holes or self intersecting results, well, good look... not sure JTS has any raw method to deal with that case (thought it certainly has to do something to deal with self intersections in the cartesian case). Maybe ask over at the JTS ml Cheers Andrea -- Andrea Aime OpenGeo - http://opengeo.org Expert service straight from the developers. ------------------------------------------------------------------------------ The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
