Re: [GRASS-user] Unable to read .prj file

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [GRASS-user] Unable to read .prj file

Markus Metz-3


On Sat, Feb 9, 2019 at 12:05 PM Markus Neteler <[hidden email]> wrote:

>
> (adding grass-dev)
>
> On Sat, Feb 9, 2019 at 11:14 AM Markus Neteler <[hidden email]> wrote:
> > On Sat, Feb 9, 2019 at 10:57 AM Helmut Kudrnovsky <[hidden email]> 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

g.proj wkt=bla.prj -p
works

>
> 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?

Easy to implement, please open a ticket such that it does not get forgotten.

Markus M
>
> Markus
> _______________________________________________
> grass-user mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/grass-user

_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev
Reply | Threaded
Open this post in threaded view
|

Re: [GRASS-user] Unable to read .prj file

Markus Neteler
On Sat, Feb 9, 2019 at 6:18 PM Markus Metz
<[hidden email]> wrote:
...
> > Perhaps g.proj should be updated accordingly?
>
> Easy to implement, please open a ticket such that it does not get forgotten.

Sure, see (the ticket title is IMHO opposed to the current situation,
but never mind):
Ticket URL: https://trac.osgeo.org/grass/ticket/3750#comment:2

markusN
_______________________________________________
grass-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/grass-dev