a-b-street / osm2lanes

A common library and set of test cases for transforming OSM tags to lane specifications
https://a-b-street.github.io/osm2lanes/
Apache License 2.0
34 stars 2 forks source link

Country Metadata #103

Open droogmic opened 2 years ago

droogmic commented 2 years ago

I think it would be good to share country-related metadata with other tools. For example, we could fork https://github.com/streetcomplete/StreetComplete/blob/master/res/country_metadata into a different repo, and then include it both here and in streetcomplete as a compile time dependency to determine locale specific data.

Complication: https://github.com/streetcomplete/StreetComplete/blob/master/COPYING this license is incompatible with ours as far as I know. Either we need to rewrite this from scratch, or discuss licensing with the StreetComplete maintainer.

dabreegster commented 2 years ago

@westnordost I think you mentioned this idea elsewhere before. As a strawman proposal, what if we forked a streetcomplete/country_metadata repo with these YAMLs? And any opinions about an Apache license for that?

westnordost commented 2 years ago

I looks like I missed this. Hm that's right, there is no mention of a license for that data, which by default makes it GPL-3.

I am willing to relicense that as CC-0 / public domain, but I am not the only (though almost, IIRC) person to have contributed to that, so the other people who have contributed to each file need to be asked first (and their contribution axed if they don't agree). Apache License is more for software, is it not? This is just a data collection, so a CC-license seems to be more fitting. The more restrictive a license, the less contributors will likely have a problem with that. Would e.g. CC-BY-SA be acceptable?

westnordost commented 2 years ago

See https://github.com/streetcomplete/StreetComplete/discussions/3928

westnordost commented 2 years ago

I see @droogmic renamed the centerLineStyle.yml to center_line_style.yml. Is there a good reason for this or just a matter of taste? If there is a good reason for it, I could change the naming convention for all the files when putting the data CC0 licensed into a different repo

westnordost commented 2 years ago

Alrighty, all the country metadata is now here:

https://github.com/streetcomplete/countrymetadata/

Note that they are grouped by property (e.g. isLeftHandTraffic.yml and not US.yml) because it is easier to manage and contribute this way. For using the data, the other way around (US.yml etc.) is likely more convenient, which is why a build script in StreetComplete switches this around on downloading it. Maybe you would like to use something like that too: https://github.com/streetcomplete/StreetComplete/blob/master/buildSrc/src/main/java/GenerateMetadataByCountry.kt

droogmic commented 2 years ago

I see @droogmic renamed the centerLineStyle.yml to center_line_style.yml. Is there a good reason for this or just a matter of taste? If there is a good reason for it, I could change the naming convention for all the files when putting the data CC0 licensed into a different repo

Oh, I only did it to match rust's style guide. I don't think standalone data has any agreed naming convention.

My bigger concern is the use of YAML, especially given https://hitchdev.com/strictyaml/why/implicit-typing-removed/ and how it actually impacts this repo. I may try to reformat some of the data if you don't mind, and I can reintegrate it on your side.

westnordost commented 2 years ago

The data will remain in YAML because it is easier to contribute this way. I am aware of the NO problem so I only parse this in strict. But I'll change the source data and put NO in "" just so that noone else stumbles upon this.

Regarding YAML in general: I guess if osm2lanes / a/b street doesn't use a YAML parser elsewhere, it is not worth adding a dependency for this. Probably better then to have a build script convert it to JSON or something else.

I may try to reformat some of the data if you don't mind, and I can reintegrate it on your side.

If I mind depends on what you intend to change ;-)

westnordost commented 2 years ago

By the way, YAML 1.2, i.e. since 2009, does not have this ridiculous feature anymore.