<font face="courier new,monospace">James,<br>I added polar stereographic support to the trunk in r18931. I believe I added all the coordinate systems to be cf=1.4 compliant. I did not have a dataset to test it. I did not backport these changes to 1.7 because I was a new commiter. I will test your file tomorrow on my 1.8dev machine.<br>
<br>kss<br clear="all"></font><br># ============================<br>Kyle Shannon<br>Physical Science Technician<br>RMRS Fire Sciences Lab<br>Fire, Fuels & Smoke - RWU 4405<br>5775 Highway 10 W.<br>Missoula, MT 59808<br>
(406)829-6954<br><a href="mailto:kshannon@fs.fed.us">kshannon@fs.fed.us</a><br># ============================<br>
<br><br><div class="gmail_quote">On Mon, Aug 9, 2010 at 5:50 PM, James Hiebert <span dir="ltr"><<a href="mailto:hiebert@uvic.ca">hiebert@uvic.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Sure. The ticket can be found here:<br>
<a href="https://trac.osgeo.org/gdal/ticket/3715" target="_blank">https://trac.osgeo.org/gdal/ticket/3715</a><br>
<font color="#888888"><br>
~James<br>
</font><div><div></div><div class="h5"><br>
On Mon, Aug 09, 2010 at 03:13:59PM -0400, Lucena, Ivan wrote:<br>
> James,<br>
><br>
> Could do file a ticked and upload a sample file on <a href="http://trac.osgeo.org/gdal/" target="_blank">http://trac.osgeo.org/gdal/</a> ?<br>
><br>
> Regards,<br>
><br>
> Ivan<br>
><br>
> James Hiebert wrote:<br>
> > Hi All,<br>
> ><br>
> > I'm trying to use GDAL (version 1.7.2 on Gentoo built with hdf5 and netcdf<br>
> > support) to read NetCDF files, but I'm a little unclear on how the NetCDF<br>
> > driver attempts to determine the georeferencing.<br>
> ><br>
> > The driver page here:<br>
> > <a href="http://www.gdal.org/frmt_netcdf.html" target="_blank">http://www.gdal.org/frmt_netcdf.html</a><br>
> > states that it will attempt to read the metadata "spatial_ref" for a Well<br>
> > Know Text definition of the spatial reference (I assume that it means that<br>
> > it will try to use a global attribute of the NetCDF file named spatial_ref).<br>
> ><br>
> > Since this would be convenient for my application, I attempted to use GDAL<br>
> > this way without success.<br>
> ><br>
> > + I added a global attribute named "spatial_ref" with the WKT definition of<br>
> > the spatial reference system.<br>
> > + gdalinfo on the file still reports "Coordinate System is `'"<br>
> > + opening the file with the python bindings and calling dst.GetProjection()<br>
> > returns a blank string (i.e. no projection information)<br>
> ><br>
> > The full listings of my spatial reference definition, the output of ncdump<br>
> > and gdalinfo and the output from the python session are listed below. Can<br>
> > anyone tell me whether I'm doing something wrong, or should I not count on<br>
> > georeferencing being supported by the NetCDF driver?<br>
> ><br>
> > ~James<br>
> ><br>
> > james@basalt ~ $ ncatted -a spatial_ref,global,a,c,'PROJCS["unnamed",GEOGCS["Normal Sphere<br>
> > (r=6370997)",DATUM["unknown",SPHEROID["sphere",6370997,0]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Polar_Stereographic"],PARAMETER["latitude_of_origin",60],PARAMETER["central_meridian",263],PARAMETER["scale_factor",1],PARAMETER["false_easting",3925000],PARAMETER["false_northing",8325000]]'<br>
> > <a href="http://narccap_ecpc-20c3m-tasmin-ncep.nc" target="_blank">narccap_ecpc-20c3m-tasmin-ncep.nc</a> <a href="http://narccap_ecpc-20c3m-tasmin-ncep-with-srs.nc" target="_blank">narccap_ecpc-20c3m-tasmin-ncep-with-srs.nc</a><br>
> ><br>
> ><br>
> > james@basalt ~ $ ncdump -h <a href="http://narccap_ecpc-20c3m-tasmin-ncep-with-srs.nc" target="_blank">narccap_ecpc-20c3m-tasmin-ncep-with-srs.nc</a><br>
> > netcdf narccap_ecpc-20c3m-tasmin-ncep-with-srs {<br>
> > dimensions:<br>
> > xc = 123 ;<br>
> > yc = 104 ;<br>
> > time = UNLIMITED ; // (9496 currently)<br>
> > bnds = 2 ;<br>
> > variables:<br>
> > char polar_stereographic ;<br>
> > polar_stereographic:grid_mapping_name =<br>
> > "polar_stereographic" ;<br>
> > polar_stereographic:longitude_of_central_meridian = 263. ;<br>
> > polar_stereographic:straight_vertical_longitude_from_pole =<br>
> > 263. ;<br>
> > polar_stereographic:standard_parallel = 60. ;<br>
> > polar_stereographic:TrueGridLength_Latitude = 60. ;<br>
> > polar_stereographic:XGridLength_M = 50000. ;<br>
> > polar_stereographic:YGridLength_M = 50000. ;<br>
> > polar_stereographic:PoleOnPlane = "north" ;<br>
> > polar_stereographic:false_easting = 3925000. ;<br>
> > polar_stereographic:false_northing = 8325000. ;<br>
> > polar_stereographic:latitude_of_projection_origin = 90. ;<br>
> > double yc(yc) ;<br>
> > yc:long_name = "y-coordinate of Cartesian system" ;<br>
> > yc:standard_name = "projection_y_coordinate" ;<br>
> > yc:axis = "Y" ;<br>
> > yc:units = "m" ;<br>
> > double xc(xc) ;<br>
> > xc:long_name = "x-coordinate of Cartesian system" ;<br>
> > xc:standard_name = "projection_x_coordinate" ;<br>
> > xc:axis = "X" ;<br>
> > xc:units = "m" ;<br>
> > double lon(yc, xc) ;<br>
> > lon:units = "degrees_east" ;<br>
> > lon:long_name = "longitude" ;<br>
> > lon:standard_name = "longitude" ;<br>
> > lon:axis = "X" ;<br>
> > lon:NX_NumPntsOnParallel = 123 ;<br>
> > lon:NY_NumPntsOnMeridian = 104 ;<br>
> > lon:actual_range = 211.5412f, 316.2759f ;<br>
> > lon:XGridLength_M = 50000. ;<br>
> > lon:YGridLength_M = 50000. ;<br>
> > lon:PoleOnPlane = "north" ;<br>
> > double lat(yc, xc) ;<br>
> > lat:units = "degrees_north" ;<br>
> > lat:long_name = "latitude" ;<br>
> > lat:standard_name = "latitude" ;<br>
> > lat:axis = "Y" ;<br>
> > lat:NX_NumPntsOnParallel = 123 ;<br>
> > lat:NY_NumPntsOnMeridian = 104 ;<br>
> > lat:actual_range = 21.23807f, 67.63758f ;<br>
> > lat:XGridLength_M = 50000. ;<br>
> > lat:YGridLength_M = 50000. ;<br>
> > lat:PoleOnPlane = "north" ;<br>
> > ...<br>
> ><br>
> > // global attributes:<br>
> > ...<br>
> > :history = "Mon Aug 9 13:44:50 2010: ncatted -a<br>
> > spatial_ref,global,a,c,PROJCS[\"unnamed\",GEOGCS[\"Normal<br>
> > Sphere<br>
> > (r=6370997)\",DATUM[\"unknown\",SPHEROID[\"sphere\",6370997,0]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433]],PROJECTION[\"Polar_Stereographic\"],PARAMETER[\"latitude_of_origin\",60],PARAMETER[\"central_meridian\",263],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",3925000],PARAMETER[\"false_northing\",8325000]]<br>
> > <a href="http://narccap_ecpc-20c3m-tasmin-ncep.nc" target="_blank">narccap_ecpc-20c3m-tasmin-ncep.nc</a><br>
> > <a href="http://narccap_ecpc-20c3m-tasmin-ncep-with-srs.nc" target="_blank">narccap_ecpc-20c3m-tasmin-ncep-with-srs.nc</a>\n",<br>
> > "Fri May 8 09:34:14 2009: ncrcat<br>
> > tasmin_ECPC_1979010106.nc tasmin_ECPC_1981010106.nc<br>
> > tasmin_ECPC_1986010106.nc tasmin_ECPC_1991010106.nc<br>
> > tasmin_ECPC_1996010106.nc tasmin_ECPC_2001010106.nc<br>
> > <a href="http://narccap_ecpc-20c3m-tasmin-ncep.nc" target="_blank">narccap_ecpc-20c3m-tasmin-ncep.nc</a>" ;<br>
> > :nco_openmp_thread_number = 1 ;<br>
> > :spatial_ref = "PROJCS[\"unnamed\",GEOGCS[\"Normal Sphere<br>
> > (r=6370997)\",DATUM[\"unknown\",SPHEROID[\"sphere\",6370997,0]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433]],PROJECTION[\"Polar_Stereographic\"],PARAMETER[\"latitude_of_origin\",60],PARAMETER[\"central_meridian\",263],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",3925000],PARAMETER[\"false_northing\",8325000]]"<br>
> > ;<br>
> > }<br>
> ><br>
> > james@basalt ~ $ gdalinfo <a href="http://narccap_ecpc-20c3m-tasmin-ncep-with-srs.nc" target="_blank">narccap_ecpc-20c3m-tasmin-ncep-with-srs.nc</a><br>
> > Driver: netCDF/Network Common Data Format<br>
> > Files: <a href="http://narccap_ecpc-20c3m-tasmin-ncep-with-srs.nc" target="_blank">narccap_ecpc-20c3m-tasmin-ncep-with-srs.nc</a><br>
> > narccap_ecpc-20c3m-tasmin-ncep-with-srs.nc.aux.xml<br>
> > Size is 512, 512<br>
> > Coordinate System is `'<br>
> > Metadata:<br>
> > ...<br>
> > NC_GLOBAL#history1=Original output in GRIB 1<br>
> > NC_GLOBAL#history2=Contains modifications made to original data<br>
> > NC_GLOBAL#history=Mon Aug 9 13:44:50 2010: ncatted -a<br>
> > spatial_ref,global,a,c,PROJCS["unnamed",GEOGCS["Normal Sphere<br>
> > (r=6370997)",DATUM["unknown",SPHEROID["sphere",6370997,0]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Polar_Stereographic"],PARAMETER["latitude_of_origin",60],PARAMETER["central_meridian",263],PARAMETER["scale_factor",1],PARAMETER["false_easting",3925000],PARAMETER["false_northing",8325000]]<br>
> > <a href="http://narccap_ecpc-20c3m-tasmin-ncep.nc" target="_blank">narccap_ecpc-20c3m-tasmin-ncep.nc</a><br>
> > <a href="http://narccap_ecpc-20c3m-tasmin-ncep-with-srs.nc" target="_blank">narccap_ecpc-20c3m-tasmin-ncep-with-srs.nc</a><br>
> > Fri May 8 09:34:14 2009: ncrcat tasmin_ECPC_1979010106.nc<br>
> > tasmin_ECPC_1981010106.nc tasmin_ECPC_1986010106.nc<br>
> > tasmin_ECPC_1991010106.nc tasmin_ECPC_1996010106.nc<br>
> > tasmin_ECPC_2001010106.nc <a href="http://narccap_ecpc-20c3m-tasmin-ncep.nc" target="_blank">narccap_ecpc-20c3m-tasmin-ncep.nc</a><br>
> > NC_GLOBAL#nco_openmp_thread_number=1<br>
> > NC_GLOBAL#spatial_ref=PROJCS["unnamed",GEOGCS["Normal Sphere<br>
> > (r=6370997)",DATUM["unknown",SPHEROID["sphere",6370997,0]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Polar_Stereographic"],PARAMETER["latitude_of_origin",60],PARAMETER["central_meridian",263],PARAMETER["scale_factor",1],PARAMETER["false_easting",3925000],PARAMETER["false_northing",8325000]]<br>
> > Subdatasets:<br>
> > SUBDATASET_1_NAME=NETCDF:"<a href="http://narccap_ecpc-20c3m-tasmin-ncep-with-srs.nc" target="_blank">narccap_ecpc-20c3m-tasmin-ncep-with-srs.nc</a>":lon<br>
> > SUBDATASET_1_DESC=[104x123] longitude (64-bit floating-point)<br>
> > SUBDATASET_2_NAME=NETCDF:"<a href="http://narccap_ecpc-20c3m-tasmin-ncep-with-srs.nc" target="_blank">narccap_ecpc-20c3m-tasmin-ncep-with-srs.nc</a>":lat<br>
> > SUBDATASET_2_DESC=[104x123] latitude (64-bit floating-point)<br>
> > SUBDATASET_3_NAME=NETCDF:"<a href="http://narccap_ecpc-20c3m-tasmin-ncep-with-srs.nc" target="_blank">narccap_ecpc-20c3m-tasmin-ncep-with-srs.nc</a>":time_bnds<br>
> > SUBDATASET_3_DESC=[9496x2] time_bnds (64-bit floating-point)<br>
> > SUBDATASET_4_NAME=NETCDF:"<a href="http://narccap_ecpc-20c3m-tasmin-ncep-with-srs.nc" target="_blank">narccap_ecpc-20c3m-tasmin-ncep-with-srs.nc</a>":tasmin<br>
> > SUBDATASET_4_DESC=[9496x104x123] air_temperature (32-bit floating-point)<br>
> > Corner Coordinates:<br>
> > Upper Left ( 0.0, 0.0)<br>
> > Lower Left ( 0.0, 512.0)<br>
> > Upper Right ( 512.0, 0.0)<br>
> > Lower Right ( 512.0, 512.0)<br>
> > Center ( 256.0, 256.0)<br>
> ><br>
> ><br>
> > james@basalt ~ $ python<br>
> >>>> from osgeo import gdal<br>
> >>>> dst = gdal.Open("<a href="http://narccap_ecpc-20c3m-tasmin-ncep-with-srs.nc" target="_blank">narccap_ecpc-20c3m-tasmin-ncep-with-srs.nc</a>")<br>
> >>>> dst.GetProjection()<br>
> ><br>
> > _______________________________________________<br>
> > gdal-dev mailing list<br>
> > <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
> > <a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
> ><br>
><br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</div></div></blockquote></div><br>