NADCONTransform

3 messages Options
Embed this post
Permalink
Milton Stemmler

NADCONTransform

Reply Threaded More More options
Print post
Permalink
Can someone tell me how to use this part of the code? I am trying to
convert NAD27 to NAD83 using this package but I send in a lat/lng pair
and just get back an array with just 0.0 and 0.0. It seems I must be
missing something but the documentation is lacking and there is no good
example code to be found. Here is the code listing of how I am using this:

    double [] sendAry = new double [2];
    double [] retValAry = new double [2];
   
    sendAry[0] = lat;
    sendAry[1] = lon;
   try{
    NADCONTransform tran = new NADCONTransform(
                                 "C:\\Program Files\\digloader\\conus.las",
                                 "C:\\Program Files\\digloader\\conus.los"
                               );
   
    tran.transform(sendAry, 0, retValAry, 0, 1);
   }


Thanks for any insight.

Milton S.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
mbedward

Re: NADCONTransform

Reply Threaded More More options
Print post
Permalink
Hi Milton,

The problem is that the lat and lon source coords are the wrong way
round.  Change your code to this...

    sendAry[0] = lon;  // = x
    sendAry[1] = lat;   // = y

...and it should work.  The destination array will have the same order.

The javadocs for the transform method mention the order of coords...

http://geotools.org/javadocs/org/geotools/referencing/operation/transform/NADCONTransform.html#transform(double[],%20int,%20double[],%20int,%20int)

Hope this helps,

Michael

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
Milton Stemmler

Re: NADCONTransform

Reply Threaded More More options
Print post
Permalink
I screwed up the original reply to Michael's kind help by sending it
just to him. Just so everyone knows he solved my problem. Here is my
original reply to Michael that was intended for this list.

Hello Michael,

Doh, that was the problem. Even went back to the documentation for
transform and there it was. Seems to work fine now.

Thanks for the help through another set of eyes.

Milton S.

Michael Bedward wrote:

> Hi Milton,
>
> The problem is that the lat and lon source coords are the wrong way
> round.  Change your code to this...
>
>     sendAry[0] = lon;  // = x
>     sendAry[1] = lat;   // = y
>
> ...and it should work.  The destination array will have the same order.
>
> The javadocs for the transform method mention the order of coords...
>
> http://geotools.org/javadocs/org/geotools/referencing/operation/transform/NADCONTransform.html#transform(double[],%20int,%20double[],%20int,%20int)
>
> Hope this helps,
>
> Michael
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.424 / Virus Database: 270.14.49/2480 - Release Date: 11/04/09 07:37:00
>
>  

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geotools-gt2-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users