Re: Lat/Lon Question

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Wed Jul 09 2014 - 13:41:11 MDT

There is a routine that Mohammad wrote that looks like it is
unconditionally compiled into NCL called transform_coordinate that is a
direct interface to PROJ4. I am not sure that is correct because the proj
library seems to be linked only if BuildGDAL is defined. Also it is not
documented at least in the regular function docs.

At any rate the arguments are a source projection string, a destination
projection string, and x, y and z coordinates. I think the strings are
directly handed off to the PROJ library. I haven't really experimented with
it, but it should allow for PROJ conversions without spawning a process.
 -dave


On Wed, Jul 9, 2014 at 11:30 AM, Dennis Shea <shea@ucar.edu> wrote:

> I thought (but could not find) a JIRA ticket on this. I thought DaveB
> mentioned something on this. Maybe related to GRIB???? I may be mistaken
> but thought I bring it up.
>
> D
>
>
> ---------- Forwarded message ----------
> From: Rick Brownrigg <brownrig@ucar.edu>
> Date: Wed, Jul 9, 2014 at 11:03 AM
> Subject: Re: Lat/Lon Question
> To: Greg Garrett - NOAA Federal <greg.garrett@noaa.gov>
> Cc: ncl-talk <ncl-talk@ucar.edu>
>
>
> Hi Greg,
>
> I'm not aware of a means to do this from within NCL. If I had to do it,
> I'd use the Proj4 cartographic projection library, which would entail:
>
> - writing the X/Ys to a temp file,
> - issue a system() call with a proper command-line containing the L.C.
> projection details to the "proj" command, which would then read the temp
> file and write a new file containing lat/lons
> - read the lat/lon
>
> Its a bit clunky, but not too hard *if* you already have Proj4 and are
> familiar with it (http://trac.osgeo.org/proj/)
>
> Hope that helps...
> Rick
>
>
>
> On Wed, Jul 9, 2014 at 9:51 AM, Greg Garrett - NOAA Federal <
> greg.garrett@noaa.gov> wrote:
>
>> I am working with a Lambert Conformal projected dataset with GeoX and
>> GeoY x and y coordinates (excerpt below). There are no latitude or
>> longitude coordinates.
>> Can anyone tell me if it is possible to compute lat/lon from the x,y, and
>> projection information and if so, how?
>>
>> Thanks,
>>
>> Greg
>>
>>
>> x = 1799
>> y = 1059
>> variables:
>> integer LambertConformal_Projection ( ncl_scalar )
>> long_name :
>> grid_mapping_name : lambert_conformal_conic
>> latitude_of_projection_origin : 38.5
>> longitude_of_central_meridian : 262.5
>> standard_parallel : 38.5
>> earth_radius : 6367470
>> _CoordinateTransformType : Projection
>> _CoordinateAxisTypes : GeoX GeoY
>>
>> float x ( x )
>> units : km
>> long_name : projection_x_coordinate
>> standard_name : projection_x_coordinate
>> _CoordinateAxisType : GeoX
>>
>> float y ( y )
>> units : km
>> long_name : projection_y_coordinate
>> standard_name : projection_y_coordinate
>> _CoordinateAxisType : GeoY
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>

Received on Wed Jul 09 07:41:13 2014

This archive was generated by hypermail 2.1.8 : Wed Jul 23 2014 - 15:33:46 MDT