Opened 7 years ago

Closed 6 years ago

#3332 closed defect (fixed)

v.proj - Error in pj_do_transform

Reported by: DmitryKolesov Owned by: grass-dev@…
Priority: normal Milestone: 7.4.1
Component: Projections/Datums Version: 7.2.2
Keywords: v.proj Cc:
CPU: Unspecified Platform: Unspecified

Description

Create test data, test LOCATIONs, then run GRASS GIS:

# Create the first location:
grass -e -c EPSG:4326 $(pwd)/E4326

# Create test data:
cat > test.geojson << EOF
{
  "type": "FeatureCollection",
  "crs": {
    "type": "name",
    "properties": {
      "name": "urn:ogc:def:crs:EPSG::3857"
    }
  },
  "features": [
    {
      "type": "Feature",
      "properties": {"field2": "123"},
      "geometry": {
        "type": "Point",
        "coordinates": [
          15000823.76479647,
          5781643.081065576
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {"field2": ""},
      "geometry": {
        "type": "Point",
        "coordinates": [
          15019270.955840966,
          5630930.639970958
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {"field2": ""},
      "geometry": {
        "type": "Point",
        "coordinates": [
          15015891.673578057,
          5652388.555190046
        ]
      }
    }
  ]
}
EOF

# Create the second location using provided datafile
grass -e -c test.geojson $(pwd)/TEST

grass  $(pwd)/TEST/PERMANENT

Then run in GRASS session:

v.in.ogr test.geojson out=test
g.mapset location=E4326 mapset=PERMANENT
v.proj location=TEST in=test

The result of the last command is the next error:

WARNING: pj_transform() failed: failed to load datum shift file
ERROR: Error in pj_do_transform

Sorry if I'm duplicating this issue: #1189. But that ticket was created long ago and Windows-specific. So I decided to create new one.

Change History (9)

comment:1 by mlennert, 7 years ago

Sounds like a similar issues as discussed here.

Could you try creating your second location using the EPSG code instead of the GeoJSON file and then attempt to reproject ?

comment:2 by DmitryKolesov, 7 years ago

Hm... If I create the second location using EPSG, then the error isn't raised, import and reprojection became possible.

comment:3 by martinl, 7 years ago

Milestone: 7.2.17.2.2

comment:4 by neteler, 7 years ago

Milestone: 7.2.27.2.3

Ticket retargeted after milestone closed

comment:5 by neteler, 6 years ago

Component: DefaultProjections/Datums
Keywords: v.proj added
Milestone: 7.2.37.4.0
Version: unspecified7.2.2

Potentially good news: I have reproduced your perfectly reported test case and it works in GRASS GIS 7.4.svn (to become 7.4.0):

# last step of test case:
GRASS 7.4.0svn (TEST):~/tmp > v.proj location=TEST in=test
Reprojecting primitives ...
Building topology for vector map <test@PERMANENT>...
Registering primitives...
3 primitives registered
3 vertices registered
Building areas...
 100%
0 areas built
0 isles built
Attaching islands...
Attaching centroids...
 100%
Number of nodes: 0
Number of primitives: 3
Number of points: 3
Number of lines: 0
Number of boundaries: 0
Number of centroids: 0
Number of areas: 0
Number of isles: 0


GRASS 7.4.0svn (TEST):~/tmp > v.info test -e
name=test
mapset=PERMANENT
location=E4326
database=/home/mneteler/tmp
title=
scale=1:1
creator=mneteler
organization=
source_date=Thu Jan  4 23:19:53 2018
timestamp=none
format=native
level=2
num_dblinks=1
attribute_layer_number=1
attribute_layer_name=OGRGeoJSON
attribute_database=/home/mneteler/tmp/E4326/PERMANENT/sqlite/sqlite.db
attribute_database_driver=sqlite
attribute_table=test
attribute_primary_key=cat
projection=Latitude-Longitude
digitization_threshold=0.000000
comment=

It finally looks as expected.

Could you please try with 7.4.0RC1 or, even better, the weekly source code snapshot [1] (or SVN branch)?

[1] https://grass.osgeo.org/grass74/source/snapshot/

comment:6 by neteler, 6 years ago

Milestone: 7.4.07.4.1

Ticket retargeted after milestone closed

comment:7 by DmitryKolesov, 6 years ago

Thank you for the fixing, the transformation works correctly, the error is not appear.

Should I close the issue?

PS Sorry for the delay with my answer.

in reply to:  7 comment:8 by martinl, 6 years ago

Replying to DmitryKolesov:

Thank you for the fixing, the transformation works correctly, the error is not appear.

Should I close the issue?

yes, feel free to close.

comment:9 by DmitryKolesov, 6 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.