/
dev-npgsql
/
npgsql
Обзор
Документация
Войти
/
dev-npgsql
/
npgsql
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
v8.0.8
src/Npgsql.NetTopologySuite/NpgsqlNetTopologySuiteExtensions.cs
33 строки
2 KB
Nino Floris
Introduce resolver factories (#5374)
14 ноя 2023, 21:06
Не верифицирован
14 ноя 2023, 21:06
e8f20a0
Код
Авторство
О чём код?
using NetTopologySuite.Geometries; using Npgsql.NetTopologySuite.Internal; using Npgsql.TypeMapping; // ReSharper disable once CheckNamespace namespace Npgsql; /// <summary> /// Extension allowing adding the NetTopologySuite plugin to an Npgsql type mapper. /// </summary> public static class NpgsqlNetTopologySuiteExtensions { /// <summary> /// Sets up NetTopologySuite mappings for the PostGIS types. /// </summary> /// <param name="mapper">The type mapper to set up (global or connection-specific).</param> /// <param name="coordinateSequenceFactory">The factory which knows how to build a particular implementation of ICoordinateSequence from an array of Coordinates.</param> /// <param name="precisionModel">Specifies the grid of allowable points.</param> /// <param name="handleOrdinates">Specifies the ordinates which will be handled. Not specified ordinates will be ignored. /// If <see cref="F:GeoAPI.Geometries.Ordiantes.None" /> is specified, an actual value will be taken from /// the <see cref="P:GeoAPI.Geometries.ICoordinateSequenceFactory.Ordinates"/> property of <paramref name="coordinateSequenceFactory"/>.</param> /// <param name="geographyAsDefault">Specifies that the geography type is used for mapping by default.</param> public static INpgsqlTypeMapper UseNetTopologySuite( this INpgsqlTypeMapper mapper, CoordinateSequenceFactory? coordinateSequenceFactory = null, PrecisionModel? precisionModel = null, Ordinates handleOrdinates = Ordinates.None, bool geographyAsDefault = false) { mapper.AddTypeInfoResolverFactory(new NetTopologySuiteTypeInfoResolverFactory(coordinateSequenceFactory, precisionModel, handleOrdinates, geographyAsDefault)); return mapper; } }