using System.Collections.Generic; using GeoAPI.Coordinates; using GeoAPI.Geometries; using GisSharpBlog.NetTopologySuite.Geometries; using NetTopologySuite.Coordinates; namespace GisSharpBlog.NetTopologySuite { public static class GeometryServices { private static readonly Dictionary> _factories = new Dictionary>(); public static IGeometryFactory GetGeometryFactory(PrecisionModelType pmtype) { if (!_factories.ContainsKey(pmtype)) _factories.Add(pmtype, CreateGeometryFactory(pmtype)); return _factories[pmtype]; } private static IGeometryFactory CreateGeometryFactory(PrecisionModelType pmtype) { return new GeometryFactory( new BufferedCoordinateSequenceFactory( new BufferedCoordinateFactory(pmtype)) ); } } }