Skip to content

Add geo module (offline + nominatim)#17

Open
JaskerX wants to merge 6 commits into
AlpsBTE:mainfrom
JaskerX:main
Open

Add geo module (offline + nominatim)#17
JaskerX wants to merge 6 commits into
AlpsBTE:mainfrom
JaskerX:main

Conversation

@JaskerX

@JaskerX JaskerX commented Mar 16, 2026

Copy link
Copy Markdown

Using the geo module it is possible to retrieve location data by coordinates. For example the country or city. This can happen by either providing a data file for offline search or using the Nominatim API

@Zoriot Zoriot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also please add this new module to the Readme and also link it there.

Other then that looks quite good, still need to implement/try it trough.

try {
JSONObject response;

URL url = URI.create("https://nominatim.openstreetmap.org/reverse?lat=" + latitude + "&lon=" + longitude + "&format=json&zoom=" + this.zoom).toURL();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make that komoot compatible? People might want to use that for obvious reasons

Comment thread geo/src/main/java/com/alpsbte/alpslib/geo/logger/LoggerAdapter.java Outdated
Comment thread README.md
### [AlpsLib-Geo](https://mvn.alps-bte.com/#browse/browse:alps-bte:com%2Falpsbte%2Falpslib%2Falpslib-geo)

This module can be used to get geo information (like country or city) of a location identified by latitude and longitude. This is possible both offline and over https using Nominatim.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please include a link to the readme of geocode

* @param longitude The locations longitude
* @return The location data or null if there were errors
*/
public RgcGeoLocation locationFromCoordinates(float latitude, float longitude) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A overload with doubles would be nice.

@@ -0,0 +1,263 @@
package com.alpsbte.alpslib.geo.rgc;

/* Copyright (c) 2015, Erich Schubert

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, do we have to use this code? You are not the original author of this code right? because if not, we have to keep this here like specified in the licence.
I would rather avoid shipping multiple licenses if possible.
But if we have to, please specify in the projects LICENCE.md or somethere that this module uses other licenses as well other than MIT.
Also please verify that this is the only file that needs to have this header and none of the other classes come from the same source.

@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 1 high · 6 medium · 50 minor

Alerts:
⚠ 57 issues (≤ 0 issues of at least minor severity)

Results:
57 new issues

Category Results
BestPractice 3 medium
5 minor
ErrorProne 1 medium
Security 1 high
CodeStyle 45 minor
Complexity 2 medium

View in Codacy

🟢 Metrics 52 complexity · 0 duplication

Metric Results
Complexity 52
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

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

Successfully merging this pull request may close these issues.

3 participants