[GRASS-user] Unable to read .prj file

Markus Neteler neteler at osgeo.org
Sat Feb 9 01:51:01 PST 2019


On Fri, Feb 8, 2019 at 11:24 PM Rich Shepard <rshepard at appl-ecosys.com> wrote:
>
> Environment: Slackware-14.2, Grass 7.7.svn (r74061).
>
> Trying to create a new location using a shapefile .prj. GRASS tells me it
> cannot read the file using gdal.

I also find that a bit annoying. Indeed, you need to specify the .shp
file and not the .prj file (which doesn't make much sense).

> There are five mapsets I want to import and they all have the same .prj file:
> PROJCS["NAD_1983_UTM_Zone_11N",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["Meter",1]]
>
> Do I look for the appropriate EPSG code or am I doing something incorrectly?

Using the "testepsg" script from GDAL I could verify your file:

testepsg bla.prj
Validate Succeeds.
WKT[bla.prj] =
PROJCS["NAD_1983_UTM_Zone_11N",
    GEOGCS["GCS_North_American_1983",
        DATUM["D_North_American_1983",
            SPHEROID["GRS_1980",6378137,298.257222101]],
        PRIMEM["Greenwich",0],
        UNIT["Degree",0.017453292519943295]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-117],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["Meter",1]]

Simplified WKT[bla.prj] =
PROJCS["NAD_1983_UTM_Zone_11N",
    GEOGCS["GCS_North_American_1983",
        DATUM["D_North_American_1983",
            SPHEROID["GRS_1980",6378137,298.257222101]],
        PRIMEM["Greenwich",0],
        UNIT["Degree",0.017453292519943295]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-117],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["Meter",1]]

Old Style WKT[bla.prj] =
PROJCS["NAD_1983_UTM_Zone_11N",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-117],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",500000],PARAMETER["false_northing",0],UNIT["Meter",1]]
ESRI'ified WKT[bla.prj] =
PROJCS["NAD_1983_UTM_Zone_11N",
    GEOGCS["GCS_North_American_1983",
        DATUM["D_North_American_1983",
            SPHEROID["GRS_1980",6378137,298.257222101]],
        PRIMEM["Greenwich",0],
        UNIT["Degree",0.017453292519943295]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-117],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["Meter",1]]
PROJ.4 rendering of [bla.prj] = +proj=utm +zone=11 +ellps=GRS80
+units=m +no_defs

Also GDAL is happy:

gdalsrsinfo bla.prj

PROJ.4 : +proj=utm +zone=11 +datum=NAD83 +units=m +no_defs

OGC WKT :
PROJCS["NAD_1983_UTM_Zone_11N",
    GEOGCS["GCS_North_American_1983",
        DATUM["North_American_Datum_1983",
            SPHEROID["GRS_1980",6378137,298.257222101]],
        PRIMEM["Greenwich",0],
        UNIT["Degree",0.017453292519943295]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-117],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["Meter",1]]


Just the GRASS GIS logics (still) prevent from accepting a .prj file as input.

Please open a ticket for it, IMHO this should be improved.
(for now use the .shp file)

Markus


More information about the grass-user mailing list