tyrasd / overpass-turbo

A web based data mining tool for OpenStreetMap using the Overpass API.
https://overpass-turbo.eu
Other
909 stars 128 forks source link

wikidata "plugin" #286

Open tyrasd opened 7 years ago

tyrasd commented 7 years ago

e.g. search operators with wikidata query -> use them to search in osm

bjohas commented 7 years ago

@tyrasd Linking with wikidata is a great idea - just in the last few days I used the overpass-turbo codebase to also query wikipedia (for geodata) and display this too. Might be different from your idea, but I'll formally fork it shortly.

tyrasd commented 7 years ago

cool. As you can see, this ticket is still quite open and lacking some details :sweat_smile:. I'm still thinking about how such a wikidata integration could exactly look like. I'm quite curious about your use case and implementation.

bjohas commented 7 years ago

I'd like to push my version back to git... But the issue is that I've originally branched jongleurs repo (some time ago). I now want to create a new branch in my repo, that tracks your repo's master branch, to which I can then upload my edits. Are you familiar enough with git? I think I probably need to create a new branch in my repo, then change the upstream repo from jongleur to yours? Not sure how to do this.

Otherwise I could just make a new repo, but that doesn't seem quite right.

tyrasd commented 7 years ago

Oh, that branch is probably really old. Hmm. You can change the upstream to my repo, but rebasing your code to the current master could be turn out to be quite difficult.

Can you just push your commits as-is to github?

bjohas commented 7 years ago

Hi @tyrasd. I did work of your latest master, so that's fine, no re-base needed.

I just need to know how to the github commands... i.e. start with

Then I'd be good to update the files and push back to the branch. This just shows my lack of familiarity with git :) If the above is easy to do, I'd appreciate a tip. Otherwise I'll just push to a new github repo.

Here's a screenshot of what it looks like: http://bjohas.de/wiki/Maps/Linking_wikipedia_to_OSM/Overpass_with_Mediawiki_API

tyrasd commented 7 years ago

ok, maybe just try something like:

  1. clone your repository: git clone git@github.com:bjohas/overpass-ide.git
  2. add the main repo as a remote repo called upstream: git remote add upstream git@github.com:tyrasd/overpass-turbo.git
  3. git fetch upstream
  4. git checkout upstream/master
  5. git branch your-branch-name
  6. git checkout your-branch-name
  7. add and commit your changes
  8. git push
bjohas commented 7 years ago

Hi @tyrasd,

thanks for those tips. I've pushed the code to here: https://github.com/bjohas/overpass-ide/tree/mastermwapi/Wikipedia_integration

The code doesn't work. I unfortunately downloaded the previous version that all all the includes in index.html, rather than index.js, so it wasn't trivial for me to get it going again. Instead, I've just cloned the new master branch, and then added my files. This means you can see them, and I can see how to integrate them. I've included files with "original" in the name, to show which versions I worked from. This is so that you can diff them, and see the approach. This is clear VERY ROUGH AND READY, and not production code. I basically wanted to fix some stuff in OSM and Wikipedia, and overpass seemed like the best place to start (as it already does overpass queries).

For a screenshot, see here: http://bjohas.de/wiki/Maps/Linking_wikipedia_to_OSM/Overpass_with_Mediawiki_API

Hope it's useful - happy to chat about it any time.

Btw. ideally my code would be loaded with minimal modifications to the master - i.e. as a 'plugin'. It seems you're planning to allow plugins anyway. Some tips on how I should structure my code so that it runs without minimal modifications to the upstream master would be appreciated.

tyrasd commented 7 years ago

Thanks, it's fine like that. I will take a look!