package org.apache.lucene.spatial.strategy.geohash;

import org.apache.lucene.spatial.base.context.SpatialContext;
import org.apache.lucene.spatial.base.shape.Point;
import org.apache.lucene.spatial.strategy.util.ShapeFieldCacheProvider;
import org.apache.lucene.util.BytesRef;

public class GeoHashFieldCacheProvider extends ShapeFieldCacheProvider<Point> {

  final SpatialContext context;

  public GeoHashFieldCacheProvider( SpatialContext ctx, String shapeField, int defaultSize ) {
    super( shapeField, defaultSize );
    this.context = ctx;
  }

  @Override
  protected Point readShape(BytesRef term) {
    // TODO Actually fill in the point...
    return context.makePoint( 0, 0 );
  }
}

@@ -384,16 +384,19 @@
 context;
+ //
 %0A%0A  publ
@@ -624,37 +624,88 @@
 ODO 
-Actually fill in the point...
+skip ngrams?%0A    double%5B%5D p = GeoHashUtils.decode(term.utf8ToString(), context);
 %0A   
@@ -735,12 +735,18 @@
 nt( 
-0, 0
+p%5B0%5D, p%5B1%5D
  );%0A

decode point