Ian Turton a écrit : > I have an image and 4 control points that I know the geographic > coordinates for, is there some way in GT to create a transform so I > can convert a bunch of points on th eimage to geographic coordinates?
It depends. If we assume that the transformation from "grid CRS" to "geographic CRS" is just a scale and translation (I mean, if we assume that the image is not rotated or deformed), then 2 control points would be enough for calculating an affine transform. If we assumes that we may have a rotation or some deformation, we probably want a more complex transform computed using some "least square" algorithm. This is the subject of Jan Jezek "calculator package" created during the Google summer of code. Not yet commited to Geotools, but I guess that it will be commited in the upcoming months. Jan Jezek's mentor is Jesse Eicher at Refraction Research. A third solution (but work only if you have at least 10 or more control points) is to use the following transform: http://javadoc.geotools.fr/snapshot/org/geotools/referencing/operation/transform/WarpTransform2D.html Use "new WarpTransform2D(srcPts, dstPts, 2);". You can try other values than 2, but increasing the value increase the amount of points required. Note that I noticed that this transform is not very good when the number of points is too close from the minimal number of points documented in the javadoc. It performs better when the number of points is quite larger. And lately, we should note that this transform is much slower than an affine transform for example. Martin. ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
