2

I want to be able to extract two sets of coordinates which are the midpoints of two shorter sides of a rectangular polygon (purple points).

I know there is an intersection tool in QGIS which can get me those, however I can't figure out how to automatically generate the midlines which are used in the intersection tool. Is there a way of doing that in QGIS/GRASS? I would like to automate the process as much as possible so manual line creation is not an option. enter image description here

  • 1
    Welcome to GIS SE! A question asking for help with code should include a snippet of the code you've actually tried, and details of what happens when you try it. Please edit your question to include your code snippet and any error message. – Midavalo Dec 17 '17 at 16:24
  • 1
    I think that the question is OK. I do not know if there is a tool for the task in QGIS but I know another open source GIS software that has such tool. First part of the process would probably be to skeletonize the polygon gis.stackexchange.com/questions/171145/…. – user30184 Dec 17 '17 at 21:00
1

If you only want the coordinates of the points you indicated you don't need to generate the lines... you just have to calculate their coordinates using the four vertices of your rectangles.

You take the two shortest segments of your rectangle and then calculate their midpoints.

1

The answer to this question: Dividing a trapezium into quarters with QGIS? solved a problem on how to create a mid point along lines and divide the polygon into quarters. You can apply the same code to divide the polygon into two halves. However, creating mid point will be automatically, but dividing the polygon will be manually.

Following the steps in the above answer, you can create a mild point at each polyline.

enter image description here

Divide the polygon using the mid located at the shortest lines using divide tool:

enter image description here

Turning off the point layer and save the edits:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.