How to determine the type of geography using Npgsql and OrmLite (using postgresql, postgis, C #)

How do I determine the type of postgis geography in my C # class model so that OrmLite can easily pass it to Postgresql so that I can run spatial queries in addition to storing spatial data in the Geography column?

+7
source share
1 answer

The best NetTopologySuite library for this occasion;

you can use this:

protected GisSharpBlog.NetTopologySuite.Geometries.Geometry _geom; public GisSharpBlog.NetTopologySuite.Geometries.Geometry Geom { get { return _geom; } set { _geom = value; } } protected string _geomwkt; public virtual string GeomWKT { get { if (this.Geom != null) return this.Geom.ToText(); else return ""; } set { string wktString = value; if (string.IsNullOrEmpty(wktString)) _geom = null; else { var fact = new GeometryFactory(); var wktreader = new WKTReader(fact); _geom = (Geometry)wktreader.Read(wktString); } } } 
0
source

All Articles