freifunk / freifunk/api.freifunk.net

Unclear format for map json data, add a "nodeMapsData"?

Open
#177 5 comments 1 reaction 0 assignees View on GitHub
Dominant language
Makefile
Stars
51
Forks
24
PR merge metrics
No merged PRs in 30d

Description

Background: Currently both the [Gluon census-exporter](https://github.com/freifunk-gluon/census-exporter/) for the [Gluon Census](https://stats.darmstadt.freifunk.net/d/CA5PRFmMz/gluon-census?orgId=1) and the [meshviewer-collector](https://github.com/genofire/meshviewer-collector/) for [multi.meshviewer.org](https://multi.meshviewer.org/) maintain their own lists for JSON sources:

* https://github.com/freifunk-gluon/census-exporter/blob/master/communities.json
* https://github.com/genofire/meshviewer-collector/blob/develop/config.toml

Most communities also provide map JSON data via api.freifunk.net, however their current, aggregated state is pretty unusable for both the gluon-census and the meshviewer-collector at the moment: https://github.com/freifunk-gluon/census-exporter/issues/4#issuecomment-3035698823

I'm wondering if this might be due to an unclear specification regarding a meshviewer.json or a Hopglass nodes.json. At least all four entries with a meshviewer.json in the Freifunk API all use a different format: https://github.com/freifunk-gluon/census-exporter/issues/4#issuecomment-3041094958

---

Suggestion A):

1) Clarify that nodeMaps is only for HTML rendered maps. 2) deprecate "nodelist" in nodeMaps. 3) add a new nodeMapData like the following:

```
"nodeMapData": {
"type": "array",
"title": "Node map data sources",
"description": "Machine-readable node map data of nodes or topology your community provides",
"items": {
"type": "object",
"title": "node",
"properties": {
"url": {
"$ref": "#/definitions/url",
"title": "URL of the map",
"description": "The URL where the map data is located"
},
"interval": {
"type": "string",
"title": "interval",
"description": "How often the map data will be refreshed"
},
"mediaType": {
"type": "string",
"title": "Media Type as registered at IANA: https://www.iana.org/assignments/media-types/media-types.xhtml",
"description": "",
"enum": [ "", "text/csv", "application/json" ],
"default": ""
}
"mapDataFormat": {
"type": "string",
"title": "Map Data Format",
"description": "The format of the provided map data",
"enum": [ "", "nodelist", "meshviewer", "meshviewer/old", "hopglass/v1", "hopglass/v2" ],
"default": ""
}
},
"additionalProperties": false
```

If mapDataType is "nodelist", "meshviewer", "meshviewer/old", "hopglass/v1" or "hopglass/v2" then only mediaType: "application/json" should be allowed. (If such a constraint is not possible then maybe split this into "nodeMapDataJSON" and "nodeMapDataCVS"?)

I'd suggest / tend to having nodeMapData adjacent to instead of within nodeMap. As some communities for instance have two nodeMapData for one meshviewer instance, where one points to the geographical map tab and the other to the topology graph tab.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.