[GRASS-user] create location from CLI
Dave Roberts
droberts at montana.edu
Tue Sep 6 12:13:03 PDT 2016
Hi Ken, Hi Sajid,
Thanks for the pointers. I think my problem is that grass70 and
g.proj parse the files differently. I.e.,
Here is file teste.prj
PROJCS["Lambert_Conformal_Conic",
GEOGCS["GCS_WGS_1984",
DATUM["D_WGS_1984",
SPHEROID["WGS_1984",6378137,298.257223563]],
PRIMEM["Greenwich",0],
UNIT["Degree",0.017453292519943295]],
PROJECTION["Lambert_Conformal_Conic"],
PARAMETER["standard_parallel_1",40],
PARAMETER["standard_parallel_2",45],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",-109],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["Meter",1]]
The following does not work
grass70 -e -c teste.prj teste
Creating new GRASS GIS location/mapset...
ERROR: ERROR 4: `teste.prj' not recognised as a supported
file format.
ERROR: Could not read georeferenced file teste.prj using either OGR nor
GDAL
However, this does work
grass70 -c teste
g.proj -c wkt=teste.prj
I'm having even worse luck with PROJ4 syntax of files.
Sajid, I have no problem getting EPSG specs to work, but that's a lttle
too indirect for the audience I'm trying to reach.
Thanks, Dave
On 09/06/16 08:12, Ken Mankoff wrote:
>
> On 2016-09-06 at 13:21, Dave Roberts <droberts at montana.edu> wrote:
>> I'm trying to understand the simplest way in GRASS7 to create a
>> location from the command line without using a georeferenced file. So
>> far, it appears to be
>>
>> % grass70 -c newLocation
>>
>> at the OS prompt, followed by
>>
>> GRASS GIS 7.0.4 > g.proc -c wkt=some WKT text file
>
> You say "without using a georeferenced file" but then use the WKTfile. Why not use that at the CLI?
>
> grass70 -e -c WKTfile newLocation
> grass70 ./newLocation/PERMANENT
>
> I do it in two lines and use -e on the first so that if I run this again, and the location exists, it will still launch GRASS. If you just do the first line w/o -e, GRASS won't start if the location exists.
>
>> I can't seem to get g.proj to parse any proj4 strings either from
>> stdin or a file, even substituting the output from a g.proj -j command
>> from a working location.
>
> A MWE would help debugging.
>
> -k.
>
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
David W. Roberts office 406-994-4548
Professor and Head FAX 406-994-3190
Department of Ecology email droberts at montana.edu
Montana State University
Bozeman, MT 59717-3460
More information about the grass-user
mailing list