/// <summary> /// Converts the geometry to svg and writes the svg to a file. /// </summary> /// <param name="filename">The name of the svg file.</param> /// <param name="pm">The precision model for the geometries</param> /// <param name="a">The geometry to be written to svg.</param> public void CreateSVG(string filename, Geotools.Geometries.PrecisionModel pm, Geometry a) { GeometrySVGWriter svgWriter = new GeometrySVGWriter(pm); StreamWriter sw = new StreamWriter(filename); double minx, miny, maxx, maxy; a.Extent2D(out minx, out miny, out maxx, out maxy); sw.WriteLine(String.Format("<svg viewBox=\"{0} {1} {2} {3}\">",minx,miny,maxx,maxy*1.2)); svgWriter.Write(a,sw,"fill-rule:evenodd;","fill:ltgray;stroke:blue;stroke-width:1;fill-opacity:0.2"); sw.WriteLine("</svg>"); sw.Close(); }
/// <summary> /// Creates the "B" geometry for this TestCase by instantiating a GeometryFactory object and /// calling its CreateFromWKT method. The geometry object is created from its Well-known text. /// </summary> /// <param name="precisionModel">The precision model for this run.</param> /// <returns>OGC.SimpleFeatures.IGeometry object.</returns> public IGeometry CreateBGeometry(Geotools.Geometries.PrecisionModel precisionModel) { // create the GeometryFactory object... Geotools.Geometries.GeometryFactory geometryFactory = new Geotools.Geometries.GeometryFactory(precisionModel, -1); // create the geometry and return it... return geometryFactory.CreateFromWKT(this._bGeometry); }