Coder Social home page Coder Social logo

offlinereversegeocode's Introduction

An Offline Reverse Geocoding Java library

Uses KD-Trees for extremely fast placename lookups

Licensed under The MIT License

A C# port by Necrolis is available at https://github.com/Necrolis/GeoSharp

Usage:

First download a placenames file from http://download.geonames.org/export/dump/

Allcountries.zip from that site is comprehensive however if you're on mobile try the cities1000.zip file. It's 1/80th of the size.

Then simply

ReverseGeoCode reverseGeoCode = new ReverseGeoCode(new FileInputStream("c:\\AU.txt"), true);

System.out.println("Nearest to -23.456, 123.456 is " + geocode.nearestPlace(-23.456, 123.456));

offlinereversegeocode's People

Contributors

areallygoodname avatar dkatzel-home avatar sgri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

offlinereversegeocode's Issues

Main City Identification

Hi guys,
I am really new to the geocoding challenges.
I wanted to integrate an offline reverse geocoded in my app and I tried yours.
I used few datasets ( like cities1000.txt)
When reverse geocoding a LatLon I get this kind of lines :

Poplar Poplar 51.51113 -0.01565 P PPLA3 GB ENG GLA O5 0 7 Europe/London 2011-03-03

poplar is a small district of London, so I would like to get something like :

Poplar, London, GB, Europe

[0] . [2] e [3] I can get them getting elements from the row.

But what about the main city close to the current location? ( in the example London ) .
Is there a way to retrieve that from the line ?

Should I use another dataset ?

Cheers

Sorry if I used the issue, but I didn't know how to contact !

Very skewed distribution of duration on large datasets

Hi, I'm trying to use your code as part of an algorithm on a large dataset using Scala and Apache Spark. I'm having great results in terms of accuracy but I did if on several samples of GPS tracklog data and have a very skewed distribution of duration

Metric Min 25th percentile Median 75th percentile Max
Duration 10 s 1.2 min 6.2 min 12 min 51 min
GC Time 0.2 s 2 s 4 s 4 s 10 s
Input 25.5 MB 128.1 MB 128.1 MB 128.1 MB 128.1 MB
Output 18.4 MB 93.3 MB 93.6 MB 93.7 MB 94.0 MB

I would like to know it this is an expected behaviour of this algorithm or if you have some tips and tricks to have a more stable results for any dataset (having less variance, maybe at the cost of having an higher average duration.

Get Country

Hi. I am new to geocoding and been looking around for both commercial and open source services. I tested your code in android studio and tried the nearestPlace() method. It works fine, and it returns a city. My question is, how can I use your framework so that I can use a method that gets only the Country (or Country Code) of any passed latitude and longitude coordinates? I've studied your codes and I can't seem to come up with a way to just get the country/ country code using lat and long. Thank you very much.

N nearest

Can the K-d tree be enhanced with af find N nearest places ?

Geocoding?

Does it only do Reverse Geocoding? I'm interested in Geocoding

Can you make a release?

First off, thank you for making this. It's just what we need for a project we are working on. However, we're encountering a small problem. We would like to refer to your software in our pom, but are hesitant to link to a snapshot version in our pom. The risk is that when the snapshot changes, it might break our code. Currently our only option seems to be to copy your classes to our project, which is less than ideal.

Could you make a release so that we can link to a version that we know won't change?

With OSM data

Hi,
Just wandering if your algorithm would work with OSM raod data. My purpose is to locate a vehicule offline.
I'm not asking if any one could do it. But, just if I extend the GeoName class, would it work ?

Question: Is it thread safe?

Great library!

Are ReverseGeoCode and the other classes thread-safe? I'd like to only create a single instance due to the time to read the dataset from disk, but I want to make sure it was intended for that kind of use.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.