0

I am working on a project linking ideas in Geology and Ecology.

I currently have a map showing the geology of an area (polygon layer), with a points layer on top indicating the locations of data collection.

I have added an empty column to the attributes table for the points layer (geology_where_captured) and would like to know if there's a way - using arcpy - to fill in this column with the name or id of the geology that each data point is sitting within?

I have looked into the SummarizeWithin function but when I try to use this (I am using ArcMap 10.7.1 on my home computer) I get an error saying the object has no attribute?

I'm pretty new to Python.

I wrote this small bit of code following advice from https://pro.arcgis.com/en/pro-app/tool-reference/geoanalytics-desktop/summarize-within.htm

and

https://pro.arcgis.com/en/pro-app/tool-reference/analysis/summarize-within.htm

import arcpy
arcpy.env.workspace = 'C:\Users\User\Documents\University4円th Year Project\Data\mydata_arcgisOnline/XYLEMUR_DATA_AMBATOVY2.dbf'
summarizedLayer = "XYLEMUR_DATA_AMBATOVY2"
summaryPolys = "Geology"
arcpy.SummarizeWithin_analysis(summarizedLayer, summaryPolys, 'geology_where_captured')

Runtime error Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute 'SummarizeWithin_analysis'

No joy! (I'm new to this)

Kadir Şahbaz
78.6k57 gold badges260 silver badges407 bronze badges
asked Dec 3, 2020 at 0:08
0

1 Answer 1

1

I think this classic point-in-polygon overlay operation is best handled using the Intersect_analysis tool wich:

Computes a geometric intersection of the input features.

If you input a feature class or shapefile of points, and another with polygons, then the output is any points falling within a polygon have the ID (and optionally attributes) of that polygon added to then end of its attribute table.

If you are using ArcMap rather than ArcGIS Pro then the answer is basically the same - see Merging Attributes of points into polygon using ArcMap?

answered Dec 3, 2020 at 0:32

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.