Ejemplo n.º 1
0
        protected override PrimitiveSpatialResult QueryPrimitivesInternal(PrimitiveSpatialQuery specification, bool uniqueEntities, DataSource.QueryProgress progress)
        {
            GeometryQueryRegion region = specification.SpatialFilter.Region as GeometryQueryRegion;

            if (region != null)
            {
                Box2 regionBox = region.Geometry as Box2;
                if (regionBox != null)
                {
                    RasterPatch2 rasterPatch = null;
                    if (isWarped)
                    {
                        colorMapHelper = new ColorMapHelper(wfield, regionBox, minT, maxT);
                        rasterPatch    = colorMapHelper.GetWarpedTilePatch();

                        minT = colorMapHelper.MinT;
                        maxT = colorMapHelper.MaxT;
                    }
                    else
                    {
                        colorMapHelper = new ColorMapHelper(field, regionBox, minT, maxT);
                        rasterPatch    = colorMapHelper.GetTilePatch();

                        minT = colorMapHelper.MinT;
                        maxT = colorMapHelper.MaxT;
                    }
                    if (rasterPatch != null)
                    {
                        PrimitiveSpecification spec = new PrimitiveSpecification(entity,
                                                                                 this.Ontology.PrimitiveTypes["RasterPatch"], rasterPatch);
                        SimplePrimitive primitive = new SimplePrimitive(this, spec);
                        return(new SingleImageResult(primitive));
                    }
                }
            }
            else
            {
            }

            return(new SingleImageResult(null));
        }
Ejemplo n.º 2
0
        protected override PrimitiveSpatialResult QueryPrimitivesInternal(PrimitiveSpatialQuery specification, bool uniqueEntities, DataSource.QueryProgress progress)
        {

            GeometryQueryRegion region = specification.SpatialFilter.Region as GeometryQueryRegion;
            if (region != null)
            {
                Box2 regionBox = region.Geometry as Box2;
                if (regionBox != null)
                {
                    RasterPatch2 rasterPatch = null;
                    if (isWarped)
                    {
                        colorMapHelper = new ColorMapHelper(wfield, regionBox, minT, maxT);
                        rasterPatch = colorMapHelper.GetWarpedTilePatch();

                        minT = colorMapHelper.MinT;
                        maxT = colorMapHelper.MaxT;
                    }
                    else
                    {
                        colorMapHelper = new ColorMapHelper(field, regionBox, minT, maxT);
                        rasterPatch = colorMapHelper.GetTilePatch();

                        minT = colorMapHelper.MinT;
                        maxT = colorMapHelper.MaxT;
                    }
                    if (rasterPatch != null)
                    {
                        PrimitiveSpecification spec = new PrimitiveSpecification(entity,
                        this.Ontology.PrimitiveTypes["RasterPatch"], rasterPatch);
                        SimplePrimitive primitive = new SimplePrimitive(this, spec);
                        return new SingleImageResult(primitive);

                    }
                }
            }
            else
            {

            }

            return new SingleImageResult(null);
        }