POST
|
I have a point file with observation data, and a line file with segmented transect lines. I'm trying to come up with a count of observations on each line segment. The attached map shows that some line segments have more than one observation, while others have no observations (lines_points_map.JPG). Using the Spatial Join Tool from the Analysis/Overlay Toolbox, I specified the line layer as my target input, observation point layer as the join input and choose a "one to one" join operation with a match option of "closest". Because the default count field kept returning a value of 1 for every record, I added a Value field to my observation point layer and assigned a value of 1 to each record in the observation layer. I tried running the Spatial Join tool again, this time using the field map to add a new field called ObsCount and specified a merge rule to sum the Value field from the observation layer (spatialjoindialogue.JPG). So each line segment should have a count of all observations in the ObsCount field. Or so I thought. Each record had a value of 1 (spatialjoinoutput.JPG). When I use the joins & relate option available by right clicking on my line segment layer in the table of contents (toc_join.JPG) and select the "Join data from another layer based on spatial location" option, specifying my observation layer as the join layer and selecting "closest" as the join option (toc_joindialogue.JPG), my output file gives me the expected results in the Count field (toc_joinoutput.JPG). I'm trying to add the spatial join into a larger geoprocessing flow, so ideally I'd like to be able to achieve this using a python script. Since I can't get the proper results using the Spatial Join analysis tool manually, I don't think using arcpy.SpatialJoin_analysis in a script would work. I haven't been able to find python code for the spatial join achieved through the table of contents joins & relates menu. I'm a python novice, so I'm sure there's a way to do it....I'm just kind of stumped right now. If anyone has any suggestions, I would really love to hear them. Thanks
... View more
01-19-2017
11:40 AM
|
0
|
2
|
5186
|
POST
|
I’m fairly inexperienced with python, but have been attempting to use it to automate a geoprocessing workflow. I’ve pieced together most of it, but I’m stuck with one section… I have a shapefile with transect lines, and attribute fields TransNa (transect name) and surveydate (date of survey). I want to split each transect line into segments based on a user specified distance. The output file would have a number of segments representing each transect line. I also want to add a few fields to the output file. Interval – sequential record number for each segment of a transect line. First segment of each transect line would be 1. Segment – Sort records by surveydate, TransNa and Interval fields, then add a sequential record number for all records. Mid_x – x coordinate for segment midpoint Mid_y – y coordinate for segment midpoint Any guidance on how to achieve this would be much appreciated! Thanks
... View more
11-20-2016
09:45 AM
|
0
|
3
|
2375
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|