Skip to main content
revise URLs
Source Link
Mike T
  • 42.4k
  • 10
  • 129
  • 190

Take a look at PostGIS and Entity FrameworkPostGIS and Entity Framework. The main library for connecting .NET to PostgreSQL is NpgsqlNpgsql, which can be used with (e.g.) SharpMap, NetTopologySuiteNetTopologySuite, GdalOgrInCsharp, etc., depending on what you are doing.

Regarding geometry data types, Npgsql uses System.Byte[] in C# to represent WKB (Well-Known Binary). This byte array type can be selected from PostGIS SQL functions ST_AsBinary(geom)ST_AsBinary(geom) or ST_AsEWKB(geom)ST_AsEWKB(geom). Unless you are programming your own custom renderer or data converter, you generally won't need to understand WKB at the byte level. But WKB is useful to pass geometries to other libraries that understand the type without loosing precision of coordinates.

Take a look at PostGIS and Entity Framework. The main library for connecting .NET to PostgreSQL is Npgsql, which can be used with (e.g.) SharpMap, NetTopologySuite, GdalOgrInCsharp, etc., depending on what you are doing.

Regarding geometry data types, Npgsql uses System.Byte[] in C# to represent WKB (Well-Known Binary). This byte array type can be selected from PostGIS SQL functions ST_AsBinary(geom) or ST_AsEWKB(geom). Unless you are programming your own custom renderer or data converter, you generally won't need to understand WKB at the byte level. But WKB is useful to pass geometries to other libraries that understand the type without loosing precision of coordinates.

Take a look at PostGIS and Entity Framework. The main library for connecting .NET to PostgreSQL is Npgsql, which can be used with (e.g.) SharpMap, NetTopologySuite, GdalOgrInCsharp, etc., depending on what you are doing.

Regarding geometry data types, Npgsql uses System.Byte[] in C# to represent WKB (Well-Known Binary). This byte array type can be selected from PostGIS SQL functions ST_AsBinary(geom) or ST_AsEWKB(geom). Unless you are programming your own custom renderer or data converter, you generally won't need to understand WKB at the byte level. But WKB is useful to pass geometries to other libraries that understand the type without loosing precision of coordinates.

Source Link
Mike T
  • 42.4k
  • 10
  • 129
  • 190

Take a look at PostGIS and Entity Framework. The main library for connecting .NET to PostgreSQL is Npgsql, which can be used with (e.g.) SharpMap, NetTopologySuite, GdalOgrInCsharp, etc., depending on what you are doing.

Regarding geometry data types, Npgsql uses System.Byte[] in C# to represent WKB (Well-Known Binary). This byte array type can be selected from PostGIS SQL functions ST_AsBinary(geom) or ST_AsEWKB(geom). Unless you are programming your own custom renderer or data converter, you generally won't need to understand WKB at the byte level. But WKB is useful to pass geometries to other libraries that understand the type without loosing precision of coordinates.