Giter Site home page Giter Site logo

blosm's People

Contributors

gtoonstra avatar janosrusiczki avatar polarkernel avatar vvoovv avatar zkir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

blosm's Issues

Getting overlay imagery for matplotlib

Progress report. I decoupled downloading and stitching image tiles from Blender. OSM objects can be drawn now over the stitched image.

However something is wrong with the order of rows or columns. It seems to be different with the one in Blender. I have to investigate that.

image

[streets] Streets and intersections, first experiments

In order to create realistic streets and intersections, many of their features have to be invented by the software, as they are not provided by the OSM data. In the following posts, first problems and findings, experienced with experimental code, are discussed.

Streets generation

  • Process the centerlines of the streets, roads and paths from OSM, eventually other OSM objects (e.g. buildings)

  • Generate street geometry and project it on the terrain.

  • Place street objects (streetlights, road signs, bus stops, entrances to subway, etc) in accordance with the street PML style and orient them accordingly.

A terrain may require some automatized editing.

[GN] General principles of operation of the addon and Geometry Nodes

The issues was originally intended to discuss issues related to generation of flat roofs.
However the issue has been used to discuss the general principles of operation of the addon and Geometry Nodes. See also some discussions at #37


Original message

Flat roofs can have crazy shapes (see the images below). We have implemented a library to fit rectangles even to very complex roof shapes. I hope it will be much easier to instance roof objects (air vents, antennas, etc) on rectangles.

Strasse der Pariser Kommune

The selected street sections look strange as the ones crossing at an intersection. Would it be more appropriate here to have a long area that connects the two way-clusters (at the bottom and at the top) with different widths?

image

Water facade

An additional facade type may be needed: a water facade. It directly faces a river, a lake, a sea.

image

Introduced IDs for classes BldgEdge and WaySegment

For debugging it is sometimes difficult to identify a special edge or way segment. In recent projects I introduced an ID, which is incremented for every constructor of an object. I did the same now for the classes BldgEdge and WaySegment. The id can easily accessed and used for instance in a breakpoint as egde.id==573 to identify the desired edge (similar for way-segment). The IDs of all edges can be visualized using the command-line argument --showIDs for both, visibility and classification plots. See an example here:

Visualization of way-segments is not yet implemented, as I didn't know exactly how to transfer the flag into the super class. Maybe a task for the expert? I propose to leave these IDs until we are ready for release. Then we may remove them.

This feature is commited.

Curvy facades

Classification of curvy facades produces odd results:

(bern_old_town.osm, Kirche St. Peter und Paul):
image

Conditions for a carriageway without a sidewalk

This issue is used to discuss on how to detect that a street section does not have a sidewalk on the left or on the right.

(1)
All street segments that constitute a roundabout should not have a sidewalk on the side pointing to the internal part of the roundabout.

(2)
A pair of street sections that originate or end at the neighbor connectors of an intersection. The angle between the way-segments that originate or end at the intersection should not exceed a given threshold.
image

Data structure for generated streets

Consider the data structure for a road created by offsetting its centerline.

image

The resulting polygons are shown on the image above. The polygon with sharp corners is on the left and the one with rounded corners is on the right.

(1)
A list with coordinates for the resulting polygon is needed. The order of the coordinates: [1R, 2R, 3R, 4R, 4L, 3L, 2L, 1L].
Additional information is needed for the case of the rounded corners. If the number of additional vertices is the same for each vertex of the original centerline, then it's enough to store that number of additional vertices for each corner.

Error for the dataset husum_altstadt.osm

File "blender-osm\action\facade_visibility.py", line 168, in calculateFacadeVisibility
x2 = intersections[i+1][1] * segmentLength/2.
IndexError: list index out of range

[streets] Multipolygonal objects

Forests and other objects may be mapped as relations in OSM.

A relation can be used to map any combination of

  • simple polygons
  • polygons with one or more holes

The problem is that a hole (or an inner ring) is not explicitly assigned to any outer ring. The inner ring is only marked as such.

[streets] Sparsely populated areas

Sparsely populated areas (rural areas) require a special processing.

In your example on Piirissaar, there are almost no more graph cycles (only the red lines in the image below). In all our data sets, the density of roads was so large that the idea of graph cycles worked well. For such sparsely populated areas however, we will have to come up with something else, I assume.

Another problem is the large graph-cycle painted in red like in the image below. The circumscribed circle around this cycle is very large and includes most of the polyline objects in the scene. Their subtraction therefore takes a lot of processing time in PyGeos. The result is a large polygon with a large number of holes, which again takes a large execution time for the decomposition.

Examples of street polygons for graph-cycles

I'd like to consider different graph-cycles and describe how the polygons can be generated for them. That's needed to derive a general algorithm. After the polygons are generated for each graph-cycles, they can by joined. The widths of the resulting roads can be unified.


Example 1

image

The graph-cycle contains a grass polygon. We need to triangulate the sequence of edges:

image

Now join the triangles for each way-section. The triangles that are to be joined must have a common edge with a way-section:

image

The blue triangles weren't joined since they didn't have a common edge with a way-segment. However each blue triangle has a common vertex with two adjacent way-segments. We can find the projection of the triangle on those way-segments. The triangle can be attached to the way-segment with a larger triangle projection. That leads to:

image

Finally, the shape of the pedestrian crossings (green) should be corrected:

image

image

Mark dead-ended street-sections or cluster

I am currently experimenting with creating terrain patches between streets:
image

I need to know that one or both ends of a street-section or a cluster is dead-ended.

I suggest adding the following properties to the classes TrimmedWaySection and WayCluster:

  • startConnected (True or False)
  • endConnected (True or False)

[streets] Detection of large polyline objects

Object polygons may be larger than the graph-cycle they have to be subtracted from and then fail to be detected. The image below shows such a situation

The detection works as follows: The blue line is the graph-cycle polygon and the red dots are the vertices of the object polygon (green area). The vertices of the object polygon are inserted into a KD-tree and also in a dictionary, that matches the vertices to the polygon. The blue area is a circle, circumscribed to the graph-cycle polygon. All vertices of the object polygon within this circle are detected, their object identified by the dictionary and then this object is subtracted from the graph-cycle. But when the object polygon is too large, as in the depicted example, it is not detected and therefore not subtracted.

We have to find a method to make sure that all object polygons that intersect or cover the graph-cycle are detected.

[streets] Relations between way-sections and triangles

In the current version of road_polygons.py there exists a mixture of different approaches, where and how way-sections are stored. These are the result of the development history and certainly need to be refactored, so that finally the triangles can be related to these sections. Within this issue I will try to explain the current state in detail. Based on this knowledge the discussion can be opened about how finally the triangles and the way-sections have to be related to get the desired result for the rendering of the streets. Since we do not yet know how this final result will be derived from the triangles, this topic may possibly also be a starting point for ideas on this topic.

[doc][streets] From Way-Sections to Triangles

This will become a rough description of the process pipeline from way-sections to triangles, including the most important data model charts. I will edit this post several times until the pipeline description is complete. Please do not yet post here until I have finished this text.

Edits:
24.03.2022: the link to definitions

Border of the area of interest

To create terrain patches between streets it is required to add a border of the area of interest.

This issue is intended to discuss the above matter.

A proposal to treat dead ends located within a graph-cycle

image

I propose to exclude the the dead-end ways from the initial processing of graph-cycles.

Once the subdivision for a graph-cycle containing a dead-end way is ready, the generated triangles are further split by the dead-end way. If the dead-end is located within a triangle, it's simply stored with that triangle.

Facade visibility

This issue is to discuss integration of the code that calculates facade visibility.

The code should be integrated into the dev branch.

Fitting rectangles to a building footprint

Flat roofs contain air-vents, entrances to the roof, chimneys and other stuff. The problem is how to position them on the flat roof. It's easy to position the roof element within a rectangle. For example, predefined arrangement of the roof elements can be used for each group of the rectangle sizes.

The problem can be reformulated in the following way: how to fit a number of rectangles with the given minimum dimension to a building footprint which can contain one or more holes.

It's easy to fit a rectangle to a quadrangle:

image

Narrow and curvy facades, churches and cathedrals

I suggest to skip single narrow facades from the visibility and classification calculations.

A single narrow facades is the one surrounded by wide facades. It has a width below some threshold.

If narrow facades are introduced, the method for assigning the side facades must be changed.

Suppose we have a sequence: Front_Facade, Narrow_Facade, Unclassified_Facade.

Unclassified_Facade should be classified as the side one.

[streets] From Way-Sections to Triangles, Discussion

The discussion in this issue is related to the documentation From Way-Sections to Triangles in issue #39. Starting from way-sections, neighboring or otherwise relevant triangles have to be found to collect the required shapes for a realistic street rendering by the addon. In this issue, I like to discuss the problems that may arise in this process and their possible solutions.

Non-deterministic association between way-segment and facade

There is another non-deterministic effect observed in visibility computation. The association between an edge and the winning way-segment is different after different runs of the program (see for instance for the edge at the blue arrow):

manhattan_01.osm

[GN] General principles of operation of the addon and Geometry Nodes

I've just started to learn Geometry Nodes. So my knowledge about them is limited at the moment.

Here is my current understanding. The task is to instance different Blender objects representing facade and roof parts on generated vertices. So each vertex corresponds to a specific instance of a Blender object. The instance must be rotated and scaled accordingly.

image

But where to get the values for the rotation and scale of the instance in question?

Also there is a need to somehow indicated which Blender object should be instanced at the given vertex.

I suggest to pass that information as attributes of vertices:

  • rotation_z
  • scale_x
  • scale_y
  • scale_z
  • instance_index (interger) or instance class (string)

I haven't tested yet if this approach would work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.