On Wed, Mar 9, 2011 at 2:07 PM, <[email protected]> wrote: > > Hello, > > I am new to this mailing list and relatively new to GeoTools. I hope that > this is the correct address for my problem > (I am using uDig, but as far as I understood, my problem is referring to the > GeoTools library): > > I want to create a LineString feature between two points of a point layer > (shapefile) that represents the shortest path between the points on the > ellipsoid. (e.g. http://www.gcmap.com/mapui?P=FRA-HKG&MS=wls&DU=mi) The > LineString should not only contain the two ending points, but also some of > the waypoints. > > My first idea was using > MapProjection projection = CRS.getMapProjection(crs); // crs is > World_Mercator > and > MathTransform2D inverse = projection.inverse(); > And then applying > Coordinate c = pointGeom.getCoordinate(); > JTS.transform(c, null, inverse) > to the two input geometries. Then I wanted to calculate the waypoints and > apply > JTS.transform(wayP, null, projection) > > So my question is what kind of coordinates do I get when applying > transform(..) to point p1? > I assumed, that I am getting coordinates already projected to a 2D-plane > when calling getCoordinate(). Is that right? > > Does GeoTools provide any functionality doing all this or parts of this for > me? I already searched http://geotools.org/ and > http://docs.codehaus.org/display/GEOTDOC/Home, but did not find anything > that seemed appropriate.
If I were to do that I would use the GeodeticCalculator class. First you determine the azimuth and distance betweent the two points using the tool, and then you use it the opposite way, give starting point, azimuth and distance to an intermediate point, to compute the intermediate points Cheers Andrea -- ------------------------------------------------------- Ing. Andrea Aime GeoSolutions S.A.S. Tech lead Via Poggio alle Viti 1187 55054 Massarosa (LU) Italy phone: +39 0584 962313 fax: +39 0584 962313 mob: +39 333 8128928 http://www.geo-solutions.it http://geo-solutions.blogspot.com/ http://www.youtube.com/user/GeoSolutionsIT http://www.linkedin.com/in/andreaaime http://twitter.com/geowolf ------------------------------------------------------- ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
