📄 geom.h
字号:
INTERIOR, /** * DE-9IM row index of the boundary of the first geometry and column index of * the boundary of the second geometry. Location value for the boundary of a * geometry. */ BOUNDARY, /** * DE-9IM row index of the exterior of the first geometry and column index of * the exterior of the second geometry. Location value for the exterior of a * geometry. */ EXTERIOR = 2 }; //static const int INTERIOR = 0; //static const int BOUNDARY = 1; //static const int EXTERIOR = 2; //static const int UNDEF = -1; ///Instead of NULL static char toLocationSymbol(int locationValue);};//Operatorsbool operator==(const Coordinate& a, const Coordinate& b);bool operator!=(const Coordinate& a, const Coordinate& b);bool operator==(const Envelope a, const Envelope b);bool operator==(const PrecisionModel a, const PrecisionModel b);bool operator==(const LineSegment a, const LineSegment b);bool lessThen(Coordinate& a,Coordinate& b);bool greaterThen(Geometry *first, Geometry *second);/** * \class GeometryCollection geom.h geos.h * * \brief Represents a collection of heterogeneous Geometry objects. * * Collections of Geometry of the same type are * represented by GeometryCollection subclasses MultiPoint, * MultiLineString, MultiPolygon. */class GeometryCollection : public Geometry{public: GeometryCollection(const GeometryCollection &gc); /** \brief * Construct a GeometryCollection with the given GeometryFactory. * Will keep a reference to the factory, so don't * delete it until al Geometry objects referring to * it are deleted. * Will take ownership of the Geometry vector. * * @param newGeoms * The <code>Geometry</code>s for this * <code>GeometryCollection</code>, * or <code>null</code> or an empty array to * create the empty geometry. * Elements may be empty <code>Geometry</code>s, * but not <code>null</code>s. * * If construction succeed the created object will take * ownership of newGeoms vector and elements. * * If construction fails "IllegalArgumentException *" * is thrown and it is your responsibility to delete newGeoms * vector and content. * * @param newFactory the GeometryFactory used to create this geometry */ GeometryCollection(vector<Geometry *> *newGeoms, const GeometryFactory *newFactory); virtual Geometry *clone() const; virtual ~GeometryCollection(); /** * \brief * Collects all coordinates of all subgeometries into a * CoordinateSequence. * * Note that the returned coordinates are copies, so * you want be able to use them to modify the geometries * in place. Also you'll need to delete the CoordinateSequence * when finished using it. * * @return the collected coordinates * */ virtual CoordinateSequence* getCoordinates() const; virtual bool isEmpty() const; /** * \brief * Returns the maximum dimension of geometries in this collection * (0=point, 1=line, 2=surface) */ virtual int getDimension() const; virtual Geometry* getBoundary() const; /** * \brief * Returns the maximum boundary dimension of geometries in * this collection. */ virtual int getBoundaryDimension() const; virtual int getNumPoints() const; virtual string getGeometryType() const; virtual GeometryTypeId getGeometryTypeId() const; virtual bool isSimple() const; virtual bool equalsExact(const Geometry *other, double tolerance) const; virtual void apply_ro(CoordinateFilter *filter) const; virtual void apply_rw(CoordinateFilter *filter); virtual void apply_ro(GeometryFilter *filter) const; virtual void apply_rw(GeometryFilter *filter); virtual void apply_ro(GeometryComponentFilter *filter) const; virtual void apply_rw(GeometryComponentFilter *filter); virtual void normalize(); virtual const Coordinate* getCoordinate() const; /// Returns the total area of this collection virtual double getArea() const; /// Returns the total length of this collection virtual double getLength() const; /// Returns the number of geometries in this collection virtual int getNumGeometries() const; /// Returns a pointer to the nth Geometry int this collection virtual const Geometry* getGeometryN(int n) const;protected: vector<Geometry *>* geometries; virtual Envelope* computeEnvelopeInternal() const; virtual int compareToSameClass(const Geometry *gc) const;private:#ifdef INT64_CONST_IS_I64 static const int64 serialVersionUID = -5694727726395021467I64;#else static const int64 serialVersionUID = -5694727726395021467LL;#endif };class GeometryCollectionIterator {public: GeometryCollectionIterator(); GeometryCollectionIterator(const GeometryCollectionIterator &gci); GeometryCollectionIterator(const GeometryCollection *newParent); virtual ~GeometryCollectionIterator(); bool hasNext() const; const Geometry *next(); void remove(); //Not implementedprivate: const GeometryCollection* parent; bool atStart; int max; int index; GeometryCollectionIterator* subcollectionIterator;};/** * \class Point geom.h geos.h * \brief Basic implementation of Point. */class Point : public Geometry{public: /** * \brief * Creates a Point taking ownership of the given CoordinateSequence * (must have 1 element) * * @param newCoords * contains the single coordinate on which to base this * <code>Point</code> or <code>null</code> to create * the empty geometry. * * @param newFactory the GeometryFactory used to create this geometry */ Point(CoordinateSequence *newCoords, const GeometryFactory *newFactory); Point(const Point &p); virtual ~Point(); Geometry *clone() const; CoordinateSequence* getCoordinates(void) const; int getNumPoints() const; bool isEmpty() const; bool isSimple() const; //bool isValid() const; /// Returns point dimension (0) int getDimension() const; /// Returns Dimension::False (Point has no boundary) int getBoundaryDimension() const; /// Returns an EMPTY Geometry. Geometry* getBoundary() const; double getX() const; double getY() const; const Coordinate* getCoordinate() const; string getGeometryType() const; virtual GeometryTypeId getGeometryTypeId() const; void apply_ro(CoordinateFilter *filter) const; void apply_rw(CoordinateFilter *filter); void apply_ro(GeometryFilter *filter) const; void apply_rw(GeometryFilter *filter); void apply_rw(GeometryComponentFilter *filter); void apply_ro(GeometryComponentFilter *filter) const; bool equalsExact(const Geometry *other, double tolerance) const; void normalize(void) { };protected: Envelope* computeEnvelopeInternal() const; int compareToSameClass(const Geometry *p) const;private: /** * The <code>Coordinate</code> wrapped by this <code>Point</code>. */ CoordinateSequence *coordinates;#ifdef INT64_CONST_IS_I64 static const int64 serialVersionUID = 4902022702746614570I64;#else static const int64 serialVersionUID = 4902022702746614570LL;#endif };/** * \class LineString geom.h geos.h * \brief Basic implementation of LineString. */class LineString: public Geometry {public: LineString(const LineString &ls); /// Constructs a LineString taking ownership the given CoordinateSequence. LineString(CoordinateSequence *pts, const GeometryFactory *newFactory); virtual ~LineString(); virtual Geometry *clone() const; virtual CoordinateSequence* getCoordinates() const; /// Returns a read-only pointer to internal CoordinateSequence const CoordinateSequence* getCoordinatesRO() const; virtual const Coordinate& getCoordinateN(int n) const; /// Returns line dimension (1) virtual int getDimension() const; /** * \brief * Returns Dimension::False for a closed LineString, * 0 otherwise (LineString boundary is a MultiPoint) */ virtual int getBoundaryDimension() const; /** * \brief * Returns a MultiPoint. * Empty for closed LineString, a Point for each vertex otherwise. */ virtual Geometry* getBoundary() const; virtual bool isEmpty() const; virtual int getNumPoints() const; virtual Point* getPointN(int n) const; virtual Point* getStartPoint() const; virtual Point* getEndPoint() const; virtual bool isClosed() const; virtual bool isRing() const; virtual string getGeometryType() const; virtual GeometryTypeId getGeometryTypeId() const; virtual bool isSimple() const; virtual bool isCoordinate(Coordinate& pt) const; virtual bool equalsExact(const Geometry *other, double tolerance) const; virtual void apply_rw(CoordinateFilter *filter); virtual void apply_ro(CoordinateFilter *filter) const; virtual void apply_rw(GeometryFilter *filter); virtual void apply_ro(GeometryFilter *filter) const; virtual void apply_rw(GeometryComponentFilter *filter); virtual void apply_ro(GeometryComponentFilter *filter) const; /// Normalize a LineString. virtual void normalize(); //was protected virtual int compareToSameClass(const Geometry *ls) const; virtual int compareTo(const LineString *ls) const; virtual const Coordinate* getCoordinate() const; virtual double getLength() const;protected: virtual Envelope* computeEnvelopeInternal() const; CoordinateSequence* points;private:#ifdef INT64_CONST_IS_I64 static const int64 serialVersionUID = 3110669828065365560I64;#else static const int64 serialVersionUID = 3110669828065365560LL;#endif };/** * \class LinearRing geom.h geos.h * * \brief Basic implementation of <code>LinearRing</code>. * * The first and last point in the coordinate sequence must be equal. * Either orientation of the ring is allowed. * A valid ring must not self-intersect. * */class LinearRing : public LineString{public: LinearRing(const LinearRing &lr); /** * \brief Constructs a <code>LinearRing</code> with the given points. * * @param points points forming a closed and simple linestring, or * <code>null</code> or an empty array to create the empty geometry. * This array must not contain <code>null</code> elements. * If not null LinearRing will take ownership of points. * * @param newFactory the GeometryFactory used to create this geometry * */ LinearRing(CoordinateSequence* points, const GeometryFactory *newFactory); virtual ~LinearRing(); bool isSimple() const; string getGeometryType() const; virtual GeometryTypeId getGeometryTypeId() const; bool isClosed() const; void setPoints(CoordinateSequence* cl);private:#ifdef INT64_CONST_IS_I64 static const int64 serialVersionUID = -4261142084085851829I64;#else static const int64 serialVersionUID = -4261142084085851829LL;#endif void validateConstruction();};/** * \class Polygon geom.h geos.h * * \brief Represents a linear polygon, which may include holes. * * The shell and holes of the polygon are represented by {@link LinearRing}s. * In a valid polygon, holes may touch the shell or other holes at a single point. * However, no sequence of touching holes may split the polygon into two pieces. * The orientation of the rings in the polygon does not matter. * <p> * The shell and holes must conform to the assertions specified in the <A * HREF="http://www.opengis.org/techno/specs.htm">OpenGIS Simple Features * Specification for SQL</A> . * */class Polygon: public Geometry{public: Polygon(const Polygon &p); virtual ~Polygon(); /** * Constructs a <code>Polygon</code> with the given exterior * and interior boundaries. * * @param newShell the outer boundary of the new Polygon, * or <code>null</code> or an empty * LinearRing if the empty geometry * is to be created. * * @param newHoles the LinearRings defining the inner * boundaries of the new Polygon, or * null or empty LinearRing * if the empty geometry is to be created. * * @param newFactory the GeometryFactory used to create this geometry * * Polygon will take ownership of Shell and Holes LinearRings */ Polygon(LinearRing *newShell, vector<Geometry *> *newHoles, const GeometryFactory *newFactory); virtual Geometry *clone() const; CoordinateSequence* getCoordinates() const; int getNumPoints() const; /// Returns surface dimension (2) int getDimension() const; /// Returns 1 (Polygon boundary is a MultiLineString) int getBoundaryDimension() const; /** * \brief * Returns a MultiLineString. * One LineString for the shell and one for each hole. * Empty for an empty Polygon. */ Geometry
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -