1

I have a lot of polygons (~40k), each of which represent a different city block. I also have a lot of latitude/longitude coordinate points (~700k). Each polygon is labelled and has a unique name.

Is there a way that I can go through each individual point and see what polygon that point is in? I would not like the result for each point to be a 'true' or 'false', rather I would like to create a new column in the dataframe that contains all the points that would tell what polygon that given point is in.

This is what my polygons looks like. Reminder, each polygon represents a city block.

    bctcb2010   boro_code   boro_name   cb2010  ct2010  shape_area  shape_leng  geometry_object geometry_layer  geometry_proj4
    0   50009001000 5   Staten Island   1000    000900  2.445896e+05    2508.948115 POLYGON ((-74.07920577013245 40.64343078374567...   geo_export_7753596b-be5c-4ff9-a64c-ddfbaf0c5d08 +proj=longlat +ellps=WGS84 +no_defs
    1   50020011000 5   Staten Island   1000    002001  1.110063e+05    1345.886422 POLYGON ((-74.07061992438017 40.61085506705416...   geo_export_7753596b-be5c-4ff9-a64c-ddfbaf0c5d08 +proj=longlat +ellps=WGS84 +no_defs
    2   50027001000 5   Staten Island   1000    002700  1.504068e+05    1703.381172 POLYGON ((-74.07524403910642 40.62600632452712...   geo_export_7753596b-be5c-4ff9-a64c-ddfbaf0c5d08 +proj=longlat +ellps=WGS84 +no_defs
    .
    .
    .

And this is what my points look like:

latitude    longitude   
40.691991   -73.821149
40.691615   -73.820965
40.691536   -73.820927
40.692100   -73.828326
40.691667   -73.829862  
40.692130   -73.828220
.
.
.

I want to know what city block each point falls in.

Thank-you in advance!

Naiem
  • 71
  • 1
  • 5

0 Answers0