Skip to content

Commit

Permalink
Fix the nullpointer bug and OutOfMemory constructor issue (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiayuasu committed Aug 26, 2018
1 parent 10aba35 commit c79054e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 29 deletions.
Expand Up @@ -188,11 +188,7 @@ public abstract class VisualizationOperator
* The generate vector image.
*/
protected boolean generateVectorImage = false;

/**
* The count matrix.
*/
protected List<Tuple2<Integer, Double>> countMatrix;


/**
* The distributed raster count matrix.
Expand Down Expand Up @@ -335,20 +331,12 @@ public VisualizationOperator(int resolutionX, int resolutionY, Envelope datasetB
/*
* Variables below control how to initialize a raster image
*/
this.countMatrix = new ArrayList<Tuple2<Integer, Double>>();
this.colorizeOption = colorizeOption;
this.partitionX = partitionX;
this.partitionY = partitionY;
this.partitionIntervalX = this.resolutionX / this.partitionX;
this.partitionIntervalY = this.resolutionY / this.partitionY;
this.parallelPhotoFilter = parallelPhotoFilter;
int serialId = 0;
for (int j = 0; j < resolutionY; j++) {
for (int i = 0; i < resolutionX; i++) {
countMatrix.add(new Tuple2<Integer, Double>(serialId, new Double(0.0)));
serialId++;
}
}
logger.info("[GeoSparkViz][Constructor][Stop]");
}

Expand Down
17 changes: 1 addition & 16 deletions viz/src/main/java/org/datasyslab/geosparkviz/utils/Pixel.java
Expand Up @@ -178,15 +178,7 @@ public int getResolutionY()
@Override
public boolean equals(Object o)
{

/*
Pixel anotherObject = (Pixel) o;
if(this.hashCode()==anotherObject.hashCode()&&this.getCurrentPartitionId()==anotherObject.getCurrentPartitionId()&&this.isDuplicate()==anotherObject.isDuplicate())
{
return true;
}
else return false;
*/
if (o == null || !(o instanceof Pixel)) return false;
return this.hashCode() == o.hashCode();
}

Expand All @@ -209,13 +201,6 @@ public String toString()
@Override
public int hashCode()
{
/*
int result = 17;
result = 31 * result + this.getX();
result = 31 * result + this.getY();
//result = 31 * result + this.getCurrentPartitionId();
return result;
*/
int id = -1;
try {
id = RasterizationUtils.Encode2DTo1DId(resolutionX, resolutionY, x, y);
Expand Down

0 comments on commit c79054e

Please sign in to comment.