[GRASS-user] New location based on .prj; v.in.ogr fails

   Created a new location, Import, based on shapefile's .prj. When I run
'v.in.ogr input=/home/rshepard/data/grassdata/ODF/odf_own.shp layer=odf_own'
an error in x_0 mis-match is found with the .shp file:

  Projection of dataset does not appear to match current location.

Location PROJ_INFO is:
name: NAD_1983_Oregon_Statewide_Lambert_Feet_Intl
datum: nad83
ellps: grs80
proj: lcc
lat_1: 43
lat_2: 45.5
lat_0: 41.75
lon_0: -120.5
x_0: 399999.9999999999
y_0: 0
no_defs: defined

Dataset PROJ_INFO is:
name: NAD83 / Oregon GIC Lambert (ft)
datum: nad83
ellps: grs80
proj: lcc
lat_1: 43
lat_2: 45.5
lat_0: 41.75
lon_0: -120.5
x_0: 399999.9999984
y_0: 0
towgs84: 0,0,0,0,0,0,0
no_defs: defined

ERROR: x_0

   I'm curious how this can happen since the .prj and .shp come from the same
source. If it is a user error I was not aware of it. A tarball with the
shapefiles is attached.

Rich

(attachments)

forests.tgz (471 KB)

Rich Shepard wrote

Created a new location, Import, based on shapefile's .prj. When I run
'v.in.ogr input=/home/rshepard/data/grassdata/ODF/odf_own.shp
layer=odf_own'
an error in x_0 mis-match is found with the .shp file:

  Projection of dataset does not appear to match current location.

Location PROJ_INFO is:
name: NAD_1983_Oregon_Statewide_Lambert_Feet_Intl
datum: nad83
ellps: grs80
proj: lcc
lat_1: 43
lat_2: 45.5
lat_0: 41.75
lon_0: -120.5
x_0: 399999.9999999999
y_0: 0
no_defs: defined

Dataset PROJ_INFO is:
name: NAD83 / Oregon GIC Lambert (ft)
datum: nad83
ellps: grs80
proj: lcc
lat_1: 43
lat_2: 45.5
lat_0: 41.75
lon_0: -120.5
x_0: 399999.9999984
y_0: 0
towgs84: 0,0,0,0,0,0,0
no_defs: defined

ERROR: x_0

   I'm curious how this can happen since the .prj and .shp come from the
same
source. If it is a user error I was not aware of it. A tarball with the
shapefiles is attached.

tested here with

---
GRASS version: 7.5.svn
GRASS SVN revision: r72886
Build date: 2018-06-23
Build platform: x86_64-w64-mingw32
GDAL: 2.2.4
PROJ.4: 4.9.3
GEOS: 3.5.0
SQLite: 3.17.0
Python: 2.7.14
wxPython: 2.8.12.1
Platform: Windows-10-10.0.17134 (OSGeo4W)
---

test the prj-file with GDAL's tool _testepsg_

---
D:\temp\rich\attachment-0001\attachment-0001~>testepsg odf_own.prj
Validate Fails.
WKT[odf_own.prj] =
PROJCS["NAD_1983_Oregon_Statewide_Lambert_Feet_Intl",
    GEOGCS["GCS_North_American_1983",
        DATUM["D_North_American_1983",
            SPHEROID["GRS_1980",6378137.0,298.257222101]],
        PRIMEM["Greenwich",0.0],
        UNIT["Degree",0.0174532925199433]],
    PROJECTION["Lambert_Conformal_Conic"],
    PARAMETER["False_Easting",1312335.958005249],
    PARAMETER["False_Northing",0.0],
    PARAMETER["Central_Meridian",-120.5],
    PARAMETER["Standard_Parallel_1",43.0],
    PARAMETER["Standard_Parallel_2",45.5],
    PARAMETER["Latitude_Of_Origin",41.75],
    UNIT["Foot",0.3048]]

Simplified WKT[odf_own.prj] =
PROJCS["NAD_1983_Oregon_Statewide_Lambert_Feet_Intl",
    GEOGCS["GCS_North_American_1983",
        DATUM["D_North_American_1983",
            SPHEROID["GRS_1980",6378137.0,298.257222101]],
        PRIMEM["Greenwich",0.0],
        UNIT["Degree",0.0174532925199433]],
    PROJECTION["Lambert_Conformal_Conic"],
    PARAMETER["False_Easting",1312335.958005249],
    PARAMETER["False_Northing",0.0],
    PARAMETER["Central_Meridian",-120.5],
    PARAMETER["Standard_Parallel_1",43.0],
    PARAMETER["Standard_Parallel_2",45.5],
    PARAMETER["Latitude_Of_Origin",41.75],
    UNIT["Foot",0.3048]]

Old Style WKT[odf_own.prj] =
PROJCS["NAD_1983_Oregon_Statewide_Lambert_Feet_Intl",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",1312335.958005249],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-120.5],PARAMETER["Standard_Parallel_1",43.0],PARAMETER["Standard_Parallel_2",45.5],PARAMETER["Latitude_Of_Origin",41.75],UNIT["Foot",0.3048]]
ESRI'ified WKT[odf_own.prj] =
PROJCS["NAD_1983_Oregon_Statewide_Lambert_Feet_Intl",
    GEOGCS["GCS_North_American_1983",
        DATUM["D_North_American_1983",
            SPHEROID["GRS_1980",6378137.0,298.257222101]],
        PRIMEM["Greenwich",0.0],
        UNIT["Degree",0.017453292519943295]],
    PROJECTION["Lambert_Conformal_Conic"],
    PARAMETER["False_Easting",1312335.958005249],
    PARAMETER["False_Northing",0.0],
    PARAMETER["Central_Meridian",-120.5],
    PARAMETER["Standard_Parallel_1",43.0],
    PARAMETER["Standard_Parallel_2",45.5],
    PARAMETER["Latitude_Of_Origin",41.75],
    UNIT["Foot",0.3048]]
ERROR 6: No translation for Lambert_Conformal_Conic to PROJ.4 format is
known.
PROJ.4 rendering of [odf_own.prj] =
---

looks ok.

creating a new GRASS location with the wxGUI-startup wizzard: _New_ -> _Read
a projection and datum terms from a georeferenced data file_ by pointing to
odf_own.shp

---
g.proj -p
-PROJ_INFO-------------------------------------------------
name : NAD_1983_Oregon_Statewide_Lambert_Feet_Intl
datum : nad83
ellps : grs80
proj : lcc
lat_1 : 43
lat_2 : 45.5
lat_0 : 41.75
lon_0 : -120.5
x_0 : 399999.9999999999
y_0 : 0
no_defs : defined
-PROJ_UNITS------------------------------------------------
unit : International Foot
units : International Feet
meters : 0.3048
---

---
v.in.ogr input=D:\temp\rich\attachment-0001\attachment-0001~\odf_own.shp
Check if OGR layer <odf_own> contains polygons...
Creating attribute table for layer <odf_own>...
Importing 623 features (OGR layer <odf_own>)...
[...]
If overlapping is not desired, the input data can be cleaned by snapping
vertices to each other.
Estimated range of snapping threshold: [1e-009, 1]
(Sun Jun 24 20:02:21 2018) Command finished (2 sec)
---

import ok so far; then

---
g.proj -p georef=D:\temp\rich\attachment-0001\attachment-0001~\odf_own.shp
-PROJ_INFO-------------------------------------------------
name : NAD_1983_Oregon_Statewide_Lambert_Feet_Intl
datum : nad83
ellps : grs80
proj : lcc
lat_1 : 43
lat_2 : 45.5
lat_0 : 41.75
lon_0 : -120.5
x_0 : 399999.9999999999
y_0 : 0
no_defs : defined
-PROJ_UNITS------------------------------------------------
unit : International Foot
units : International Feet
meters : 0.3048
(Sun Jun 24 20:04:10 2018) Command finished (0 sec)
---

so locations g.proj -p and the shapefiles' g.proj -p are the same.

-----
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html

On Sun, 24 Jun 2018, Helmut Kudrnovsky wrote:

creating a new GRASS location with the wxGUI-startup wizzard: _New_ ->
_Read a projection and datum terms from a georeferenced data file_ by
pointing to odf_own.shp

Helmut,

   Thanks for teaching me how to handle this situation.

Best regards,

Rich