#6456 closed defect (fixed)
ogr2ogr: inconsistent reprojection behaviour
Reported by: | cricruh | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 2.0.3 |
Component: | OGR_SRS | Version: | svn-trunk |
Severity: | normal | Keywords: | |
Cc: |
Description (last modified by )
I am not an expert of ogr2ogr, but using it for a long time. Something is weird with version 2.0.2. When projecting to epsg:3395 from epsg4326, the shape is shifted.
ogr2ogr -t_srs EPSG:3395 16E8Cogr2ogr.shp 16E8C.shp
Attachments (1)
Change History (13)
by , 8 years ago
comment:1 by , 8 years ago
Description: | modified (diff) |
---|
comment:2 by , 8 years ago
comment:3 by , 8 years ago
Thanks for pointing this out! I was lost. 2 days of work to get rid of 3395 :-(
comment:4 by , 8 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:5 by , 8 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
I also faced with shift in 3395. This is occurs with shape file because strange behavior in morphToESRI (standard_parallel_1 set with value 6.64456744726493).
How to reproduce:
#!/usr/bin/env python # -*- coding: utf-8 -*- from osgeo import osr srs = osr.SpatialReference() srs.ImportFromEPSG(3395) print srs.ExportToWkt() srs.MorphToESRI() print srs.ExportToWkt()
The morphed SRS looks like:
PROJCS["WGS_84_World_Mercator",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Mercator"],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],PARAMETER["standard_parallel_1",6.64456744726493],UNIT["Meter",1]]
and should be (http://spatialreference.org/ref/epsg/3395/esriwkt/):
PROJCS["WGS 84 / World Mercator",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Mercator"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1]]
comment:6 by , 8 years ago
Component: | default → OGR_SRS |
---|---|
Version: | unspecified → svn-trunk |
comment:7 by , 8 years ago
I'm on it. This is due to #4861. The math that was provided for 1SP to 2SP conversion was wrong...
comment:12 by , 8 years ago
Milestone: | → 2.0.3 |
---|
A 2.0.3RC2 has been pushed, so this will be in final 2.0.3
Are you sure you really want to use EPSG:3395 which is the Ellipsoidal WGS 84 mercator, and not EPSG:3857 the commonly used Spherical WGS 84 Mercator (aka Google Mercator / Google Maps projection) ?