Add RequireValid env variable and parse options

This commit is contained in:
Steve Lacy 2019-01-10 09:36:58 -07:00
parent 1eee8ee1a1
commit 1a8993feaf
No known key found for this signature in database
GPG Key ID: BA1696A6FA8C27F0
3 changed files with 10 additions and 1 deletions

View File

@ -27,6 +27,11 @@ func (s String) Empty() bool {
return true
}
// Valid ...
func (s String) Valid() bool {
return s.Valid()
}
// Rect ...
func (s String) Rect() geometry.Rect {
return geometry.Rect{}

View File

@ -166,7 +166,7 @@ func (server *Server) cmdSearchArgs(
err = errInvalidNumberOfArguments
return
}
s.obj, err = geojson.Parse(obj, nil)
s.obj, err = geojson.Parse(obj, &server.geomParseOpts)
if err != nil {
return
}

View File

@ -182,6 +182,10 @@ func Serve(host string, port int, dir string, http bool) error {
if err == nil {
server.geomParseOpts.IndexChildren = int(n)
}
requireValid := os.Getenv("REQUIREVALID")
if requireValid != "" {
server.geomParseOpts.RequireValid = true
}
indexKind := os.Getenv("T38IDXGEOMKIND")
switch indexKind {
default: