Skip to content

Postgres SRID

Jason Lewis edited this page May 4, 2020 · 1 revision

The Npgsql EF provider defaults columns to SRID of 0. I haven’t been able to find a way to change this so it’s important to create new data points in the following way.

var geometryFactory = NtsGeometryServices.Instance.CreateGeometryFactory(srid: 0);
objUpdate.CurrentLocation = geometryFactory.CreatePoint(new GeoAPI.Geometries.Coordinate(location.Long, location.Lat));

Note the srid: 0 in the factory instance creation.

Clone this wiki locally