oemof / DHNx

District heating system optimisation and simulation models
MIT License
30 stars 12 forks source link

Method 'midpoint' produces too long connection lines #109

Closed jnettels closed 1 year ago

jnettels commented 1 year ago

If large buildings stand close to the street, the default method of running the building connection lines from the street to the centroid of the building polygon can lead to much too long connection lines.

In the attached PR (commit c1870cb7894def12b901483b943a02b1ea108b5d), I propose a new method='boundary' for the functions process_geometry() and create_points_from_polygons(). In one case of mine the house connections lines are now only 60% of the previous total length.

The 'midpoint' method (using the centroid) must already have been run, generating the default connection lines from street to centroid. Then the following rules apply:

All of these conditions appear in the attached plots. For reference, they also show the convex hull.

The placement of the code within process_geometry() may not be the most elegant, because it depends on the midpoint method and create_object_connections() having already run. But I guess it is efficient.

Figure 2022-12-13 152818 Figure 2022-12-13 152829 Figure 2022-12-13 152841

joroeder commented 1 year ago

Great issue! That is a nice feature! Exactly therefore, I created the attribute "method" ...