# Create a polygon using GDAL to calculate the points

I wish to create a polygon that looks like this (it's a tree and a root scan): I have a file containing positions where readings have been taken, and I have the centre point and the projection. So, for example, reading 1 is 35cm north of the centre, reading R2 is 135cm north of the centre.

This point has a centre Latitude: 57.802384, Longitude: 12.03286745 in EPSG:4326

How do I add this increase to e.g. the latitude? I'm using Python GDAL, I'm sure there'a a function I can use.

The code I've tried is:

``````nodeX = float(latitude) + (float(data[1])/100) + ((float(data[6])/100) / 2) + (float(data[7]) / 100)
``````

but the result is way too big an increase.

• Of course it doesn't scale right -- You"re adding centimeters to degrees. May 28 '17 at 14:13

Found this post: algorithm-for-offsetting-a-latitude-longitude-by-some-amount-of-meters, and reworked my example, which now reads like this:

``````# factor = 111,111 meters (+ 00 to get centimetres)
factor = 11111100
ring = ogr.Geometry(ogr.wkbLinearRing)
# Loop through data
offsetX = float(data[1]) / factor
offsetY = float(data[2]) / factor
nodeX = float(latitude) + offsetY
nodeY = float(longitude) + offsetX