# Create transect lines of specific length through points

I've got a series of 30 random points in ArcGIS 10.3.1. I'm hoping to generate 200 meter lines of a specific orientation (i.e. north-south) through each point so that I can sample continuous raster values along each line. Ideally, the point itself would be the center of the line. I'd also be interested in generating perpendicular lines with the point as the intersection.

Is there a simple way to generate straight polylines of a specific distance in ArcGIS?

I'm hoping to repeat this analysis many times, and so I'd love to avoid creating and editing each line manually.

I've searched all over this site and can't find an answer to this specific problem.

• With python, it's pretty simple to read the geometry of the points and create new points (say 100m north and south) that become polyline vertices. – Paul Jul 15 '16 at 19:01

Yes mentioned by @Paul it is rather easy to accomplish with python. However creating cursors, describing output feature class etc is very boring process. Let's try to limit it to pure geometry, which is fun.

The only challenge here is to create 2 polylines around the point, so that point's coordinates can be found efficiently:

`arcpy.MultipleRingBuffer_analysis("points","C:/FELIX_DATA/SCRARCH/PGONS.shp","10;50","Default","distance","NONE","FULL")` `arcpy.FeatureToLine_management("PGONS","C:/FELIX_DATA/SCRARCH/lines.shp","#","ATTRIBUTES")`

After that I ran following expression (Python) on field "Shape" of layer "lines":

``````def getCross(shp,d):
part=shp.getPart(0); pgon=arcpy.Polygon(part)
pc=pgon.centroid;xc=pc.X;yc=pc.Y
dX=[100,0][d==10]
dY=[0,100][d==10]
p1=arcpy.Point(xc+dX,yc+dY)
p2=arcpy.Point(xc-dX,yc-dY)
arr=arcpy.Array(p1,p2);pline=arcpy.Polyline(arr)
return pline
``````

# -------------------------------

``````getCross( !Shape! , !distance!)
``````

RESULT:

Note: I used 10 and 50 metres buffer, so use 10 and any other, unless you'd like to rewrite entire expression

You should always search arcscripts website (now called code sharing) before you ask such questions as there are many tools created by the user community. For example if you search using the word "bearing" you will come across a tool that does exact what you want and is free to download... Which by the way I created. :)