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

I need register more epsg code and string? #38

Open
pampa0629 opened this issue Mar 11, 2021 · 4 comments
Open

I need register more epsg code and string? #38

pampa0629 opened this issue Mar 11, 2021 · 4 comments

Comments

@pampa0629
Copy link

In the source of "Convert.go", the default epsg codes just have three, including EPSG3395, EPSG3857 and EPSG4087. I need use more. so I add Register function, the source code like :

func Register(dest EPSGCode, projString string) {
cacheLock.Lock()
projStrings[dest] = projString
cacheLock.Unlock()
}

@roggen-yang
Copy link

I will add WGS84 support first, can you add it like your code?

@ARolek
Copy link
Member

ARolek commented Jul 21, 2021

WGS84 support is already available:

proj/Convert.go

Lines 25 to 34 in 7d903f0

const (
EPSG3395 EPSGCode = 3395
WorldMercator = EPSG3395
EPSG3857 = 3857
WebMercator = EPSG3857
EPSG4087 = 4087
WorldEquidistantCylindrical = EPSG4087
EPSG4326 = 4326
WGS84 = EPSG4326
)

@roggen-yang
Copy link

var projStrings = map[EPSGCode]string{
EPSG3395: "+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84", // TODO: support +units=m +no_defs
EPSG3857: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0", // TODO: support +units=m +nadgrids=@null +wktext +no_defs
EPSG4087: "+proj=eqc +lat_ts=0 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84", // TODO: support +units=m +no_defs
}

in this map, there are only three codes support

@ARolek
Copy link
Member

ARolek commented Jul 22, 2021

Yep, you're right. I think the conversion support is from 4326 to these codes, but not the other way around.

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

No branches or pull requests

3 participants