Monday, 13 January 2020

arcgis desktop - Creating arrows based on GPS velocities to show displacement


I am having trouble creating symbology in ArcGIS that can show velocity arrows of GPS stations. I have a point file with location information, velocity and direction of each GPS station. I want to create a map similar to the image I have attached. The size of the arrows stay the same but the length changes based on the velocity. See below.



enter image description here


My first instinct was to use graduated symbols however that just scales the arrows and does not stretch them.



Answer



I think your best bet is presenting data by lines.



  • Create any size buffer around points

  • Convert them to lines


Apply following field calculator expression (Python) on Shape field:


def plineM (B,V,SCALE,shp):

b=float(B);v=float(V)
part=shp.getPart(0)
buf=arcpy.Polygon(part)
pC=buf.centroid
X=pC.X+v*SCALE*math.cos(b/180*3.141593)
Y=pC.Y+v*SCALE*math.sin(b/180*3.141593)
newP=arcpy.Point(X,Y)
pLine=arcpy.Polyline(arcpy.Array([pC,newP]))
return pLine



plineM( !BEARING!, !Velocity!,0.5, !Shape! )

Making sure your bearings expressed in degrees, counter clockwise from East


INPUT POINTS TABLE:


enter image description here


OUTPUT:


enter image description here


You might want to play with scale factor. Note it is tested on shapefile, if it is not the case start editing session on lines before running expression.


UPDATE: January 2020



A couple of people reported ERROR 000539 when using suggested expression. Vey likely reason is large buffer around original point, resulting in buffer overlaps. If you are using build-in ArcGIS tool to convert buffers to lines it might result in lines made of 2 vertices:


enter image description here


Possible workaround is making smaller buffers.


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...