File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ matrix:
1414# - go: "1.8.x"
1515# env: CGO_ENABLED=0
1616 - go : " 1.10.x"
17- - go : " 1.9.x"
17+ # - go: "1.9.x"
1818# - go: "1.8.x"
1919
2020script :
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package proj
22
33import (
44 "fmt"
5+ "sync"
56
67 "github.com/go-spatial/proj/core"
78 "github.com/go-spatial/proj/support"
@@ -21,6 +22,9 @@ const (
2122 WebMercator = EPSG3857
2223)
2324
25+ // ensure only one person is updating our cache of converters at a time
26+ var cacheLock = sync.Mutex {}
27+
2428// Convert performs a conversion from a 4326 coordinate system (lon/lat
2529// degrees, 2D) to the given projected system (x/y meters, 2D).
2630//
@@ -32,7 +36,9 @@ const (
3236// y1, x2, y2, ...].
3337func Convert (dest EPSGCode , input []float64 ) ([]float64 , error ) {
3438
39+ cacheLock .Lock ()
3540 conv , err := newConversion (dest )
41+ cacheLock .Unlock ()
3642 if err != nil {
3743 return nil , err
3844 }
You can’t perform that action at this time.
0 commit comments