Hello everybody,
this is my first post so please be kind to me ;-)
I have following problem and don't know exactly how to do it correctly.
I'm quite a newbie to all GeoTools/coordinate systems/geospatial stuff
so please excuse maybe my lacking knowledge.
Let's say i have state border defined with line segments (WGS84
lat/long). Then i have point X (WGS84 lat/long) which is close to that
border.
Now the task is find the closest point to my point X on that border but
not farther than 30 meters. My idea how to solve this is :
1. approximate the line segments of the border to sub segments.
2. convert their coordinates to 3d (x, y, z) on elipsoid.
3. convert point X coordinates to 3d (x, y, z) on elipsoid.
4. for each line subsegment find closest point on the line from point X.
5. convert closest point to long/lat and measure real distance on
elipsoid to find real distance (if it's not more than 30 meters).
DefaultGeographicCRS sysWGS84 = DefaultGeographicCRS.WGS84;
for (GeoBorderVertex vtVertex : vVertices) {
double [] dFrom = { vtFrom.getLongitude(),
vtFrom.getLatitude() };
double [] dTo = { vtVertex.getLongitude(),
vtVertex.getLatitude() };
Measure mDistance = sysWGS84.distance(dFrom, dTo);
}
6. return closest point long/lat (WGS84).
the problem is that i can't find a way to convert long/lat coordinates
to x,y,z on elipsoid. Any help or suggestions are very appreciated.
Thanks in advance.
Tomas
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users