Boost logo

Geometry :

Subject: Re: [geometry] WKT plotter?
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 2014-10-14 05:26:45


Volker Schöch wrote:
>
> Hi,
>
> Do you have any recommendations for an online WKT plotter, or some
> small utility to run on a Windows machine?
>
> I found
>
> -http://dev.openlayers.org/sandbox/docs/examples/wkt.html
>
> -http://arthur-e.github.io/Wicket/
>
> but they seem to be strictly oriented towards geographic coordinates
> which makes it quirky to use with the kinds of coordinates I have in
> my system (would require some scaling).
>
> The WKT I want to plot is the following (just to give you an idea):
>
> MULTIPOLYGON(((1371 932,1371 789,3171 789,3171 2589,3156 1669,3156
> 1650,2262 1200,1371 932)),((1371 1672,2262 2160,1341 2589,1371
> 2589,1371 1672)))
>
> This multi-polygon does not satisfy is_valid and in fact runs into an
> "Overlay invalid input exception" when used as a parameter to
> difference, but at first glance I cannot see why. I'll plot it on
> paper for this time, but if you have a suggestion for a tool it would
> be very much appreciated.
>

FYI, it's possible to generate SVG files like this:

     namespace bg = boost::geometry;
     typedef typename bg::point_type<G>::type P;
     std::ofstream svg(filename.c_str(), std::ios::trunc);
     bg::svg_mapper<P> mapper(svg, 500, 500);
     mapper.add(g);
     mapper.map(g, "fill-opacity:0.5;fill:rgb(153,204,0);"
         "stroke:rgb(153,204,0);stroke-width:3");

You could open it in any vector-graphic program like Inkscape or a web
browser.

Regards,
Adam



Geometry list run by mateusz at loskot.net