I am working on an existing project that has polygons for boundaries on a map, but the source ZIP codes that were used to create the boundary are missing. I have a ZIP code layer in the project. Is there a way, besides zooming in on the map and labeling and writing down every ZIP code in the boundary, perhaps a function, that will allow me to list all of the intersecting ZIP codes? Thanks for any ideas you might have!
What do you want the output to look like? Just a list of ZIPs?
This is easy enough to do with Arcade in Field Calculator.
var zips = FeatureSetByName($datastore, "ZIP_codes")
var xs_zips = Intersects($feature, zips)
var codes = []
for (var z in xs_zips) {
Push(codes, z['zip_code'])
}
return Concatenate(codes, ', ')
Thanks so much Josh! I used to code, and I've learned just enough Arcade to create custom labels, but I haven't had the need thus far to learn the syntax for functions although I can see what you're doing code-wise. Since there aren't ZIP codes in the polygon layer, I'm trying to figure out how to reference the ZIP codes in your example. (You were right, by the way, just looking for a set of ZIPs and the city name although I could write a query with the ZIP output to easily get the names after the fact.)
If you have the chance to clarify, that's great, but in any case, many thanks!