Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proj.4 support to Go #2

Open
owsi opened this issue May 5, 2017 · 3 comments
Open

Add proj.4 support to Go #2

owsi opened this issue May 5, 2017 · 3 comments
Assignees
Labels

Comments

@owsi
Copy link

owsi commented May 5, 2017

No description provided.

@owsi owsi added the ready label May 5, 2017
@owsi owsi assigned owcm May 5, 2017
@owcm
Copy link

owcm commented May 5, 2017

Using https://github.com/pebbe/go-proj-4 project for go wrapper

@owcm
Copy link

owcm commented May 5, 2017

Update, moved to using https://github.com/xeonx/proj4 project. Everything compiles and the tests runs.
Proj4 of course has to be deployed.
environment variable export PROJ_LIB needs to be set: example export PROJ_LIB=/usr/local/Cellar/proj/4.9.3/share/proj

@owcm
Copy link

owcm commented May 10, 2017

Moved to using github.com/ctessum/geom project. Pure proj4 Go implementation.
Added unit tests.
No longer a need for PROJ_LIB environment variable to be set.

To project a bounds or list of 1 or more points call the lambdas/proj4support/boundsToWgs84 method

ConvertPoints( epsg string , points []geom.Point ) (outpoints []geom.Point)

Example:

var testPoints []geom.Point

testPoints = append(testPoints, geom.Point{X: 408956.500000, Y:4088009.500000 })
testPoints = append(testPoints, geom.Point{X: 408956.500000, Y:4081996.500000 })
testPoints = append(testPoints, geom.Point{X: 415450.500000, Y:4088009.500000 })
testPoints = append(testPoints, geom.Point{X: 415450.500000, Y:4081996.500000 })

    epsgCode = "32618"      

outpoints := ConvertPoints( epsgCode, testPoints)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants