func GeojsonSearch(idx FenceIndex, name string, body []byte) (result ResponseMessage, err error) {
	point, err := UnmarshalPoint(body)
	if err != nil {
		return
	}
	c := geo.Coordinate{point.Geometry.Coordinates[1], point.Geometry.Coordinates[0]} //geojson swap
	matchs, err := idx.Search(name, c)
	if err != nil {
		return
	}
	fences := make([]Properties, len(matchs))
	for i, fence := range matchs {
		fences[i] = fence.Properties
	}
	result = ResponseMessage{
		Query:  *point,
		Fences: fences,
	}
	return
}
// Searchs the fence for the contents of body. Body should be a geojson point feature.
// Returns a json string of the body with a property key 'fences' which is a list of
// the property object of the features that contain the query.
Searchs the fence for the contents of body. Body should be a geojson point feature.
Returns a json string of the body with a property key 'fences' which is a list of
the property object of the features that contain the query.
// Searchs the fence for the contents of body . Body should be a geojson point feature . // Returns a json string of the body with a property key ' fences ' which is a list of // the property object of the features that contain the query .
func GeojsonSearch(idx FenceIndex, name string, body []byte) (result ResponseMessage, err error) {
	point, err := UnmarshalPoint(body)
	if err != nil {
		return
	}
	c := geo.Coordinate{point.Geometry.Coordinates[1], point.Geometry.Coordinates[0]} 
	matchs, err := idx.Search(name, c)
	if err != nil {
		return
	}
	fences := make([]Properties, len(matchs))
	for i, fence := range matchs {
		fences[i] = fence.Properties
	}
	result = ResponseMessage{
		Query:  *point,
		Fences: fences,
	}
	return
}
func GeojsonSearch ( idx FenceIndex , name string , body [ ] byte ) ( result ResponseMessage , err error ) { point , err := UnmarshalPoint ( body ) if err != nil { return } c := geo . Coordinate { point . Geometry . Coordinates [ 1 ] , point . Geometry . Coordinates [ 0 ] } matchs , err := idx . Search ( name , c ) if err != nil { return } fences := make ( [ ] Properties , len ( matchs ) ) for i , fence := range matchs { fences [ i ] = fence . Properties } result = ResponseMessage { Query : * point , Fences : fences , } return }
Searchs the fence for the contents of body.
Searchs the fence for the contents of body .
//geojson swap