Strategies in finding a rectilinear polygon within a polygon in GIS

What is a Rectilinear polygon?

Use case for a Rectilinear polygon

Rules for the algorithm

Greedy Algorithm


Moving along the top line until it forms a right-angle
Moving along the left joint line can also make it right-angle
Form a right angle using dependent, dependee and the angle to make dependent a rectilinear angle (90°/270°). Extend the line until it touches the next polygon line.
In cases it does not touch the next polygon line, move the point to the right angle triangle instead.


Looks correct.
Looks legit.
Seems correct
Looks correct
Not the largest rectilinear possible. There is gap on the right that can be extended.
This looks almost like a rectilinear but 1 corner does not meet criteria.
This is incorrect. 3 points were skipped to obtain this.


A passionate software engineer with strong background in web technology, product development and design architecture.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store