Isis Developer Reference
GisTopology.h
Go to the documentation of this file.
1#ifndef GisTopology_h
2#define GisTopology_h
8/* SPDX-License-Identifier: CC0-1.0 */
9
10// geos library for types GEOSGeometry, GEOSPreparedGeometry, GEOSCoordSequence,
11// GEOSWKTReader, GEOSWKTWriter, GEOSWKBReader, GEOSWKBWriter
12#include <geos_c.h>
13
14class QString;
15
16namespace Isis {
17
35 public:
36
44
45 static GisTopology *instance();
46
47 GEOSGeometry *geomFromWKB(const QString &wkb);
48 GEOSGeometry *geomFromWKT(const QString &wkt);
49 GEOSGeometry *clone(const GEOSGeometry *geom) const;
50 const GEOSPreparedGeometry *preparedGeometry(const GEOSGeometry *geom) const;
51
52
53 QString wkb(const GEOSGeometry *geom,
54 const Disposition &disp = PreserveGeometry);
55 QString wkt(const GEOSGeometry *geom,
56 const Disposition &disp = PreserveGeometry);
57
58 void destroy(GEOSGeometry *geom) const;
59 void destroy(const GEOSGeometry *geom) const;
60 void destroy(const GEOSPreparedGeometry *ppgeom) const;
61 void destroy(GEOSCoordSequence *sequence) const;
62 void destroy(const unsigned char *geos_text) const;
63 void destroy(const char *geos_text) const;
64
65 private:
68
69 static void dieAtExit();
70
71 void initialize();
72
73 // Initialize and shut down GEOS C API
74 void geosInit();
75 void geosFinish();
76
77 static void notice(const char *fmt, ...);
78 static void error(const char *fmt, ...);
79
80 // Reader/Writer allocations
81 GEOSWKTReader *wktReader();
82 GEOSWKTWriter *wktWriter();
83
84 GEOSWKBReader *wkbReader();
85 GEOSWKBWriter *wkbWriter();
86
87 static GisTopology *m_gisfactory;
88 GEOSWKTReader *m_WKTreader;
89 GEOSWKTWriter *m_WKTwriter;
90 GEOSWKBReader *m_WKBreader;
91 GEOSWKBWriter *m_WKBwriter;
92
93 };
94
95} // namespace Isis
96
97#endif
98
99
This class models GIS topology.
Definition GisTopology.h:34
static GisTopology * instance()
Gets the singleton instance of this class.
Definition GisTopology.cpp:83
Disposition
Enumeration to indicate whether the geometry should be preserved.
Definition GisTopology.h:40
@ DestroyGeometry
Destroy the geometry.
Definition GisTopology.h:41
@ PreserveGeometry
Preserve the geometry.
Definition GisTopology.h:42
GEOSGeometry * geomFromWKT(const QString &wkt)
Reads in the geometry from the given well-known text formatted string.
Definition GisTopology.cpp:128
void destroy(GEOSGeometry *geom) const
Destroys the given GEOS geometry.
Definition GisTopology.cpp:232
QString wkt(const GEOSGeometry *geom, const Disposition &disp=PreserveGeometry)
Writes a well-known text string from the given geometry.
Definition GisTopology.cpp:186
GEOSGeometry * clone(const GEOSGeometry *geom) const
Clones the given GEOSGeometry pointer.
Definition GisTopology.cpp:148
QString wkb(const GEOSGeometry *geom, const Disposition &disp=PreserveGeometry)
Writes a well-known binary string from the given geometry.
Definition GisTopology.cpp:212
const GEOSPreparedGeometry * preparedGeometry(const GEOSGeometry *geom) const
Gets a GEOSPreparedGeometry from the given GEOSGeometry.
Definition GisTopology.cpp:163
GEOSGeometry * geomFromWKB(const QString &wkb)
Reads in the geometry from the given well-known binary formatted string.
Definition GisTopology.cpp:100
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16