Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split up data and polygons #7

Closed
bhousel opened this issue Mar 13, 2018 · 4 comments
Closed

Split up data and polygons #7

bhousel opened this issue Mar 13, 2018 · 4 comments

Comments

@bhousel
Copy link
Member

bhousel commented Mar 13, 2018

Before we go too wild adding all the things, we should separate the data from the polygons so that we don't run in to the kind of geojson duplication we see in editor-layer-index.

@bhousel
Copy link
Member Author

bhousel commented Mar 13, 2018

This was done, now we have

features/ - contains .geojson files, one for each feature.
resources/ - contains .json files, one for each resource.

Each resource has a featureId to link it to a single feature.

@tyrasd
Copy link
Member

tyrasd commented Mar 13, 2018

Couldn't this been done also in a way that doesn't require at the separation into two files for each "region"? For example as an array property in the respective feature's properties, e.g. something like:

{
  "type": "Feature",
  "id": "usa_full",
  "properties": {
    "countryCode": "US",
    "resources": [
      {
          "type": "slack",
          "name": "OpenStreetMap US Slack",
          "description": "Sign up at {url}",
          "url": "https://osmus-slack.herokuapp.com/"
      },
      …
    ]
  },
  "geometry": {
    "type": "MultiPolygon",
    "coordinates": …

This would make maintenance and PRs easier, I believe.

A full separation between geometry and resource would only been needed if we would like to allow an n to m relationship between these (e.g. a joint inter-regional forum).

@bhousel
Copy link
Member Author

bhousel commented Mar 13, 2018

Couldn't this been done also in a way that doesn't require at the separation into two files for each "region"?

Yes, I considered that, but I think this way is:

  • easier to explain to people
  • reduces the need to edit the .geojson, which is more fragile
  • better if community forums / meetups come and go but the features rarely change
  • allows people to consume just the resource list, if they don't care about the geometry

@tyrasd
Copy link
Member

tyrasd commented Mar 13, 2018

ok, I guess it comes down to a matter of taste 😉, but:

  • it can make it harder to create PRs (two files in separate directories vs. one single file which one can even do directly on github.com without even having to check out the repo locally)
  • having hardcoded id strings as cross references is also a bit fragile. For example when removing a resource: do I have to check all other resources whether at least one still points to the respective geometry before deleting the geojson file as well? or do I just leave it in place in case something might re-use that geometry later on?
  • consuming just the resource list would still be possible if we would provide it as a stripped down version of the "full" data in /dist

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

No branches or pull requests

2 participants