<div dir="ltr">I'm trying to import a NetCDF file from the WRF weather forecast model with r.in.gdal, but I can't get it to georeference.  Instead I end up with a x,y coordinate system of rows and columns.  The file georeferences fine in a number of other weather graphics programs.  I tried to follow the directions at:<div>
<br></div><div><a href="http://www.gdal.org/frmt_netcdf.html">http://www.gdal.org/frmt_netcdf.html</a><br></div><div><br></div><div>but when I run gdalinfo I get the following:</div><div><br></div><div><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">
$ gdalinfo <a href="http://geo_em.d03.nc">geo_em.d03.nc</a></p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">Warning 1: No UNIDATA NC_GLOBAL:Conventions attribute</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">Driver: netCDF/Network Common Data Format</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">Files: <a href="http://geo_em.d03.nc">geo_em.d03.nc</a></p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">Size is 512, 512</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">Coordinate System is `'</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">Metadata:</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#BOTTOM-TOP_GRID_DIMENSION=0</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#CEN_LAT=-8.4095154</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#CEN_LON=115.02</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#corner_lats={ -10.454437, -6.3537445, -6.3537445, -10.454437, -10.454437, -6.3537445, -6.3537445, -10.454437, -10.46785, -6.3401871, -6.3401871, -10.46785, -10.46785, -6.3401871, -6.3401871, -10.46785 }</p>

<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#corner_lons={ 112.3332, 112.3332, 117.70679, 117.70679, 112.31956, 112.31956, 117.72044, 117.72044, 112.3332, 112.3332, 117.70679, 117.70679, 112.31956, 112.31956, 117.72044, 117.72044 }</p>

<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#DX=3000</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#DY=3000</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#DYN_OPT=2</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#FLAG_MF_XY=1</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#grid_id=3</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#GRIDTYPE=C</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#i_parent_end=99</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#i_parent_start=34</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#ISICE=24</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#ISLAKE=-1</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#ISOILWATER=14</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#ISURBAN=1</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#ISWATER=16</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#j_parent_end=84</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#j_parent_start=34</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#MAP_PROJ=3</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#MMINLU=USGS</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#MOAD_CEN_LAT=-8.4095078</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#NUM_LAND_CAT=24</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#parent_grid_ratio=3</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#parent_id=2</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#POLE_LAT=90</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#POLE_LON=0</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#SIMULATION_START_DATE=0000-00-00_00:00:00</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#SOUTH-NORTH_GRID_DIMENSION=154</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#SOUTH-NORTH_PATCH_END_STAG=154</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#SOUTH-NORTH_PATCH_END_UNSTAG=153</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#SOUTH-NORTH_PATCH_START_STAG=1</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#SOUTH-NORTH_PATCH_START_UNSTAG=1</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#sr_x=1</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#sr_y=1</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#STAND_LON=115.02</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#TITLE=OUTPUT FROM GEOGRID V3.4</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#TRUELAT1=-8.4095001</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#TRUELAT2=0</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#WEST-EAST_GRID_DIMENSION=199</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#WEST-EAST_PATCH_END_STAG=199</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#WEST-EAST_PATCH_END_UNSTAG=198</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#WEST-EAST_PATCH_START_STAG=1</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  NC_GLOBAL#WEST-EAST_PATCH_START_UNSTAG=1</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">Subdatasets:</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  SUBDATASET_1_NAME=NETCDF:"<a href="http://geo_em.d03.nc">geo_em.d03.nc</a>":Times</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  SUBDATASET_1_DESC=[1x19] Times (8-bit character)</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  SUBDATASET_2_NAME=NETCDF:"<a href="http://geo_em.d03.nc">geo_em.d03.nc</a>":XLAT_M</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  SUBDATASET_2_DESC=[1x153x198] XLAT_M (32-bit floating-point)</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  SUBDATASET_3_NAME=NETCDF:"<a href="http://geo_em.d03.nc">geo_em.d03.nc</a>":XLONG_M</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  SUBDATASET_3_DESC=[1x153x198] XLONG_M (32-bit floating-point)</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">  SUBDATASET_4_NAME=NETCDF:"<a href="http://geo_em.d03.nc">geo_em.d03.nc</a>":XLAT_V</p></div><div>.</div>
<div>.</div><div>.</div><div>.</div><div><p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">Corner Coordinates:</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">Upper Left  (    0.0,    0.0)</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">Lower Left  (    0.0,  512.0)</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">Upper Right (  512.0,    0.0)</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">Lower Right (  512.0,  512.0)</p>
<p style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(0,0,0)">Center      (  256.0,  256.0)</p></div><div><br></div><div>The warning - </div><div><br></div><div><span style="color:rgb(255,255,255);font-family:Menlo;font-size:11px;background-color:rgb(0,0,0)">Warning 1: No UNIDATA NC_GLOBAL:Conventions attribute</span><br>
</div><div><span style="color:rgb(255,255,255);font-family:Menlo;font-size:11px;background-color:rgb(0,0,0)"><br></span></div><div>leads me to believe that all the projection info is not being recognized, but I'm not sure why.  Is it possible that GDAL wasn't compiled with <span style="color:rgb(0,0,0);font-family:Times;font-size:medium">libnetcdf?  </span>But if that's the case I would think that gdalinfo wouldn't work at all.</div>
<div><br></div><div>I've imported the data into GRASS using:</div><div><br></div><div>r.in.gdal input="NETCDF:geo_em.d03.nc:HGT_M" output="d03_HGT_M" location="bali_d03"</div><div><br></div>
<div>to create a new location.</div><div><br></div><div>I also created a location with the Mercator projection of the data and tried importing using:</div><div><br></div><div><div>r.in.gdal -o input="NETCDF:grassdata/bali/geo_em.d03.nc:HGT_M" output="d03_HGT_M"</div>
</div><div><br></div><div>but as far as I can tell still get an x,y row,column coordinate system.</div><div><br></div><div>I also have the lat and lon of each cell.  Is there anyway to georeference using that data?</div><div>
<br></div><div>Thanks,</div><div>Lee</div></div>