cities1000.zip
" to get cities with at least 1000 inhabitants worldwide
+
+### Java version
+
+This library requires **Java 11** (Oracle JDK or OpenJDK) or higher.
+
+
+## Usage
+
+### Maven dependency
+
+Include the library into your POM:
+
+```xml
+ cities1000.zip
) once and access it as a Singleton.
-First download a placenames file from http://download.geonames.org/export/dump/
+By default it keep ALL cities:
-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.
+```java
+// Retrieve data-file
+final Path citiesFile = Paths.get("/home/guillaume/dev/workspace/OfflineReverseGeocode/src/test/resources/cities1000.zip");
-Then simply
+// Init DB keep all cities (raises exception if the file does not exists or is not valid)
+new ReverseGeoCode(inputZipFile, false, null);
+
+// Query
+GeoName closestCity = ReverseGeoCode.getInstance().nearestPlace(latitude, longitude);
+System.out.println(closestCity.toString());
+```
-ReverseGeoCode reverseGeoCode = new ReverseGeoCode(new FileInputStream("c:\\\\AU.txt"), true);
+### Keep only major cities
+You can choose to keep only the majors cities by setting the flag as "true" :
+
+```java
+// Retrieve data-file
+final Path citiesFile = Paths.get("/home/guillaume/dev/workspace/OfflineReverseGeocode/src/test/resources/cities1000.zip");
+
+// Init DB keep only MAJOR cities
+new ReverseGeoCode(inputZipFile, true, null);
+```
+
+### Multiple files at once
+
+You can also load multiple files together:
+
+```java
+// Retrieve data-files
+final Path citiesFile = Paths.get("/home/guillaume/dev/workspace/OfflineReverseGeocode/src/test/resources/cities1000.zip");
+final Path luFile = Paths.get("/home/guillaume/dev/workspace/OfflineReverseGeocode/src/test/resources/LU.zip");
+final Listclone the project
and mvn clean install
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 2d339a6..9c187d0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,36 +3,220 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
Created by Daniel Glasson on 18/05/2014.
+ * Uses KD-trees to quickly find the nearest point
+ * 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));
+ *
+ *
+ *