3

I create a polygon where each x/y point is WGS84 format lat/long values.

The polygons are good approximations to circles and sectors of radius R (each circumference/arc point is a projected lat/long value of distance R from a centre/apex coordinate - which I have verified is correct by computing the Haversine distance between the edge and reference points and getting a value of R back) .

I use GEOSSetSRID(4326) to indicate the coords are WGS84 format. GEOSGetSRID() confirms the SRID is set.

Use of GEOSArea then gives a value not even remotely close to the expected value.

I do not see what else I can programmatically do.

If I set the points in cartesian format, and then set the SRID to 4326, will GEOS implicitly convert the polygon points to WGS84 ??

Is the basic GEOS C API incapable of doing the above ?? Dos SRID have no meaning to the API at all ??

Any info/pointers to correct usage/solutions would be much appreciated.

TIA.

q q
  • 31
  • 2

1 Answers1

0

The distance that is given is something like degrees between the two points. In actuality, the GEOS API (at least the C++ interface) is units agnostic; the units it gives the distance in is based on whatever you passed in.

In general, multiplying the result you get by 111000 gives you a fairly accurate measurement in meters. For area, you have to do 111000^2.

saiarcot895
  • 554
  • 5
  • 16