예제 #1
0
        public ShapefileRenderer(
            string filename,
            Context context,
            Ellipsoid globeShape,
            ShapefileAppearance appearance)
        {
            Shapefile shapefile = new Shapefile(filename);

            switch (shapefile.ShapeType)
            {
            case ShapeType.Point:
                PointShapefile pointShapefile = new PointShapefile(shapefile, context, globeShape, appearance);
                pointShapefile.DepthWrite = false;
                _shapefileGraphics        = pointShapefile;
                break;

            case ShapeType.Polyline:
                PolylineShapefile polylineShapefile = new PolylineShapefile(shapefile, context, globeShape, appearance);
                polylineShapefile.DepthWrite = false;
                _shapefileGraphics           = polylineShapefile;
                break;

            case ShapeType.Polygon:
                PolygonShapefile polygonShapefile = new PolygonShapefile(shapefile, context, globeShape, appearance);
                polygonShapefile.DepthWrite = false;
                _shapefileGraphics          = polygonShapefile;
                break;

            default:
                throw new NotSupportedException("Rendering is not supported for " + shapefile.ShapeType.ToString() + " shapefiles.");
            }
        }
예제 #2
0
        public ShapefileRenderer(
            string filename, 
            Context context, 
            Ellipsoid globeShape,
            ShapefileAppearance appearance)
        {
            Shapefile shapefile = new Shapefile(filename);

            switch (shapefile.ShapeType)
            {
                case ShapeType.Point:
                    PointShapefile pointShapefile = new PointShapefile(shapefile, context, globeShape, appearance);
                    pointShapefile.DepthWrite = false;
                    _shapefileGraphics = pointShapefile;
                    break;
                case ShapeType.Polyline:
                    PolylineShapefile polylineShapefile = new PolylineShapefile(shapefile, context, globeShape, appearance);
                    polylineShapefile.DepthWrite = false;
                    _shapefileGraphics = polylineShapefile;
                    break;
                case ShapeType.Polygon:
                    PolygonShapefile polygonShapefile = new PolygonShapefile(shapefile, context, globeShape, appearance);
                    polygonShapefile.DepthWrite = false;
                    _shapefileGraphics = polygonShapefile;
                    break;
                default:
                    throw new NotSupportedException("Rendering is not supported for " + shapefile.ShapeType.ToString() + " shapefiles.");
            }
        }