List of usage examples for org.apache.lucene.geo GeoEncodingUtils decodeLongitude
public static double decodeLongitude(byte[] src, int offset)
From source file:org.codelibs.elasticsearch.common.geo.GeoPoint.java
License:Apache License
public GeoPoint resetFromIndexableField(IndexableField field) { if (field instanceof LatLonPoint) { BytesRef br = field.binaryValue(); byte[] bytes = Arrays.copyOfRange(br.bytes, br.offset, br.length); return this.reset(GeoEncodingUtils.decodeLatitude(bytes, 0), GeoEncodingUtils.decodeLongitude(bytes, Integer.BYTES)); } else if (field instanceof LatLonDocValuesField) { long encoded = (long) (field.numericValue()); return this.reset(GeoEncodingUtils.decodeLatitude((int) (encoded >>> 32)), GeoEncodingUtils.decodeLongitude((int) encoded)); }/*from w w w.ja v a 2s. co m*/ return resetFromIndexHash(Long.parseLong(field.stringValue())); }