Hi all,
finally I came to study how to develop tools. I started from a Kosmo small tool 
which I adopted to OJ. It basically calculate the angle between a segment and 
the North, in a plane (UTM), in both degrees and radians.

that is the code:

************************************************
public MeasureAzimutUTMTool() {
      super(2); 
      allowSnapping();}
protected void gestureFinished() throws Exception { Iterator it = 
getCoordinates().iterator();
    Coordinate c1=null,c2=null;
                
                /**
                 *  Calculates Degrees and Radians
                 */
                
                double d = 0;
                if (it.hasNext())
                        c1 = (Coordinate)it.next();
                if (it.hasNext())
                        c2 = (Coordinate)it.next();
        LineSegment ls = new LineSegment(c1,c2);
        d = ls.angle();
        double DEG = 90 - d * (180/Math.PI);
        
        double DEG1 = DEG;
       if (DEG < 0)
          DEG1 = DEG1 + 360;
       double RAD = DEG1/180;

        getPanel().getContext().setStatusMessage(
                
I18N.get("org.saig.jump.tools.messuring.MessureAzimutUTMTool.Angle-referencing-north")
 + ":   " + getPanel().format(DEG1)+"° = " + getPanel().format(RAD) + 
"\u03C0"); 

***********************************************

My idea is to start from this tool to obtain other surveying tools.

My questions are:

1) actually the tool only displays on status panel the value of the angle. I 
need that it creates a new layer and , for every measuring,  a point with the 
values of degrees saved in an attribute

2) I need that the tools creates, for every measuring, a line  with vectors 
(segments) oriented according the calculated angles.

I really thatnk if someone can help me.

regards


Giuseppe
        

------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to