Pulling complete data from inside a polygon in merged map file

Hello!

Got stuck on this and would appreciate any ideas.

My question: is there a good way to pull all the data that lies within a polygon from a merged kml/shp map file.

For example:

Say I had a map of a bunch of cities and a map of a bunch of neighborhoods. (Cities are made up of multiple neighborhoods) I’d like to be able to perfom a search/call for a city and return all the constituent neighborhoods in that city. Essentially return all the neighborhood data that lies within a specific city polygon. I know this is doable by searching a certain point or coordinate on the map. How can I search by area/polygon?

Thanks!

This is very much a generic GIS question. The operation is trivial within PostGIS (functions st_within or st_intersects), and equivalent operations are available in other languages (e.g., Shapely package for python). The exact answer depends on exactly which tools you are happy/willing/able to use.