Exemplo n.º 1
0
        public async Task <IActionResult> GetGfs(short zoom, short x, short y, long epocTime)
        {
            Dimension dimension;
            string    result;

            if (epocTime == 0)
            {
                dimension = await _dimensionManager.GetDimension(zoom, x, y);

                if (dimension == null)
                {
                    return(NotFound());
                }
                result = await _gfsCrawler.GetDimensionContentAsync(dimension);

                if (string.IsNullOrEmpty(result))
                {
                    return(NoContent());
                }
                return(Ok(result));
            }
            dimension = await _dimensionManager.GetDimension(zoom, x, y, false);

            if (dimension == null)
            {
                return(NotFound());
            }
            result = await _gfsCrawler.GetDimensionContentByTimeAsync(dimension, epocTime);

            if (string.IsNullOrEmpty(result))
            {
                return(NoContent());
            }
            return(Ok(result));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Get(short zoom, short x, short y)
        {
            var dimension = await _dimensionManager.GetDimension(zoom, x, y);

            if (dimension == null)
            {
                return(Ok("[]"));
            }
            var returnValue = await LabelCrawler.GetDimensionContentAsync(dimension);

            return(Ok(returnValue));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Get(short zoom, short x, short y)
        {
            var dimension = await _dimensionManager.GetDimension(zoom, x, y);

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

            var stream = _tileCrawler.GetDimensionContentAsync(dimension);

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

            return(File(stream, "image/png"));
        }