문제 설명
위도/경도 포인트가 다각형 내에 있는지 어떻게 확인합니까? (How do I determine if a lat/long point is within a polygon?)
내 주를 구성하는 모든 카운티의 셰이프 파일이 있습니다. (지구 다각형에 대한 기하학적 정보를 포함하는) shapefile을 사용하여 Geopandas를 사용하여 도형에 도형을 그릴 수 있었습니다. 위도 및 경도 좌표로 지오코딩한 주소가 있으며 좌표가 속한 카운티(또는 다각형)를 결정할 수 있기를 원합니다. geopandas에 in
기능이 있는 것을 보았지만 사용법을 잘 모르겠습니다.
최종 목표는 사용자가 입력하고 주소를 지정하고 프로그램을 카운티 이름을 반환합니다. 카운티는 수십 개에 불과하므로 for 루프를 사용하여 행을 반복하고 각 다각형을 확인하여 제공된 좌표가 내부에 있는지 확인하려고 생각했습니다.
참조 솔루션
(by arctic_radar)