<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <!-- This module was also published with a richer model, Gradle metadata,  -->
  <!-- which should be used instead. Do not delete the following line which  -->
  <!-- is to indicate to Gradle or any Gradle module metadata file consumer  -->
  <!-- that they should prefer consuming it instead. -->
  <!-- do_not_remove: published-with-gradle-metadata -->
  <modelVersion>4.0.0</modelVersion>
  <groupId>io.github.markrileybot</groupId>
  <artifactId>geokey</artifactId>
  <version>0.0.5</version>
  <name>geokey</name>
  <description># geokey

K Dimensional Z-Order curve utils.

[![Build Status](https://travis-ci.org/markrileybot/geokey.svg?branch=master)](https://travis-ci.org/markrileybot/geokey) 
[![Coverage Status](https://coveralls.io/repos/github/markrileybot/geokey/badge.svg?branch=master)](https://coveralls.io/github/markrileybot/geokey?branch=master)

## Building

./gradlew build

## Gradle dependency

See https://github.com/markrileybot/geokey/packages/1492764

## Using

### Use built in keys to make geohashes

```java
import org.geokey.GeoKey;

// Make a geo hash key
String key = new GeoKey().setLatitude(48.669).setLongitude(-4.329).toString(); // "gbsuv7ztqzpts82uzfwq5e1bp"

// parse a geo hash key
GeoKey gk = new GeoKey("gbsuv7ztqzpts82uzfwq5e1bp");
```

### Make a special purpose K-Dimensional key

```java
public class GeoTimeKey extends KDKey {

	private static final KDKeySpec spec = new KDKeySpec.Builder()
			.addDim(-180, 180, 1)
			.addDim(-90, 90, 1)
			.addDim(0, 1L &lt;&lt; 62, 1)
			.setAlphabet(Alphabet.GEO_TIME_HASH)
			.build();

	public GeoTimeKey() {
		super(spec);
	}

	public GeoTimeKey(String s) {
		super(spec, s);
	}

	public GeoTimeKey(byte[] s) {
		super(spec, s);
	}

	public GeoTimeKey setLatitude(double latitude) {
		set(1, latitude);
		return this;
	}

	public double getLatitude() {
		return super.get(1);
	}

	public GeoTimeKey setLongitude(double longitude) {
		set(0, longitude);
		return this;
	}

	public double getLongitude() {
		return super.get(0);
	}

	public GeoTimeKey setTime(long time) {
		set(2, time);
		return this;
	}

	public long getTime() {
		return (long) get(2);
	}
}
```
</description>
  <url>https://github.com/markrileybot/geokey</url>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
    </license>
  </licenses>
  <developers>
    <developer>
      <name>Mark Riley</name>
      <email>mark@markriley.net</email>
      <url>https://github.com/markrileybot/geokey</url>
    </developer>
  </developers>
  <scm>
    <connection>git:git@github.com:markrileybot/geokey</connection>
    <developerConnection>git:git@github.com:markrileybot/geokey</developerConnection>
    <url>https://github.com/markrileybot/geokey</url>
  </scm>
</project>
