Skip to content

Create Readme.md#152

Open
vshcherb wants to merge 6 commits intomasterfrom
osm-live-docs
Open

Create Readme.md#152
vshcherb wants to merge 6 commits intomasterfrom
osm-live-docs

Conversation

@vshcherb
Copy link
Member

No description provided.

- [To way/1170508451](https://www.openstreetmap.org/way/1170508451)
- [Relation ownself](https://www.openstreetmap.org/relation/8085812)

#### Overpass fetching
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate section

Generating roads & points

If way, node has we need to retreive relation(s) they belong to in order to create roads correctly with turns restrictions, ...

So we need the code to fetch relations and make them complete.
[ Missing info ] ... However as we make these relations complete we fetch ways that were not changed and they are not complete (as we don't fetch parent relations again after step 3), [Explain how we handle this stituation]

// 3. final step make all relations / way / node complete
(way(r.a);.a;) ->.a;
(node(r.a);.a;) ->.a;
```
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Missing section]

Explain how multipolygons are handled

3. Make `*_diff.obf` - where only changed/deleted objects are present. In the `*_diff.obf` we store objects from `*_after.obf` that are different from `*_before.obf` (created or modified).
5. Split world's `*_diff.obf` into different countries/region files.

## What to do with OSM relations ?
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Suggested name]

Propagating tags from OSM relations

(node(r.a);.a;) ->.a;
```

If the relation changed itself when we retreive members (nodes and ways), after retrieving all member's relations (even if incompleted - without all the members included!!!), the data is stored to `*_before_rel.obf` and `*_after_rel.obf`:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Separate section]

Generating routes (relations)

If there are changes in relation itself and relation represents a visible / searchable entity such as routes, we need to regenerate ways / points that belong to this route. This needs to be handled separately if way is removed from relation it won't be handled correctly while Generating roads & points process

$DATE_DIR/src/${BASENAME}_before_rel.osm.gz $DATE_DIR/src/${BASENAME}_after_rel.osm.gz \
$DATE_DIR/src/${BASENAME}_diff.osm.gz ${BASENAME}_after_rel_m.osm.gz
```
Files `*_before_rel.osm` and `*_after_rel.osm` can include different sets of relations. And different relations contains different sets of members (nodes/ways)!!!<br>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Files *_before_rel.osm and *_after_rel.osm can include different sets of relations based on overpass query.

And different relations contains different sets of members (nodes/ways)!!!
Why it's important information, looks clear? with !!!

  • Why is it happen?
    It's clear based on the example of the query above, no need to explain...
    1, 2 - easily generates different sets of way, node and 3 generates different sets of the relations

```
Files `*_before_rel.osm` and `*_after_rel.osm` can include different sets of relations. And different relations contains different sets of members (nodes/ways)!!!<br>
- Why is it happen? - Before query on specific time (`$START_DATE` or `$END_DATE`) we do not know what relations was created/deleted. So `*_before_rel.osm` will consist of deleted relations, and `*_after_rel.osm` will consist of created relations.
- Why is it problem (different sets of nodes/members) ? - Because in `*_diff.obf` we can got many "created" and "deleted" nodes/ways.<br>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While explaining the problem is ok, it's not clear what the problem and what's the purpose of before_rel.osm.gz, after_rel_m.osm.gz.

We need to start with what do we want to achieve that should be in the file. To calculate the difference
Then we can put:

Query

Explanation of query

Unused data in after file

not a problem because the data is complete or a problem?

Unnecessary data in before file

Explain type of unnecessary data source and solution with generate-relation-osm

- So, what to do? - We just copy nodes/ways from `*_before_rel.osm` to `*_after_rel.osm`.
- Hmm, but nodes/ways in `*_before_rel.osm` can consist of old tags or geometry ?! - Yes, therefore need to use `*_diff.osm` for find all `<action type="create">`, `<action type="modify">`, `<action type="delete">` and correctly copy objects. Good example in the issue [Geometry duplication in live update](https://github.com/osmandapp/OsmAnd/issues/21561) whre made fix that avoid copying modified nodes/ways to `*_after_rel_m.osm`.

## What is next ?
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Section

Generate obf files and diffs

Section

Merging standard map & relation diff obf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant