Good afternoon.

This sounds like a great addition; recently you will see that mbedward added an 
unsupported module to handle the generation of "grids" which is similar. While 
I am used to lat/lon grids (and then watch them being transformed into nice 
curves, his code went the extra distance and made interesting hex grids used 
for biology or something).
- http://svn.osgeo.org/geotools/trunk/modules/unsupported/grid/

I imagine your code will be similar, you are making a grid of a single line :-)

Other than that your question is a little bit difficult to answer (as it lies 
in problem solving and not the udig or geotools code base). You ask what kind 
of coordinates you get - you are going to get the coordiantes you ask for (what 
coordinates do you need?).

If I was doing this I would go:
- input location in whatever CRS the user is using (I call this the world CRS)
- transform to lat/long (ie DefaultGeographicCRS.WGS84 (I would call this the 
data CRS)
- perform my calculation (locate the two points on a sphere, interpolate 
between the points on the sphere, getting a series of coordiantes in 
DefaultGeographicCRS.WGS84)
- inverse the transform back to world CRS
- ... and draw the result

For background on these kind of things:
- http://docs.geotools.org/latest/tutorials/geometry/geometrycrs.htmlsvn.

You should be able to do what you need using CRS, CoordinateReferenceSystem, 
MathTransform.

-- 
Jody Garnett

On Wednesday, 9 March 2011 at 11: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.
> 
> Thanks a lot in advance,
> Hendrik
> 
> 
> ------------------------------------------------------------------------------
> 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
> 
------------------------------------------------------------------------------
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

Reply via email to