Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

this is my first post to this forum. I hope to start participating actively.

I have a table with several records (aprox 200.000), each with its own coordinates. And I need to identify the "Polygon" where each point belongs (I got another table with the vertex for earch polygon) . I am working with Excel and Access at this point. Thanks for the help!

(the polygons doesn’t have holes and doesn’t overlap with other polygon)

I know there is an algorithm that checks if the number of times a line cross another line from the desired point to another point is even, the point is inside polygon, if the number is odd, the point is outside the polygon. But I don’t know how to implement this. Here are some reference links with the algorithm:

http://alienryderflex.com/polygon/

Here is a sample:

I got a table similar to this:

  • Point_ID / Coordinates
  • 1 / -70.559349,-33.411913
  • 2 / -70.579004,-33.407542
  • etc. (aprox. 200.000 points)

And I got the following table defining the boundaries of each polygon:

  • Polygon_ID / Polygon_Sequence / Coordinates
  • 1 / 1 / -70.567331,-33.408803
  • 1 / 2 / -70.584755,-33.414249
  • 1 / 3 / -70.586987,-33.409692
  • 1 / 4 / -70.585527,-33.404175
  • 1 / 5 / -70.571537,-33.398084
  • 1 / 6 / -70.567331,-33.408803
  • 2 / 1 / -70.567245,-33.409047
  • 2 / 2 / -70.564756,-33.416570
  • 2 / 3 / -70.552998,-33.418576
  • 2 / 4 / -70.551796,-33.408474
  • 2 / 5 / -70.560122,-33.407542
  • 2 / 6 / -70.562525,-33.407327
  • 2 / 7 / -70.567245,-33.409047
  • etc...

So, this is the output I need (in bold):

  • Point_ID / Coordinates / Polygon_ID
  • 1 / -70.559349,-33.411913 / 2
  • 2 / -70.579004,-33.407542 / 1
  • etc...

Thanks a lot! Alejandro

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.