Jump to content

Offset points vertical to a linear feature class


Recommended Posts

In the last few months I am experimenting with ArcGIS in order to create a synthesis of tools in model builder for my postgraduate thesis. The problem I am facing for a long time now is the following:

 

I have one (or more it doesn't matter) linear objects (that represent faults) and with the help of "create routes" and "make route event layer" tools I place points on it (representing epicenters of an earthquake). I want to achieve a relocation (or offsetting) of all these points vertically to the trend-line of the linear feature I create with the "smooth line" tool. The only thing I have managed till now is a relocation by changing a small script I found in a site (gis stackexchange).

 

def Shift_XY_Coordinates(shape, x, y):

   value = distance

   point = shape.getPart(0)

   point.X = x + value

   point.Y = y + value

   return point

 

with the expression

 

Shift_XY_Coordinates(!shape!, !POINT_X!, !POINT_Y!)

 

I want to offset the points by 10 km. How am I supposed to add the correct distance every time when the angle of the linear feature class may be different every time? At the example I am using the trend line has an angle of 45 degrees and when I tried 

 

def Shift_XY_Coordinates(shape, x, y):
 value = 10000
 point = shape.getPart(0)
 point.X = math.sin(45)*value + x
 point.Y = math.cos(45)*value + y
 return point
 
it worked but only for this specific angle. Is there a way to relate the angle of the trendline with the angle that the user will input every time at the script? Or is there a probably easier way to achieve this relocation? Thank you very much and I appreciate any help. I also attach a picture of my problem. 
FEi96.jpg
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.

Disable-Adblock.png

 

If you enjoy our contents, support us by Disable ads Blocker or add GIS-area to your ads blocker whitelist