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

Show this index on a map #79

Closed
bhousel opened this issue Apr 17, 2018 · 16 comments
Closed

Show this index on a map #79

bhousel opened this issue Apr 17, 2018 · 16 comments
Labels
enhancement New feature or request

Comments

@bhousel
Copy link
Member

bhousel commented Apr 17, 2018

Kind of similar to how editor-layer-index has a basic live preview - this index should have a map too.

@bhousel bhousel added the enhancement New feature or request label Apr 17, 2018
@joostschouppe
Copy link
Contributor

@jbelien suggested also turning this into a website. Basically, if you go to https://NICE-WEBSITE/north-america/us you get a pretty webpage that shows you the resources for the US resources.
Extras:

  • add /language-code to get the page in different languages
  • show the national resources first (e.g. by making sure files with national resources start with the country code, or adding it as a property to the JSON)
    This would also make it a little easier for local organisers to add a page to their website where they show their media.

@jbelien
Copy link
Contributor

jbelien commented May 6, 2018

Here are some screenshots !
I'll publish it on my GitHub account in the next few days ! 🎉

Feel free to already made some comments about it !


http://localhost:8080/resources/europe/be :

capture d ecran - 2018-05-06 a 11 30 17


http://localhost:8080/resources/europe/be/fr (translation enabled) :

capture d ecran - 2018-05-06 a 11 33 43


http://localhost:8080/features/europe/be :

capture d ecran - 2018-05-06 a 11 34 52

Translation is of course available for /features too.


I also added an iframe mode which removes the country title to embed the result in an iframe.

http://localhost:8080/resources/europe/be?iframe :

capture d ecran - 2018-05-06 a 11 36 39

@bhousel
Copy link
Member Author

bhousel commented May 7, 2018

That's great @jbelien ! We can merge this and serve it on the github page for this project 👍

@jbelien
Copy link
Contributor

jbelien commented May 7, 2018

Thanks for the good words ! 😄

You can play with it here : https://community.osm.be/
Code will be published soon.

Unfortunately, it won't be possible to host it on GitHub Pages because it's developed using PHP.

@jbelien
Copy link
Contributor

jbelien commented Aug 26, 2018

Code is (finally) released : https://github.com/jbelien/oci-viewer
And it is now run using Heroku : https://oci-viewer.herokuapp.com/ (http://community.osm.be/ will soon be redirected to the new Heroku app.)

@osmtools
Copy link

At the moment i'm the maintainer of https://github.com/fossgis/usergroups-bot aka http://usergroups.openstreetmap.de. A few weeks ago i switched it from an old OL2 to a new Leaflet.
I think I also could show this community index on a/this map ... but have some problems with it.

How i generate the (one) geojson file: walk through all features > for each feature walk through all corresponding country resources > load the json > compare the featureId (because there isn't any filename convention between resource and feature) > if true add resource to feature.properties

Have a look at http://usergroups.openstreetmap.de/community.html

Because there isn't any hierarchy in the features some inner outlines are overlapped by the country outline and so the click event for the popup shows the wrong information. But for Leaflet.geojson the sorting (hierarchy) is important, first the country outlines (admin=2), then regions (admin=4), then administrations (admin=6) on top and so on.

Have i overlooked something?

@bhousel
Copy link
Member Author

bhousel commented Oct 1, 2018

Hey @osmtools !
The release branch of this repo contains the generated files:
https://github.com/osmlab/osm-community-index/tree/release/dist

On iD side, we bundle the index directly into iD.
But a site that just wants to import the index could load it in a <script> tag from https://unpkg.com/#/
(for example: https://unpkg.com/osm-community-index )

I think we should add some better "how to use this index" info to the README with examples.

Have a look at http://usergroups.openstreetmap.de/community.html

Because there isn't any hierarchy in the features some inner outlines are overlapped by the country outline and so the click event for the popup shows the wrong information. But for Leaflet.geojson the sorting (hierarchy) is important, first the country outlines (admin=2), then regions (admin=4), then administrations (admin=6) on top and so on.

Oh yeah I see what you mean - you definitely want to sort the smallest areas on top of the larger areas. In iD I use d3.polygonArea but something like turf/area would work too. Maybe we should just calculate the areas in this project and include them with each entry? It would help out downstream projects..

@osmtools
Copy link

osmtools commented Oct 1, 2018

The release branch of this repo contains the generated files:
https://github.com/osmlab/osm-community-index/tree/release/dist

but there, there isn't any merge of the two files/types. I generate one big geojson file while i merge resources to feature.properties so leaflet could load this one and only geojson file once at all.

Maybe we should just calculate the areas in this project and include them with each entry?

Yeah, would be very nice. Otherwise i have to calculate the features with a/in my python script and order my big geojson file ... all this because i don't want to much calculation and processing on the client javascript side

@matkoniecz
Copy link
Contributor

Would it be OK to start linking https://community.osm.be/ from the readme?

@bhousel
Copy link
Member Author

bhousel commented May 6, 2019

Would it be OK to start linking https://community.osm.be/ from the readme?

Sure 👍

bhousel added a commit that referenced this issue Aug 1, 2019
(useful for putting these things on a map, re: #79)
@bhousel
Copy link
Member Author

bhousel commented Aug 1, 2019

Quick update on this - as of v0.11.0 we're now publishing a combined.geojson file which makes it a little easier for consumers to just get all the data and show it on a map.

If you want to use this file, you can get it from the release branch:
https://github.com/osmlab/osm-community-index/blob/release/dist/combined.geojson
https://github.com/osmlab/osm-community-index/blob/release/dist/combined.min.geojson

Or even better - use something like the unpkg CDN to fetch the latest published version of the file:
https://unpkg.com/osm-community-index/dist/combined.geojson
https://unpkg.com/osm-community-index/dist/combined.min.geojson

@jbelien
Copy link
Contributor

jbelien commented Aug 2, 2019

Interesting! 🎉

I'll try to add that to https://community.osm.be/ to display a global map ! 👍

@joostschouppe
Copy link
Contributor

Mikel made a quick map: https://mikelmaron.github.io/map-demos/osm-community-index/

@bhousel
Copy link
Member Author

bhousel commented Oct 16, 2019

Mikel made a quick map: https://mikelmaron.github.io/map-demos/osm-community-index/

This is great! Thanks @mikelmaron for putting this together.
I've added the link to the README file..

@jbelien
Copy link
Contributor

jbelien commented Oct 19, 2019

Map deployed on https://community.osm.be/ 🎉

@jbelien
Copy link
Contributor

jbelien commented Jun 4, 2020

I've built a new version of my OSM Community Index viewer : https://oci-viewer.netlify.app/ (temporary URL ; it will still use https://community.osm.be/ when released).

Interface has been improved and the website is now static (using Sapper) and could be hosted using GitHub Pages (see #79 (comment)) !

Feedback is welcome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants