0

I have some points in a shapefile and I want to create an offset area around them. In particular, what I am doing is the following:

import shapefile
sf = shapefile.Reader(path+'Data/One_Road_Segment/one_segment_road')
shapes = sf.shapes()
x = list()
y = list()
for i in range(0,len(shapes)):
    for j in range(0,len(shapes[i].points)):
        X = shapes[i].points[j][0]
        Y = shapes[i].points[j][1]
        x.append(X)
        y.append(Y)
plt.scatter(x,y)

In this way I have the following map.

enter image description here

What I want to do is to create an area around the points in order to check in the future if other points are in that area. I would like to have something like the following:

enter image description here

emax
  • 6,965
  • 19
  • 74
  • 141
  • Are you sure that what you need is an area ? Can't you "simply" find the nearest old point from your new point and tell if it's "in the area" according to a threshold ? – Julien Palard Oct 28 '15 at 23:10
  • But if you really want the area, why not drawing a square around each point, then merging them using an algorithm like given here http://stackoverflow.com/questions/13746284/merging-multiple-adjacent-rectangles-into-one-polygon ? A last passe to remove some points to simplify the shape probably yields something... ? – Julien Palard Oct 28 '15 at 23:19
  • @Julien: probably the nearest one could be a solution. I will try to in that way and I will post the solution as soon as I can. – emax Oct 28 '15 at 23:54

0 Answers0