I have a shapefile that shows single steps as individuals shapes and im trying to figure out the total count of adjacent steps. The little model I came up for now includes using the v.dissolve function from the GRASS-library to dissolve all shapefiles that are adjacent and then with join attributes by location to get the count of all shapefiles that touch, intersect or are inside the dissolved polygon. For most of the shapefiles this works fine, but as so often, it doesnt work fine on some others for different reasons.

Working fine: correct Not working fine: problem

1: There may be some digitalization error in the first problematic example. The amount of steps I really want is 51 but Im getting 78, because the cross bar and the little rectangular shape inside the steps divides single steps into several steps which are then counted separately.

2: In the second example two stairs seem to be next to each other resulting in 49 individual stairs. But actually I would like to have 2 results, a step count for each stair. The left stair should have 27 steps and the right stair has only 22 steps.

3: The third example results in 66 steps. Maybe some steps are missing at the inside and actually there would only be 3 stairs next to each other but for now I would like to get 4 individual results.

4: In example 4 the wrong step count is 43. Two shapefiles are inside the stair on the left, dividing single steps further and are counted twice then. The correct step count for left stair would be 25.

So i have to adapt the model to take those exeptions into account but im not quite sure how to achieve this in the best way. I thought about building centroids of all single steps, joining only close points together as a path or by buffered area and then counting the steps that intersect with this path or that buffered area. This would maybe solve problems 2 & 3 but could be problematic with 1 & 4.

Another idea was to restrict single steps to have a minimum size but this would not affect problem 2 & 3.

And of course there would be the possibility to combine the above mentioned methods to solve all problems. But before starting to implement that method and see if it really works and what new problems might arise, I wanted to ask you guys for some experience or thoughts on this :) Maybe there is some plugin that im not aware of or another process which could be usefull for this case.

Short update: The idea with the centroids, that are buffered, dissolved and then intersected with the steps to get their count seems to solve some of the problems (2 & 3 for example) but some problems remain. Of course.. solved_ones

And here are some examples, where it still doesnt work correctly.

The main problem is gonna be the exact parametrization of the buffer size. If the buffer size is bigger it would probably solve the brown stairs, be complicated with the blue one and could definitly mess up the stairs on the right, so that both slim stairs will be regarded as one, which might btw also be the case, as they are only about 0,3 meters broad. But it would then double the amount of steps in that buffered area.

The problem with the green buffered area, that two of such buffered areas are inside one stair should be solved quite easily.

Question: How can I calculate the max with and max length of every single shapefile, to assign this to a variable buffer size?

enter image description here

closed as too broad by PolyGeo Aug 4 '17 at 20:05

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • The polygon count is working fine and your problem is due to poor or unexpected data that seems to result from unexpected division of the steps. can you detail how you got/made the step polygons? – MappaGnosis Aug 4 '17 at 15:18
  • Exactly, thats the problem. The steps are part of some public data, which I could extract using something like Layer='Steps'. So I know that the input data is the problem, as it is probably too detailed, maybe wrong and maybe incomplete. But i cannot really fix that problem. So i am trying to find another way. – SeGa Aug 4 '17 at 16:02
  • Can you share a little of the raw data. It may be that there are ways to improve it before doing the step counts – MappaGnosis Aug 4 '17 at 16:05
  • You can download some raw data here: link. In the layer menu click on "Geodaten Download" and select "Flächen-MZK Vektordaten". Click on a tile (35/4 contains some problems for example) to download it. Then in the Attributes you will find LAYER and only select those that have 'Stiege' as value. – SeGa Aug 4 '17 at 16:41
  • Welcome to GIS SE! As a new user please take the Tour to learn about the site and its focused Q&A format. I think you have the content here for a number of good questions but at the moment it seems like you are wanting to discuss your project rather than asking them as one question per question. – PolyGeo Aug 4 '17 at 20:10