Skip to content

Instantly share code, notes, and snippets.

@jeromenerf
Last active December 17, 2015 22:09
Show Gist options
  • Select an option

  • Save jeromenerf/5679866 to your computer and use it in GitHub Desktop.

Select an option

Save jeromenerf/5679866 to your computer and use it in GitHub Desktop.
Back and forth Google WGS84 and STIF Lambert 2 Étendu, via Lambert 93
package main
import (
"fmt"
proj "github.com/pebbe/go-proj-4/proj"
)
func main () {
// BONNE NOUVELLE
lat := 48.8674451
long := 2.3496033
//l2et, _ := proj.NewProj("+init=epsg:27572")
l2et, _ := proj.NewProj("+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=2.33722917 +k_0=0.99987742 +x_0=600000 + y_0=2200000 +a=6378249.2 +b=6356515 +pm=paris +units=m +no_defs no_defs <>")
x, y, _ := proj.Fwd(l2et, long, lat)
fmt.Printf("x/y : %.2f %.2f\n", x, y)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment