-1

I have a list of polygons and a single point with its latitude and longitude. I want to find a polygon which the single point lies on.

Currently, I'm iterating over the whole list to find the answer, which seems a bit inefficient. Is there a better way to make it?

santony
  • 54
  • 5
  • Welcome to Stack Overflow. Please take the [tour] to learn how Stack Overflow works and read [ask] on how to improve the quality of your question. Then check the [help/on-topic] to see which questions are on-topic on this site. Please see: [Why is “Is it possible to…” a poorly worded question?](https://softwareengineering.meta.stackexchange.com/q/7273) (don't just change your question to "How"). Please show your attempts you have tried and the problems/error messages you get from your attempts. – Progman Dec 29 '21 at 01:27

1 Answers1

0

Not unless you have some prior information about this list. If you are given a list with no prior knowledge of its elements, you must check every item in the list to see if it meets the condition.