Skip to content

Commit a215af7

Browse files
craig[bot]otan
andcommitted
51319: geoviz: expose --geo_libs flag r=otan a=otan Release note: None Co-authored-by: Oliver Tan <[email protected]>
2 parents a9e9c9c + dfdd8bb commit a215af7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pkg/cmd/geoviz/main.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import (
2121
"os"
2222
"path/filepath"
2323
"strings"
24+
25+
"github.com/cockroachdb/cockroach/pkg/geo/geos"
2426
)
2527

2628
var (
@@ -84,9 +86,19 @@ func handleLoad(w http.ResponseWriter, r *http.Request) {
8486
}
8587
}
8688

89+
var flagGeoLibsDir = flag.String(
90+
"geo_libs",
91+
"/usr/local/lib/cockroach",
92+
"Location where geospatial related libraries can be found.",
93+
)
94+
8795
func main() {
8896
flag.Parse()
8997

98+
if _, err := geos.EnsureInit(geos.EnsureInitErrorDisplayPrivate, *flagGeoLibsDir); err != nil {
99+
log.Fatalf("could not initialize GEOS - geospatial functions may not be available: %v", err)
100+
}
101+
90102
http.HandleFunc("/", handleIndex)
91103
http.HandleFunc("/load", handleLoad)
92104

0 commit comments

Comments
 (0)