I am converting RPG files in NTF\_Lambert\_II\_etendu to wgs\_84 using: 

```
ogr2ogr -t_srs EPSG:4326 ilot_2008_027_wgs84_2.shp ilot_2008_027.shp

```

but the result is off by about 30 meters. Surprisingly, the same conversion using Qgis works fine. Could anybody tell me how to correct that or how to investigate the exact transformation qgis is doing? 

The proj file of the intial file is : 

```
PROJCS["NTF_Lambert_II_etendu",GEOGCS["GCS_NTF",DATUM["D_NTF",SPHEROID["Clarke_1880_IGN",6378249.2,293.46602]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",600000.0],PARAMETER["False_Northing",2200000.0],PARAMETER["Central_Meridian",2.3372291667],PARAMETER["Standard_Parallel_1",45.8989188889],PARAMETER["Standard_Parallel_2",47.6960144444],PARAMETER["Scale_Factor",1.0],PARAMETER["Latitude_Of_Origin",46.8],UNIT["Meter",1.0]]

```
['https://gis.stackexchange.com/questions/176688', 'https://gis.stackexchange.com', 'https://gis.stackexchange.com/users/49290/']
NTF Lambert II has a `towgs84` datum shift, but that is not included in the .prj file.

The .prj file uses a different naming for the projection, so the EPSG code finder might fail.

I assume QGIS assigns the correct EPSG code (maybe in the .qpj file), and makes a standard transformation from one EPSG code to another using full towgs84 parameters.

You should get the same result with ogr2ogr using EPSG codes 27572, 7411, 7412 or 7421 as `-s_srs`.
As mentioned by @AndreJ specifying the EPSG code makes it work. Specifically the following work:

```
ogr2ogr -t_srs EPSG:4326 -s_srs EPSG:7421 ilot_2008_027_wgs84_2.shp ilot_2008_027.shp

```

Alternatively, I was trying to use the qgis python API to do it all in python using qgis but could not get it to work.