Actually, that wasn't the problem at all.  IT was a problem with the netcdf
file.  but here is what I ended up doing in the end, just for y'all's
curiousity:

Map<String, Object> params = new HashMap<String, Object>();
           params.put("name", "North_American_Datum_1983");
           GeodeticDatum datum = FactoryFinder.getDatumFactory
(null).createGeodeticDatum(params,
                   DefaultEllipsoid.GRS80, DefaultPrimeMeridian.GREENWICH);
           params = new HashMap<String, Object>();
           params.put("name", "NAD83");

           GeographicCRS crs =
FactoryFinder.getCRSFactory(null).createGeographicCRS(params,
datum,
                   DefaultEllipsoidalCS.GEODETIC_2D);
           ParameterValueGroup parameters = mtFactory.getDefaultParameters
("Lambert_Conformal_Conic_2SP");
           parameters.parameter("standard_parallel_1").setValue(
gcs.getParallelOne());
           parameters.parameter("standard_parallel_2").setValue(
gcs.getParallelTwo());
           parameters.parameter("latitude_of_origin").setValue(
gcs.getOriginLat());
           parameters.parameter("longitude_of_origin").setValue(
gcs.getOriginLon());
           parameters.parameter("central_meridian").setValue(
gcs.getOriginLon());
           parameters.parameter("false_easting").setValue(0);
           parameters.parameter("false_northing").setValue(0);
           Map properties = Collections.singletonMap("name", "unknown");
           return factories.createProjectedCRS(properties, crs, null,
parameters, DefaultCartesianCS.GENERIC_2D);

My data displays properly now.

Thanks again for your help,
Tom

On 4/5/07, Tom Howe <[EMAIL PROTECTED]> wrote:

It appears that the problem is that the convention of netcdf that I'm
using (models3) defaults to the nad83 datum instead of wgs84.  Which
certainly would explain why everything is shifted.  Are there any
convenience fields for creating a nad83 datum like there are for wgs84?  If
not what would be the best method for creating the nad83 datum (I'm far from
an expert on how to create these things).

Thanks,
Tom

On 4/5/07, Martin Desruisseaux <[EMAIL PROTECTED]> wrote:
>
> Tom Howe a écrit :
> > Martin,
> > thanks for your help.  I've made some headway.  Given the info in my
> > netcdf file I've done the following:
> >
> > (...snip...)
> >
> > gcs is a projection Object from the ucar netcdf library.  when I try
> to
> > do a transform, I get very incorrect results.  Does the above look
> like
> > it's missing anything?  Have you done any work with this stuff?
>
> I have not yet started the work on NetCDF. The code sound good. Maybe
> some point
> that may worth to be checked:
>
> - What are the units of the values returned by "gcs"? Is is degrees or
> metres?
> - What are the axis order expected by the NetCDF library?
> - How do you perform your projection?
> - Have you tried to project a single point? Which result do you expect
>    and which one do you get?
>
> It may be worth to look at the output of System.out.println
> (theProjectedCRS).
>
>         Martin
>


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to