Skip to content

Commit

Permalink
findbugs fix and some formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rfecher committed Apr 14, 2017
1 parent bc3beb9 commit 066e050
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,10 @@ public void notify(
final double longitude = pt.getLocation().longitude;
final double elevation = pt.getLocation().elevation;

final byte[] geometry = wkbWriter.write(GeometryUtils.GEOMETRY_FACTORY.createPoint(new Coordinate(
longitude,
latitude)));
final byte[] geometry = wkbWriter.write(GeometryUtils.GEOMETRY_FACTORY
.createPoint(new Coordinate(
longitude,
latitude)));

double detailLatitude = Stanag4676EventWritable.NO_DETAIL;
double detailLongitude = Stanag4676EventWritable.NO_DETAIL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import mil.nga.giat.geowave.core.geotime.store.dimension.GeometryWrapper;
import mil.nga.giat.geowave.core.geotime.store.dimension.Time;
import mil.nga.giat.geowave.core.index.ByteArrayId;
import mil.nga.giat.geowave.core.index.FloatCompareUtils;
import mil.nga.giat.geowave.core.index.StringUtils;
import mil.nga.giat.geowave.core.ingest.GeoWaveData;
import mil.nga.giat.geowave.core.ingest.IngestPluginBase;
Expand Down Expand Up @@ -326,7 +327,11 @@ public CloseableIterator<GeoWaveData<Object>> toGeoWaveData(

ptBuilder.add(geometry);

if (event.DetailLatitude.get() != Stanag4676EventWritable.NO_DETAIL && event.DetailLongitude.get() != Stanag4676EventWritable.NO_DETAIL) {
if (!FloatCompareUtils.checkDoublesEqual(
event.DetailLatitude.get(),
Stanag4676EventWritable.NO_DETAIL) && !FloatCompareUtils.checkDoublesEqual(
event.DetailLongitude.get(),
Stanag4676EventWritable.NO_DETAIL)) {
detail_coord_sequence.add(event.DetailLongitude.get());
detail_coord_sequence.add(event.DetailLatitude.get());
}
Expand All @@ -335,7 +340,11 @@ public CloseableIterator<GeoWaveData<Object>> toGeoWaveData(
Double detailLongitude = null;
Double detailElevation = null;
Geometry detailGeometry = null;
if (event.DetailLatitude.get() != Stanag4676EventWritable.NO_DETAIL && event.DetailLongitude.get() != Stanag4676EventWritable.NO_DETAIL) {
if (!FloatCompareUtils.checkDoublesEqual(
event.DetailLatitude.get(),
Stanag4676EventWritable.NO_DETAIL) && !FloatCompareUtils.checkDoublesEqual(
event.DetailLongitude.get(),
Stanag4676EventWritable.NO_DETAIL)) {
detailLatitude = event.DetailLatitude.get();
detailLongitude = event.DetailLongitude.get();
detailElevation = event.DetailElevation.get();
Expand Down Expand Up @@ -561,7 +570,15 @@ else if (event.EventType.get() == 4) {
Double lastEventDetailLatitude = null;
Double lastEventDetailLongitude = null;

if (firstEvent.DetailLatitude.get() != Stanag4676EventWritable.NO_DETAIL && firstEvent.DetailLongitude.get() != Stanag4676EventWritable.NO_DETAIL && lastEvent.DetailLatitude.get() != Stanag4676EventWritable.NO_DETAIL && lastEvent.DetailLongitude.get() != Stanag4676EventWritable.NO_DETAIL) {
if (!FloatCompareUtils.checkDoublesEqual(
firstEvent.DetailLatitude.get(),
Stanag4676EventWritable.NO_DETAIL) && !FloatCompareUtils.checkDoublesEqual(
firstEvent.DetailLongitude.get(),
Stanag4676EventWritable.NO_DETAIL) && !FloatCompareUtils.checkDoublesEqual(
lastEvent.DetailLatitude.get(),
Stanag4676EventWritable.NO_DETAIL) && !FloatCompareUtils.checkDoublesEqual(
lastEvent.DetailLongitude.get(),
Stanag4676EventWritable.NO_DETAIL)) {
firstEventDetailLatitude = firstEvent.DetailLatitude.get();
firstEventDetailLongitude = firstEvent.DetailLongitude.get();
lastEventDetailLatitude = lastEvent.DetailLatitude.get();
Expand Down

0 comments on commit 066e050

Please sign in to comment.