4

I'm trying to create polygons of specific size in square meters that represent the areas surrounded by roads. The roads are stored in PostGIS as points / lines. If required, I can convert the data to other formats for processing in other softwares like ArcGIS etc.

Because of the randomness of the roads, the polygons could differ in size but their size should not be less than the specified size.

See the below picture. For illustration, I have set different colors to the possible polygons of equal size fulfilling minimum size constraint.

Can somebody please mention how can I achieve this? As I am beginner so sample query or code would greatly help. I have basic know how of PostGIS, QGIS and ArcGIS but I am willing to use any other software if it solves my problem.

enter image description here

If the street network looks like below, polygons like given in red needs to be created (only as an example, in fact all the intersections between streets fulfilling the minimum area constraint should produce polygons like these).

Let suppose we want to create polygons of minimum 2 square kilometer area and let suppose that the area made up of 3 white patches shown in blue is of 2 square kilometer then the code should create a polygon consisting these 3 white patches. You can see that polygon 3 is larger than the polygon 1 but fulfilling the minimum size constraint, similarly polygon 2 has four white patches to fulfill the minimum size constraint.

enter image description here

Shuji
  • 141
  • 6
  • It looks like you want to create polygons of the areas enclosed by roads...? I.e. parcels? Is that area you are talking about actually the parcel size? – geozelot Feb 11 '20 at 19:59
  • I want to create polygons of the specific size of the areas enclosed by roads. For example, if the required polygons size is 2km then the code should be able to find the roads which collectively make about 2km polygon. – Shuji Feb 11 '20 at 20:06
  • In short, Yes! I want to create polygons of the areas enclosed by roads! – Shuji Feb 11 '20 at 20:08
  • So...would it be okay to actually create those polygons using the roads as bounds? No size calacularions involved? – geozelot Feb 11 '20 at 20:15
  • I think creating polygons using the roads as bounds without calculations may create some polygons of size less than the required minimum size. – Shuji Feb 11 '20 at 20:18
  • Okay, see if my answer here does what you need: it will polygonize all areas enclosed by roads. I don't get what you intend exactly, but doing a similar thing by size is problematic. You may want to rather union some of the polygonized parcels to match your requirement. You may need to specify your question further. – geozelot Feb 11 '20 at 20:27
  • Here is question in which the op has asked for creating polygons out of ONLY the white areas enclosed by roads, but one can see that some white areas are small and some are large. In our case, let suppose our minimum polygon size requirement was 2km and there were TWO WHITE spaces making up 2km areas then we would make a polygon consisting of those two white spaces enclosed by the roads. https://gis.stackexchange.com/questions/52014/creating-polygons-of-area-surrounded-by-roads-lines-using-postgis – Shuji Feb 11 '20 at 20:27
  • @ThingumaBob updated question and added a picture for clarification. – Shuji Feb 11 '20 at 20:46
  • You need a common attribute to collect and union the required roads (or areas), if you want specific areas as result. Or do you not care for which areas are unioned across your data, as long as they are above a certain size? – geozelot Feb 11 '20 at 20:55
  • Yes, I don't care for which areas are unioned across my data as I want to make polygons out of all data, not a specific region. – Shuji Feb 11 '20 at 21:01
  • @ThingumaBob I updated question for more clarity. – Shuji Feb 11 '20 at 21:24
  • Is it important to maximize the coverage of the output layer? – OGmaps Feb 11 '20 at 22:00
  • @OGmaps you can think of it like so. – Shuji Feb 11 '20 at 22:03
  • 1
    It's polygon grouping task, see this https://gis.stackexchange.com/questions/123289/grouping-village-points-based-on-distance-and-population-size-using-arcgis-deskt/123297#123297 – FelixIP Feb 12 '20 at 04:43
  • @FelixIP It would be a lot helpful if you please post Answer containing a sample code. – Shuji Feb 12 '20 at 04:59

1 Answers1

1

Tested approach mentioned.Results:

enter image description here

enter image description here

Script posted here should do the job.

FelixIP
  • 22,922
  • 3
  • 29
  • 61