This project is read-only.

EPSG to Proj4 string

Dec 30, 2011 at 7:51 AM
Edited Dec 30, 2011 at 8:58 AM

Hello,

Is it possible to set an EPSG code (2154) and to get a Proj4 String.

How?

Thanks

Dec 30, 2011 at 9:39 AM
Edited Dec 30, 2011 at 9:43 AM

I Try with VB.net

 

        Dim StrOj As New ProjectionInfo
        StrOj.ReadAuthorityCode("EPSG", 27572) '4326 27572 2154
        ListeProj = StrOj.ToProj4String

 

A exception out of range is level

in Projections.Datum InitializeToWgs84

 if (_toWgs84[3] == 0.0 && _toWgs84[4] == 0.0 &&
 _toWgs84[5] == 0.0 && _toWgs84[6] == 0.0) _datumtype = DatumType.Param3;

No problem with EPSG 4326

Thanks

Dec 30, 2011 at 12:50 PM

Sorry,

It was so simple, even for a French

        EPSGtoStrPROJ4 = ""
        Dim prj As ProjectionInfo = AuthorityCodes.AuthorityCodeHandler.Instance(String.Format("{0}:{1}", "EPSG", code))
        If prj IsNot Nothing Then
            EPSGtoStrPROJ4 = (prj.ToProj4String())
        End If
Thanks for me