Beispiel #1
0
        public async Task <ActionResult <object> > GetFeatureLookup([FromQuery] FeatureRequestModel request)
        {
            _metrics.Measure.Counter.Increment(MetricsRegistry.GetFeatureLookupCounter);

            if (string.IsNullOrEmpty(request?.Key) || !Enum.IsDefined(typeof(ShapeProperties), request.Key))
            {
                return(BadRequest());
            }

            var validate = _shapeServiceResolver(ShapeProperties.BoroughBoundaries.ToString()).GetFeatureLookup(request.X, request.Y);

            if (validate == null)
            {
                return(NoContent());
            }

            var results = _shapeServiceResolver(request.Key).GetFeatureLookup(request.X, request.Y);

            if (results == null)
            {
                return(NotFound());
            }

            _metrics.Measure.Counter.Increment(MetricsRegistry.GetFeatureTypeLookupCounter(request.Key));

            return(await Task.FromResult(Ok(results)));
        }