Skip to content

Commit

Permalink
Remove GEOENCODE / GEODECODE commands #102
Browse files Browse the repository at this point in the history
Remove commands as they were removed from Redis. So long, good bye, ciao ciao & do widzenia
  • Loading branch information
mp911de committed Jul 10, 2015
1 parent ff0e439 commit bc40d5c
Show file tree
Hide file tree
Showing 14 changed files with 0 additions and 533 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1630,21 +1630,6 @@ public RedisFuture<Double> geodist(K key, V from, V to, GeoArgs.Unit unit) {
return dispatch(commandBuilder.geodist(key, from, to, unit));
}

@Override
public RedisFuture<GeoEncoded> geoencode(double longitude, double latitude) {
return dispatch(commandBuilder.geoencode(longitude, latitude, null, null));
}

@Override
public RedisFuture<GeoEncoded> geoencode(double longitude, double latitude, double distance, GeoArgs.Unit unit) {
return dispatch(commandBuilder.geoencode(longitude, latitude, distance, unit.name()));
}

@Override
public RedisFuture<GeoEncoded> geodecode(long geohash) {
return dispatch(commandBuilder.geodecode(geohash));
}

protected <T> RedisFuture<T> dispatch(CommandType type, CommandOutput<K, V, T> output) {
return dispatch(type, output, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1594,21 +1594,6 @@ public Observable<Double> geodist(K key, V from, V to, GeoArgs.Unit unit) {
return createDissolvingObservable(() -> commandBuilder.geodist(key, from, to, unit));
}

@Override
public Observable<GeoEncoded> geoencode(double longitude, double latitude) {
return createDissolvingObservable(() -> commandBuilder.geoencode(longitude, latitude, null, null));
}

@Override
public Observable<GeoEncoded> geoencode(double longitude, double latitude, double distance, GeoArgs.Unit unit) {
return createDissolvingObservable(() -> commandBuilder.geoencode(longitude, latitude, distance, unit.name()));
}

@Override
public Observable<GeoEncoded> geodecode(long geohash) {
return createDissolvingObservable(() -> commandBuilder.geodecode(geohash));
}

protected <T> Observable<T> createObservable(CommandType type, CommandOutput<K, V, T> output, CommandArgs<K, V> args) {
return createObservable(() -> new Command<>(type, output, args));
}
Expand Down
67 changes: 0 additions & 67 deletions src/main/java/com/lambdaworks/redis/GeoEncoded.java

This file was deleted.

19 changes: 0 additions & 19 deletions src/main/java/com/lambdaworks/redis/RedisCommandBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
import com.lambdaworks.redis.output.DateOutput;
import com.lambdaworks.redis.output.DoubleOutput;
import com.lambdaworks.redis.output.GeoCoordinatesListOutput;
import com.lambdaworks.redis.output.GeoEncodedOutput;
import com.lambdaworks.redis.output.GeoWithinListOutput;
import com.lambdaworks.redis.output.IntegerOutput;
import com.lambdaworks.redis.output.KeyListOutput;
Expand Down Expand Up @@ -1840,24 +1839,6 @@ public Command<K, V, Double> geodist(K key, V from, V to, GeoArgs.Unit unit) {

}

@SuppressWarnings({ "unchecked", "rawtypes" })
public Command<K, V, GeoEncoded> geoencode(double longitude, double latitude, Double distance, String unit) {

CommandArgs<K, V> args = new CommandArgs<K, V>(codec).add(longitude).add(latitude);

if (distance != null && unit != null) {
args.add(distance).add(unit);
}
return (Command) createCommand(GEOENCODE, new GeoEncodedOutput<K, V>(codec, null), args);
}

@SuppressWarnings({ "unchecked", "rawtypes" })
public Command<K, V, GeoEncoded> geodecode(long geohash) {
CommandArgs<K, V> args = new CommandArgs<K, V>(codec).add(geohash);

return (Command) createCommand(GEODECODE, new GeoEncodedOutput<K, V>(codec, geohash), args);
}

/**
* Assert that a string is not empty, it must not be {@code null} and it must not be empty.
*
Expand Down
36 changes: 0 additions & 36 deletions src/main/java/com/lambdaworks/redis/RedisGeoAsyncConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,40 +110,4 @@ RedisFuture<List<GeoWithin<V>>> georadius(K key, double longitude, double latitu
* returned.
*/
RedisFuture<Double> geodist(K key, V from, V to, GeoArgs.Unit unit);

/**
*
* Encode {@code longitude} and {@code latitude} to highest geohash accuracy.
*
* @param longitude the longitude coordinate according to WGS84
* @param latitude the latitude coordinate according to WGS84
* @return multi-bulk reply with 4 elements 1: the 52-bit geohash integer for your longitude/latitude, 2: The minimum corner
* of your geohash {@link GeoCoordinates}, 3: The maximum corner of your geohash {@link GeoCoordinates}, 4: The
* averaged center of your geohash {@link GeoCoordinates}.
*/
RedisFuture<GeoEncoded> geoencode(double longitude, double latitude);

/**
*
* Encode {@code longitude} and {@code latitude} to highest geohash accuracy.
*
* @param longitude the longitude coordinate according to WGS84
* @param latitude the latitude coordinate according to WGS84
* @param distance distance for geohash accuracy
* @param unit the distance unit
* @return multi-bulk reply with four components 1: the 52-bit geohash integer for your longitude/latitude, 2: The minimum
* corner of your geohash {@link GeoCoordinates}, 3: The maximum corner of your geohash {@link GeoCoordinates}, 4:
* The averaged center of your geohash {@link GeoCoordinates}.
*/
RedisFuture<GeoEncoded> geoencode(double longitude, double latitude, double distance, GeoArgs.Unit unit);

/**
*
* Decode geohash.
*
* @param geohash geohash containing your longitude/latitude
* @return a list of {@link GeoCoordinates}s (nested multi-bulk) with 3 elements 1: minimum decoded corner, 2: maximum
* decoded corner, 3: averaged center of bounding box.
*/
RedisFuture<GeoEncoded> geodecode(long geohash);
}
36 changes: 0 additions & 36 deletions src/main/java/com/lambdaworks/redis/RedisGeoConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,40 +109,4 @@ public interface RedisGeoConnection<K, V> {
* returned.
*/
Double geodist(K key, V from, V to, GeoArgs.Unit unit);

/**
*
* Encode {@code longitude} and {@code latitude} to highest geohash accuracy.
*
* @param longitude the longitude coordinate according to WGS84
* @param latitude the latitude coordinate according to WGS84
* @return multi-bulk reply with 4 elements 1: the 52-bit geohash integer for your longitude/latitude, 2: The minimum corner
* of your geohash {@link GeoCoordinates}, 3: The maximum corner of your geohash {@link GeoCoordinates}, 4: The
* averaged center of your geohash {@link GeoCoordinates}.
*/
GeoEncoded geoencode(double longitude, double latitude);

/**
*
* Encode {@code longitude} and {@code latitude} to highest geohash accuracy.
*
* @param longitude the longitude coordinate according to WGS84
* @param latitude the latitude coordinate according to WGS84
* @param distance distance for geohash accuracy
* @param unit the distance unit
* @return multi-bulk reply with four components 1: the 52-bit geohash integer for your longitude/latitude, 2: The minimum
* corner of your geohash {@link GeoCoordinates}, 3: The maximum corner of your geohash {@link GeoCoordinates}, 4:
* The averaged center of your geohash {@link GeoCoordinates}.
*/
GeoEncoded geoencode(double longitude, double latitude, double distance, GeoArgs.Unit unit);

/**
*
* Decode geohash.
*
* @param geohash geohash containing your longitude/latitude
* @return a list of {@link GeoCoordinates}s (nested multi-bulk) with 3 elements 1: minimum decoded corner, 2: maximum
* decoded corner, 3: averaged center of bounding box.
*/
GeoEncoded geodecode(long geohash);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.lambdaworks.redis.GeoArgs;
import com.lambdaworks.redis.GeoCoordinates;
import com.lambdaworks.redis.GeoWithin;
import com.lambdaworks.redis.GeoEncoded;
import java.util.List;
import java.util.Set;
import com.lambdaworks.redis.RedisFuture;
Expand Down Expand Up @@ -114,40 +113,4 @@ RedisFuture<List<GeoWithin<V>>> georadius(K key, double longitude, double latitu
* returned.
*/
RedisFuture<Double> geodist(K key, V from, V to, GeoArgs.Unit unit);

/**
*
* Encode {@code longitude} and {@code latitude} to highest geohash accuracy.
*
* @param longitude the longitude coordinate according to WGS84
* @param latitude the latitude coordinate according to WGS84
* @return multi-bulk reply with 4 elements 1: the 52-bit geohash integer for your longitude/latitude, 2: The minimum corner
* of your geohash {@link GeoCoordinates}, 3: The maximum corner of your geohash {@link GeoCoordinates}, 4: The
* averaged center of your geohash {@link GeoCoordinates}.
*/
RedisFuture<GeoEncoded> geoencode(double longitude, double latitude);

/**
*
* Encode {@code longitude} and {@code latitude} to highest geohash accuracy.
*
* @param longitude the longitude coordinate according to WGS84
* @param latitude the latitude coordinate according to WGS84
* @param distance distance for geohash accuracy
* @param unit the distance unit
* @return multi-bulk reply with four components 1: the 52-bit geohash integer for your longitude/latitude, 2: The minimum
* corner of your geohash {@link GeoCoordinates}, 3: The maximum corner of your geohash {@link GeoCoordinates}, 4:
* The averaged center of your geohash {@link GeoCoordinates}.
*/
RedisFuture<GeoEncoded> geoencode(double longitude, double latitude, double distance, GeoArgs.Unit unit);

/**
*
* Decode geohash.
*
* @param geohash geohash containing your longitude/latitude
* @return a list of {@link GeoCoordinates}s (nested multi-bulk) with 3 elements 1: minimum decoded corner, 2: maximum
* decoded corner, 3: averaged center of bounding box.
*/
RedisFuture<GeoEncoded> geodecode(long geohash);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.lambdaworks.redis.GeoArgs;
import com.lambdaworks.redis.GeoCoordinates;
import com.lambdaworks.redis.GeoWithin;
import com.lambdaworks.redis.GeoEncoded;
import java.util.List;
import java.util.Set;
import rx.Observable;
Expand Down Expand Up @@ -114,40 +113,4 @@ Observable<GeoWithin<V>> georadius(K key, double longitude, double latitude, dou
* returned.
*/
Observable<Double> geodist(K key, V from, V to, GeoArgs.Unit unit);

/**
*
* Encode {@code longitude} and {@code latitude} to highest geohash accuracy.
*
* @param longitude the longitude coordinate according to WGS84
* @param latitude the latitude coordinate according to WGS84
* @return multi-bulk reply with 4 elements 1: the 52-bit geohash integer for your longitude/latitude, 2: The minimum corner
* of your geohash {@link GeoCoordinates}, 3: The maximum corner of your geohash {@link GeoCoordinates}, 4: The
* averaged center of your geohash {@link GeoCoordinates}.
*/
Observable<GeoEncoded> geoencode(double longitude, double latitude);

/**
*
* Encode {@code longitude} and {@code latitude} to highest geohash accuracy.
*
* @param longitude the longitude coordinate according to WGS84
* @param latitude the latitude coordinate according to WGS84
* @param distance distance for geohash accuracy
* @param unit the distance unit
* @return multi-bulk reply with four components 1: the 52-bit geohash integer for your longitude/latitude, 2: The minimum
* corner of your geohash {@link GeoCoordinates}, 3: The maximum corner of your geohash {@link GeoCoordinates}, 4:
* The averaged center of your geohash {@link GeoCoordinates}.
*/
Observable<GeoEncoded> geoencode(double longitude, double latitude, double distance, GeoArgs.Unit unit);

/**
*
* Decode geohash.
*
* @param geohash geohash containing your longitude/latitude
* @return a list of {@link GeoCoordinates}s (nested multi-bulk) with 3 elements 1: minimum decoded corner, 2: maximum
* decoded corner, 3: averaged center of bounding box.
*/
Observable<GeoEncoded> geodecode(long geohash);
}
37 changes: 0 additions & 37 deletions src/main/java/com/lambdaworks/redis/api/sync/RedisGeoCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.lambdaworks.redis.GeoArgs;
import com.lambdaworks.redis.GeoCoordinates;
import com.lambdaworks.redis.GeoWithin;
import com.lambdaworks.redis.GeoEncoded;
import java.util.List;
import java.util.Set;

Expand Down Expand Up @@ -112,40 +111,4 @@ public interface RedisGeoCommands<K, V> {
* returned.
*/
Double geodist(K key, V from, V to, GeoArgs.Unit unit);

/**
*
* Encode {@code longitude} and {@code latitude} to highest geohash accuracy.
*
* @param longitude the longitude coordinate according to WGS84
* @param latitude the latitude coordinate according to WGS84
* @return multi-bulk reply with 4 elements 1: the 52-bit geohash integer for your longitude/latitude, 2: The minimum corner
* of your geohash {@link GeoCoordinates}, 3: The maximum corner of your geohash {@link GeoCoordinates}, 4: The
* averaged center of your geohash {@link GeoCoordinates}.
*/
GeoEncoded geoencode(double longitude, double latitude);

/**
*
* Encode {@code longitude} and {@code latitude} to highest geohash accuracy.
*
* @param longitude the longitude coordinate according to WGS84
* @param latitude the latitude coordinate according to WGS84
* @param distance distance for geohash accuracy
* @param unit the distance unit
* @return multi-bulk reply with four components 1: the 52-bit geohash integer for your longitude/latitude, 2: The minimum
* corner of your geohash {@link GeoCoordinates}, 3: The maximum corner of your geohash {@link GeoCoordinates}, 4:
* The averaged center of your geohash {@link GeoCoordinates}.
*/
GeoEncoded geoencode(double longitude, double latitude, double distance, GeoArgs.Unit unit);

/**
*
* Decode geohash.
*
* @param geohash geohash containing your longitude/latitude
* @return a list of {@link GeoCoordinates}s (nested multi-bulk) with 3 elements 1: minimum decoded corner, 2: maximum
* decoded corner, 3: averaged center of bounding box.
*/
GeoEncoded geodecode(long geohash);
}
Loading

0 comments on commit bc40d5c

Please sign in to comment.