Thursday 21 December 2017

polygon - Shapefile from heading and distance directions for property boundary


I have a survey with heading and direction points describing the boundary for a rural property in Brazil. I am in correspondence with someone there who needs a shapefile (I believe he mentioned kml or kmz format file as well) of this boundary.


The format of the information is as follows:


Heading                 Distance            Alignment

NW 79º 41' 27" 170.08 meters 1-2
NW 58º 27' 42" 119.83 meters 2-3
...


The alignments I assume references points on some old maps I have of the property, beginning with a starting point described by some known area which has been marked in some way. Neither this map nor the survey has any lat/lon coordinates.


I know Python but do not have experience with GIS.


What terms can I search for, or what documentation would help me understand how to create the polygon he needs from the kind of information I have?


Is shapely or QGIS the tool I should familiarize myself with?


Is there a process for converting the kind of information into a polygon and what is the name of this process so I can familiarize myself with it?




There seems to be no way I could think of to ascertain the starting point considering it is described by surrounding landmarks but perhaps there is a way to create the general polygon and have a third party figure out how to orient it so to accurately overlay it on a map. The only other way is to contact the person living on the property and have them somehow use their smartphone to record the lat/lon of the starting point (maybe have them take a picture to send to me and I extract the coords from the exif data?).


Would this be helpful?





I attempted to create a polygon by accumulating points as suggested by @Spacedman (after converting the the bearing of deviation from N/S to degrees the python function I used for conversion are below) and the shape did not resemble the map boundary at all. As suggested by @MartinF perhaps I could invert some of the coords to try and see if I can make the shape more consistent with the map, but then I found a more recent map(2005).


Except now in this new map there seems to be some distances mixed in under the bearings column, I can't really make heads or tails of it.


(section)  (heading)       (distance)
Trecho Rumo Distancia (m)
1-2 R=1600.94m D=138.36
2-3 56º02'14" SW 635.47
3-4 R=2900.00m D=298.80
4-5 50º08'02" SW 187.45
5-6 R=10.00m D=13.67
.....

17-18 38º28'17" NE 415.16
18-19 38º52'52" NE 305.91
19-20 40º11'22" NE 182.30
20-21 34º37'52" NW 122.53
...

At least I now know it is SAD-69 format and it contains zone and hemisphere info (although hemisphere is obvious) along with other UTM info.


enter image description here


enter image description here


Python functions to transform bearings to degrees:



def dms2dd(degrees, minutes, seconds):
dd = degrees + (minutes/60) + (seconds/(60*60))
return dd


def degree_from_bearing(bearing):
# first transform from `NW 50º22'12"` to individual elements
ns, we, deg, mins, secs = parse_dms(bearing)
degree = dms2dd(deg, mins, secs)
if ns == 'N':

start = 0
if we == 'W':
start = 360
degree *= -1
elif ns == 'S':
start = 180
if we == 'E':
degree *= -1
else:
raise ValueError(f'Heading must be North (N) or South (S), got "{ns}" instead.')

result = start + degree
assert result >= 0, f'Resulting degree is negative ({result}).'
return result


def transform_data(data):
# implementation of @Spacedman's algorithm
x = y = 0
coords = [(x, y)]
for (heading, distance) in data:

delta_x = distance * Decimal(math.cos(heading))
delta_y = distance * Decimal(math.sin(heading))
x += delta_x
y += delta_y
coords.append((x, y))
return coords


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...