[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [udig-devel] How to calculate a translated point with his original gps coordinate ?
|
Hi,
The toolcontext will help a great deal with this sort of thing.
There are 2 ways to get a tool context:
1. If the class is a tool the getContext() will get the context.
2. ApplicationGIS.creatContext(map).
Once you have a context you can go to world coordinate using the
method context.pixelToWorld( x,y ). That translates the pixel to a
location in world coordinates.
Once in map coordinates you may have to transform into layer
coordinates. Unfortunately we done have a method in the layer that
makes this as simple as it should be so you have to do the following:
Coordinate c=context.pixelToWorld();
Coordinate layerCoord=new Coordinate();
JTS.transform(c, layerCoord, layer.mapToLayerTransform() );
Jesse
On 22-Jun-06, at 2:30 AM, wouaco@xxxxxxx wrote:
Hi,
In my jpg/jgw import plugin, users can click on a point on an image
of which
they know gps coordinate in a way to calculate the UTM upper left
pixel
coordinate for the world file...
I have the code to convert GPS coordinate to UTM but i don't know how
translating the gps coordinate with pixel coordinate of the
reference point.
Could you help me please ?
PS: sorry if my english is bad...
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel