title: gdal.Translate missing spatial reference system
body: <p>I am trying to convert lots of xyz file to raster, using gdal.Translate in Spyder. But I came across several problems.</p>
  
  <ol>
  <li><p>I first try with convert only one xyz file. Code is like:    </p>
  
  <pre><code>import os
  from osgeo import gdal,osr
  xyz = '1x1m_678494.xyz'
  xyzraster = '1x1m_678494.tif'
  translateoptions = gdal.TranslateOptions(projWin='EPSG:3879')
  gdal.Translate(xyzraster,xyz,options=translateoptions)
  </code></pre></li>
  </ol>
  
  <p>the result is i can get a tif file, but without spatial reference. And there was no error or warning message. Then i thought it might relate to the gdal package. i found some similar issues here <a href="https://gis.stackexchange.com/questions/142215/gdal-translate-projection-error">https://gis.stackexchange.com/questions/142215/gdal-translate-projection-error</a><a href="https://github.com/conda/conda/issues/4050" rel="nofollow noreferrer">https://github.com/conda/conda/issues/4050</a>,I did set the GDAL_DATA to the path 'C:\Program Files\Anaconda3\Library\share\gdal'. This didn't solve my problem. checked my gdal version is 2.3.3 with python 3.7.3. I am trying to remove this gdal and install the newest version gdal 3.0.4 using conda. But there seems to be a incompatible issue. </p>
  
  <p>In the same time, i found there is also independent install for GDAL, <a href="http://cartometric.com/blog/2011/10/17/install-gdal-on-windows/" rel="nofollow noreferrer">http://cartometric.com/blog/2011/10/17/install-gdal-on-windows/</a>. This tutorial has one step to set the GDAL_DATA and GDAL_DRIVER_PATH, but the paths are different from the GDAL_DATA installed by conda. I am very confused. Will the independent installed gdal works different from the conda installed gdal? Or i just need one of them?</p>
  
  <ol start="2">
  <li><p>Then i leave the spatial reference issue behind, and tried convert multiple xyz to a geotiff. But got some other issues. code is like:</p>
  
  <pre><code>import os
  import gdal
  import glob
  path = 'D:\\Data\\1m\\'
  gdal.BuildVRT(path+'out.vrt',glob.glob(path+'\\*.xyz'))
  gdal.Translate(path+'out.tif',path+'out.vrt')
  </code></pre></li>
  </ol>
  
  <p>The error is ValueError: Received a NULL pointer.</p>
  
  <p>Can anyone help me out, please?</p>