mirror of https://github.com/tidwall/tile38.git
Add RequireValid env variable and parse options
This commit is contained in:
parent
1eee8ee1a1
commit
1a8993feaf
|
@ -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{}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue