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

OpenHistoricalMap #39

Open
1ec5 opened this issue Sep 19, 2024 · 8 comments
Open

OpenHistoricalMap #39

1ec5 opened this issue Sep 19, 2024 · 8 comments
Labels
enhancement New feature or request

Comments

@1ec5
Copy link

1ec5 commented Sep 19, 2024

The OpenHistoricalMap project would benefit from this tool too. The API is identical between OSM and OHM; it’s just a different domain and database. Would you be open to extending it to switch between the two APIs? Or would you suggest forking the project and standing up a separate instance? Thanks for your consideration!

@Zaczero
Copy link
Owner

Zaczero commented Sep 19, 2024

I want to make the project universal and I am willing to work on the necessary changes. Do you have some communication channel where I could ask for details? Or should I just reach out over the GitHub issues?

@Zaczero Zaczero added the enhancement New feature or request label Sep 19, 2024
@1ec5
Copy link
Author

1ec5 commented Sep 20, 2024

Glad to hear it! We have lots of channels. 😛 Our developers monitor the central issue tracker closely. For discussion with the community, we have a forum with Discourse Chat enabled. Otherwise, feel free to reach out to me over OSM private messages or e-mail.1

Footnotes

  1. My address is listed in Copyedit English localization as American English openstreetmap/openstreetmap-website#5029 if you append .patch to the URL.

@Zaczero
Copy link
Owner

Zaczero commented Sep 27, 2024

@1ec5 Please test it at https://ohm-revert.monicz.dev

@Zaczero
Copy link
Owner

Zaczero commented Sep 27, 2024

I accidentally configured the service to turn off after 1 hour of runtime. I've fixed the issue, and the service is back up and running.

@1ec5
Copy link
Author

1ec5 commented Sep 27, 2024

Thanks for setting this up! Unfortunately, it looks like OHM’s Overpass API endpoint doesn’t like the / at the end of the URL path. For example, this query succeeds, but it fails with an HTTP 403 error if you append a slash. Let me know if that’s a problem and I can poke the devs about it.

[⛔] fetch_overpass failed
Traceback (most recent call last):
  File "/home/ohm-revert/osm_revert/main.py", line 58, in wrapper
    exit_code = func(*args, **kwargs)
                ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ohm-revert/osm_revert/main.py", line 152, in main
    diff = overpass.get_changeset_elements_history(changeset, steps, query_filter)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ohm-revert/osm_revert/overpass.py", line 220, in get_changeset_elements_history
    result = self._get_changeset_elements_history(http, changeset, steps, query_filter)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ohm-revert/osm_revert/overpass.py", line 257, in _get_changeset_elements_history
    partition_diff = fetch_overpass(http, partition_query)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ohm-revert/osm_revert/utils.py", line 45, in wrapper
    raise e
  File "/home/ohm-revert/osm_revert/utils.py", line 41, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ohm-revert/osm_revert/overpass.py", line 164, in fetch_overpass
    response.raise_for_status()  # TODO: return error message instead raise
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ohm-revert/.venv/lib/python3.12/site-packages/httpx/_models.py", line 763, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Client error '403 Forbidden' for url 'https://overpass-api.openhistoricalmap.org/api/interpreter/'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403

@Zaczero
Copy link
Owner

Zaczero commented Sep 28, 2024

Hey please try again now! It should be fixed in b059673 I also think it would be a good idea to fix it on the server too, so it's compatible with the official overpass which accepts both paths: with and without a trailing /.

@1ec5
Copy link
Author

1ec5 commented Sep 29, 2024

Thanks, it worked for changeset 138,526. I opened OpenHistoricalMap/issues#891 to track handling the trailing slash.

ohm-revert still has some references to OSM, such as the page title, “Logging in to OpenStreetMap” in the log, and the link to Pascal Neis’s osm-suspicious tool at the top. It’s just a cosmetic issue, but it had me worried for a moment that I’d be reverting an ancient OSM changeset by accident; maybe others would hesitate to use it for the same reason. Otherwise, I’m ready to add ohm-revert to OHM’s documentation on the wiki and announce it on the forum, once you feel good about the state of things.

@Zaczero
Copy link
Owner

Zaczero commented Sep 29, 2024

Yes I am aware of that. Ideally, the project names and links would be configurable too. I simply didn't bother with that now. 👍

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

2 participants