Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save wroge/844743b2756dcb47077eacbf2f129b92 to your computer and use it in GitHub Desktop.
Save wroge/844743b2756dcb47077eacbf2f129b92 to your computer and use it in GitHub Desktop.
MGI Austria Lambert
package main
import (
"fmt"
"github.com/wroge/wgs84"
)
func main() {
mgi := wgs84.Helmert(6377397.155, 299.1528128, 577.326, 90.129, 463.919, 5.137, 1.474, 5.297, 2.4232)
mgi.Area = wgs84.AreaFunc(func(lon, lat float64) bool {
if lon < 9.53 || lon > 17.17 || lat < 46.4 || lat > 49.02 {
return false
}
return true
})
mgiLambert := mgi.LambertConformalConic2SP(13.33333333333333, 47.5, 49, 46, 400000, 400000)
epsg := wgs84.EPSG()
epsg.Add(31287, mgiLambert)
east, north, h, err := wgs84.LonLat().SafeTo(epsg.Code(31287))(12, 48, 0)
fmt.Println(east, north, h, err)
// 300591.9569009294 456489.2700867038 -47.37322606891394 <nil>
// https://epsg.io/transform#s_srs=4326&t_srs=31287&x=12.0000000&y=48.0000000
}
https://epsg.io/31287
PROJCS["MGI / Austria Lambert",
GEOGCS["MGI",
DATUM["Militar_Geographische_Institute",
SPHEROID["Bessel 1841",6377397.155,299.1528128,
AUTHORITY["EPSG","7004"]],
TOWGS84[577.326,90.129,463.919,5.137,1.474,5.297,2.4232],
AUTHORITY["EPSG","6312"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9122"]],
AUTHORITY["EPSG","4312"]],
PROJECTION["Lambert_Conformal_Conic_2SP"],
PARAMETER["standard_parallel_1",49],
PARAMETER["standard_parallel_2",46],
PARAMETER["latitude_of_origin",47.5],
PARAMETER["central_meridian",13.33333333333333],
PARAMETER["false_easting",400000],
PARAMETER["false_northing",400000],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AUTHORITY["EPSG","31287"]]
@wroge
Copy link
Author

wroge commented Feb 19, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment