2

This question already has an answer here:

I have a map with location of schools within districts. I was wondering if I can extract all fields of each data point within a polygon and how to go about doing it in ArcMap 10.5?

I produced this map by overlaying a district boundary map (shapefile) and a csv file of school attributes including XY coordinates of the schools. The file includes more than 60 fields for each school, including the XY coordinates.

What I want is a list of schools per district, including the 60 fields. For instance - schools_within_district_A.csv and schools_within_districtB.csv, and so on. If there are 20 schools within one district (one polygon), I would like to obtain the fields for the district. So basically this is equivalent to subsetting the overlayed data by one district.

I tried looking into spatial join, but this seems to find the sum of attributes per polygon. What I want is not the sum but all of the individual fields for each school for a selected district.

enter image description here

For each data point, I have more than 60 fields, including categorical and dummy variables: enter image description here

My boundary shapefile looks like this, where name is district name: enter image description here

And my desired excel output would look like this, for a selected district, assuming that the district has 7 schools within: enter image description here

marked as duplicate by PolyGeo Jun 8 '17 at 4:47

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    Take a look at Spatial Join GP tool. – Alex Tereshenkov May 28 '17 at 7:49
  • 1
    If not Spatial Join then perhaps try Intersect. However, for this to be answerable I think you need to clarify what you mean by "extracting each attributes of the schools within a polygon". You could do this by showing a few fields of a few features from your two input datasets and what you want them to look like on output. – PolyGeo May 28 '17 at 7:57
  • @PolyGeo Hi, I made some edits. – song0089 May 28 '17 at 9:17
  • 1
    Please post how you want to represent the output data. How the output would look like? – Alex Tereshenkov May 28 '17 at 10:07
  • 1
    Can you please clarify, do you want the polygon layer to have an attribute with the number of schools? Or do you want the schools to have an attribute with the district that they're in? Or do you want all the district attributes applied to all the schools? – Fezter May 29 '17 at 5:37
0

To get "the district attributes applied to all the schools, so that [you] can know where the schools are located " all you need to do is to perform an Intersect which:

Computes a geometric intersection of the input features. Features or portions of features which overlap in all layers and/or feature classes will be written to the output feature class.

This is a point-in-polygon overlay and the way that I think it is that it allows all points of the first input feature class to inherit attributes of the polygons input as the second feature class.

For the join_attributes I would use:

ALL —All the attributes from the input features will be transferred to the output feature class. This is the default.

Not the answer you're looking for? Browse other questions tagged or ask your own question.