If I define the polygon in WKT format as this (longitude/latitude):
string wkt = "POLYGON ((15.981800258159638 45.810693408924287, 15.983624160289764 45.810783148865241, 15.983688533306122 45.809844611497965, 15.981843173503876 45.8096838246252, 15.981800258159638 45.810693408924287))"
and I create the DbGeography
object as this:
var polygon = System.Data.Entity.Spatial.DbGeography.FromText(wkt);
the value of the Area
property is 510065621695499.69
If I do the same thing using Postgres and PostGis like this:
select ST_Area(ST_GeographyFromText(wkt))
the result is 15496.7483872527 which should be the correct value.
If I create the polygon by reversing coordinates (latitude/longitude), both DbGeography
and ST_Area
return the same value (21247.6269483712)
Can anybody explain what is going on here?
PS: the polygon is located in Zagreb, Croatia.