[Proj] Misplaced SHP obtained with PROJ 4.8.0 called from gvSIG CE

Jorge Arevalo jorge.arevalo at geomati.co
Mon Aug 26 07:54:08 EST 2013

On Sun, Aug 25, 2013 at 10:16 PM, Jorge Arevalo
<jorge.arevalo at geomati.co> wrote:
> On Wed, Aug 21, 2013 at 8:15 PM, Hermann Peifer <peifer at gmx.eu> wrote:
>> On 2013-08-21 17:04, Jorge Arevalo wrote:
>>> Hello,
>>> I'm trying to fix a bug related with PROJ in gvSIG CE. This desktop
>>> client creates its own JNI wrapper, based on PROJ sources. The
>>> reprojection of shapefiles using grid files works with the wrapper
>>> based on PROJ 4.5.0, but it fails if we construct the same wrapper
>>> based on any upper version of PROJ (PROJ 4.8.0, for example).
>>> Here, the use case that causes the problem:
>>> - We want to reproject this shapefile from epsg:23030 to epsg:25830:
>>> https://dl.dropboxusercontent.com/u/6599273/gis_data/EPSG23030_data.zip
>>> - We want to use this grid file to perform the operation:
>>> https://dl.dropboxusercontent.com/u/6599273/gis_data/sped2et.gsb
>>> The operation done with the JNI wrapper based on PROJ 4.5.0 works
>>> fine. But if we use PROJ 4.8.0 as base, we get a misplaced file. Here,
>>> a screenshot. In blue, the original shapefile. In green, the shapefile
>>> correctly reprojected (PROJ 4.5.0). In red, the misplaced shapefile
>>> (PROJ 4.8.0)
>>> https://dl.dropboxusercontent.com/u/6599273/errors/gvsigce/gvsigce_misplacing_reproj.png
>>> Debugging, we found the problem is in pj_transform.c. I guess it's
>>> related with the way we pass information to PROJ functions. I've made
>>> a diff between both versions (pj_transform in PROJ 4.5.0 and PROJ
>>> 4.8.0), but I see several changes, and I don't know where to focus.
>>> Any clue?
>>> Many thanks in advance, and best regards,
>> I assume that this is your definition of the target SRS:
>> +proj=utm +zone=30 +ellps=GRS80 +units=m +no_defs
>> if yes, you'd have to change it to:
>> +proj=utm +zone=30 +ellps=GRS80 +nadgrids=@null +units=m +no_defs
>> Further reading: Why do I get different results with 4.5.0 and 4.6.0?
>> http://trac.osgeo.org/proj/wiki/FAQ#WhydoIgetdifferentresultswith4.5.0and4.6.0
>> Hermann
> Hello Hermann,
> Yes, I think that is definitely related with my problem. My SRS
> definition string is incorrect. Now, I need to review the way it's
> built in gvSIG CE. Many thanks for putting me in the right track!
> --
> Jorge Arévalo
> http://geomati.co

Hello again,

Actually, my SRSs are:

source SRS: +proj=tmerc +lat_0=0.0 +lon_0=-3.0 +k=0.9996 +x_0=500000.0
+y_0=0.0 +ellps=intl +units=m +nadgrids=sped2et.gsb

target SRS: +proj=tmerc +lat_0=0.0 +lon_0=-3.0 +k=0.9996 +x_0=500000.0
+y_0=0.0 +ellps=GRS80 +units=m

First one is obtained from epsg:23030, and second one from epsg:25830.
I've specified sped2et.gsb as grid file (I know it should include the
@ before the grid's name to avoid errors if that file doesn't exist).
Basically, these PROJ4 strings are equivalents to yours, right? So,
the transformation should work with them

Best regards,

Jorge Arévalo

More information about the Proj mailing list