Skip to content

Commit

Permalink
add start, end, bloom_filter(string) to Envelope3d.h & remove slice_id
Browse files Browse the repository at this point in the history
  • Loading branch information
Change72 committed May 31, 2023
1 parent ccf1745 commit db5fc21
Showing 1 changed file with 54 additions and 15 deletions.
69 changes: 54 additions & 15 deletions include/geos/geom/Envelope3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <geos/geom/Coordinate3d.h>

#include <string>
#include <utility>
#include <vector>
#include <ostream> // for operator<<
#include <memory>
Expand Down Expand Up @@ -73,7 +74,8 @@ class GEOS_DLL Envelope3d {
, maxy(DoubleNotANumber)
, minz(DoubleNotANumber)
, maxz(DoubleNotANumber)
, slice_id_(-1)
, start_(-1)
, end_(-1)
{};

/** \brief
Expand All @@ -86,9 +88,9 @@ class GEOS_DLL Envelope3d {
* @param z1 the first y-value
* @param z2 the second y-value
*/
Envelope3d(double x1, double x2, double y1, double y2, double z1, double z2, int slice_id = -1)
Envelope3d(double x1, double x2, double y1, double y2, double z1, double z2, int start = -1, int end = -1, std::string bloom_filter = "")
{
init(x1, x2, y1, y2, z1, z2, slice_id);
init(x1, x2, y1, y2, z1, z2, start, end, std::move(bloom_filter));
}

/** \brief
Expand Down Expand Up @@ -206,7 +208,7 @@ class GEOS_DLL Envelope3d {
* @param z1 the first y-value
* @param z2 the second y-value
*/
void init(double x1, double x2, double y1, double y2, double z1, double z2, int slice_id = -1)
void init(double x1, double x2, double y1, double y2, double z1, double z2, int start = -1, int end = -1, std::string bloom_filter = "")
{
if(x1 < x2) {
minx = x1;
Expand All @@ -232,7 +234,10 @@ class GEOS_DLL Envelope3d {
minz = z2;
maxz = z1;
}
slice_id_ = slice_id;

start_ = start;
end_ = end;
bloom_filter_ = bloom_filter;
};

/** \brief
Expand Down Expand Up @@ -263,7 +268,9 @@ class GEOS_DLL Envelope3d {
void setToNull()
{
minx = maxx = miny = maxy = minz = maxz = DoubleNotANumber;
slice_id_ = -1;
start_ = -1;
end_ = -1;
bloom_filter_ = "";
};

/** \brief
Expand All @@ -275,7 +282,8 @@ class GEOS_DLL Envelope3d {
bool isNull(void) const
{
return std::isnan(maxx) && std::isnan(maxy) && std::isnan(maxz) &&
std::isnan(minx) && std::isnan(miny) && std::isnan(minz) && slice_id_ == -1;
std::isnan(minx) && std::isnan(miny) && std::isnan(minz) &&
start_ == -1 && end_ == -1 && bloom_filter_.empty();
};

/** \brief
Expand Down Expand Up @@ -962,18 +970,43 @@ class GEOS_DLL Envelope3d {
GEOS_DLL friend bool
operator< (const Envelope3d& a, const Envelope3d& b);

// get the slice_id
int getSliceId() const
// get the start_
int getStart() const
{
return start_;
}

// set the start_
void setStart(int start)
{
start_ = start;
}

// get the end_
int getEnd() const
{
return end_;
}

// set the end_
void setEnd(int end)
{
end_ = end;
}

// get the bloom_filter_
std::string getBloomFilter() const
{
return slice_id_;
return bloom_filter_;
}

// set the slice_id
void setSliceId(int id)
// set the bloom_filter_
void setBloomFilter(std::string bloom_filter)
{
slice_id_ = id;
bloom_filter_ = std::move(bloom_filter);
}


private:

/** \brief
Expand Down Expand Up @@ -1023,8 +1056,14 @@ class GEOS_DLL Envelope3d {
/// the maximum z-coordinate
double maxz;

/// slice id for each block
int slice_id_;
/// the start
int start_;

/// the end
int end_;

/// bloom filter
std::string bloom_filter_;
};


Expand Down

0 comments on commit db5fc21

Please sign in to comment.