31 #include <QCoreApplication>
48 GisTopology *GisTopology::m_gisfactory = 0;
56 GisTopology::GisTopology() : m_WKTreader(0), m_WKTwriter(0),
57 m_WKBreader(0), m_WKBwriter(0) {
119 QByteArray wkb_data = wkb.toAscii();
120 const unsigned char *footy =
reinterpret_cast<const unsigned char *
> (wkb_data.data());
121 GEOSGeometry *geom = GEOSWKBReader_readHEX(
wkbReader(), footy, wkb.size());
123 GEOSGeometry *geom = GEOSWKBReader_readHEX(
wkbReader(),
124 reinterpret_cast<const unsigned char *> (wkb.toAscii().data()),
128 QString mess =
"Unable convert the given WKB string [" + wkb +
"] to a GEOSGeometry";
146 QByteArray wkt_data = wkt.toAscii();
147 const char *footy = wkt_data.data();
148 GEOSGeometry *geom = GEOSWKTReader_read(
wktReader(), footy);
150 QString mess =
"Unable convert the given WKT string [" + wkt +
"] to a GEOSGeometry";
166 if (!geom)
return (0);
167 return (GEOSGeom_clone(geom));
181 const GEOSPreparedGeometry *ppgeom = GEOSPrepare(geom);
184 "Unable convert the given GEOSGeometry to a GEOSPreparedGeometry",
205 char *wkt_h = GEOSWKTWriter_write(
wktWriter(), geom);
206 QString thegeom = QString::fromAscii(reinterpret_cast<const char *> (wkt_h));
232 unsigned char *wkt_h = GEOSWKBWriter_writeHEX(
wkbWriter(), geom, &length);
233 QString thegeom = QString::fromAscii(reinterpret_cast<const char *> (wkt_h), length);
251 GEOSGeom_destroy(geom);
264 destroy(const_cast<GEOSGeometry *> (geom));
277 GEOSPreparedGeom_destroy(geom);
290 GEOSCoordSeq_destroy(sequence);
303 GEOSFree(const_cast<char *> (geos_text));
316 GEOSFree(const_cast<unsigned char *> (geos_text));
350 vsprintf(buffer, fmt, ap);
367 vsprintf(buffer, fmt, ap);