Ejemplo n.º 1
0
 public SpatialField(string fieldName, SpatialOptions options)
 {
     _options = options ?? throw new ArgumentNullException(nameof(options));
     _ntsContext = CreateNtsContext(options);
     _shapeStringReadWriter = new ShapeStringReadWriter(options, _ntsContext);
     Strategy = CreateStrategy(fieldName, options, _ntsContext);
 }
Ejemplo n.º 2
0
        public Shape ReadCircle(double radius, double latitude, double longitude, SpatialUnits? unitOverride)
        {
            var context = GetContext();

            if (_options.Type == SpatialFieldType.Geography)
                radius = ShapeStringReadWriter.TranslateCircleRadius(radius, unitOverride ?? _options.Units);

            return context.MakeCircle(longitude, latitude, radius);
        }