(adding grass-dev) On Sat, Feb 9, 2019 at 11:14 AM Markus Neteler <[email protected]> wrote: > On Sat, Feb 9, 2019 at 10:57 AM Helmut Kudrnovsky <[email protected]> wrote: > > > > >Just the GRASS GIS logics (still) prevent from accepting a .prj file as > > input. > > > > at least in the GUI and the location wizzard you can use a .prj-file to > > create a new location. > > Yes but not on the beloved command line: > > grass77 -c bla.prj ~/grassdata/mylocation > Starting GRASS GIS... > Creating new GRASS GIS location <mylocation>... > ERROR: ERROR 4: `bla.prj' not recognized as a supported file format. > ERROR: Unable to read georeferenced file <bla.prj> using GDAL library
I checked further and found a difference between g.proj and gdalsrsinfo opening files: general/g.proj/input.c, line 271 : (inofficially: https://github.com/GRASS-GIS/grass-ci/blob/master/general/g.proj/input.c#L271) if ((gdal_ds = GDALOpen(geofile, GA_ReadOnly))) { apps/gdalsrsinfo.cpp, line 306 https://github.com/OSGeo/gdal/blob/master/gdal/apps/gdalsrsinfo.cpp#L306 poGDALDS = static_cast<GDALDataset *>(GDALOpenEx( pszInput, 0, nullptr, nullptr, nullptr )); It seems that GDALOpenEx() is more flexible concerning the input (it exists since GDAL 2.0): https://www.gdal.org/classGDALDataset.html#a9cb8585d0b3c16726b08e25bcc94274a Perhaps g.proj should be updated accordingly? Markus _______________________________________________ grass-dev mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/grass-dev
