vendredi 4 mai 2018

Postgis + boost::geometry + C++

I have the following wtk:

POLYGON((0 0, 10 0, 10 11, 11 10, 0 10))

In boost::geometry we can get this polygon representation using

boost::geometry::dsv(polygon," "," "," ");

How I can apply postgis st_makevalid function to a boost::geometry polygon? I suppose it something like:

#include "libpq/libpq-fs.h"
#include "../libpq-fe.h"
.
.
.
std::string geom = "POLYGON" + boost::geometry::dsv(multipoly," "," "," ");

res = PQexecParams(conn, "SELECT st_makevalid(geom) FROM ....

I do not want to connect to a data base, I just want to repair a polygon or multipolygon with the postgis function st_makevalid.

Aucun commentaire:

Enregistrer un commentaire