I want to check whether an address (long, lat) exists inside or outside of a polygon. I have an address with latitude and longitude values. Address(,long =16269479, lat =58606014) and polygon(lat, long) with its vertices POLYGON((16270489, 58824802) (16271613, 58822105) (16287958,58802519) (16297720 58795480) (16306633 58792276) (16309717 58790244) (16307960 58785942) (16296537 58775348) (16303836 58769601) (16305650 58769594) I have to check whether the address lies inside or outside of a polygon. I have come across many examples but could not find any accurate plus authentic code example. By doing some research I have found that know [ray-casting] https://en.wikipedia.org/wiki/Point_in_polygon#Ray_casting_algorithm algorithm can be used to determine whether an address (lat, long) exists inside or outside of a polygon. But could not find any C# code example that implements it correctly. Can somebody help?
In C# you can use the NetTopologySuite.Geometries namespace to get the Coordinate value of the Address and check if that coordinate is in the Polygon.