Opened 9 years ago

Closed 9 years ago

#9217 closed Patches (fixed)

Impose closed rings of polygon in WKT output

Reported by: Mateusz Loskot Owned by: Mateusz Loskot
Milestone: To Be Determined Component: geometry
Version: Boost Development Trunk Severity: Problem
Keywords: geometry, wkt Cc:

Description

The problem with wkt io thread reports:

I am using read_wkt to read wkt polygons and wkt to convert them to string but i have some problems. I though that wkt polygons should have the last point equal to the first one ; however in my model polygons are not closed. The function read_wkt and wkt do not handle the last point, is this normal or did i missed something ?

Here is a patch with attempt to correct this problem in the WKT streamer.

It basically imposes last point to be equal to the first one, regardless if a polygon is modelled with closed or non-closed rings.

Attachments (2)

boost-geometry-wkt-close-ring.patch (2.7 KB ) - added by Mateusz Loskot 9 years ago.
Patch to impose last point to be equal to the first one in WKT for polygons
close_polygon_wkt.cpp (1.2 KB ) - added by Mateusz Loskot 9 years ago.
Simple test to illustrate effects of the patch

Download all attachments as: .zip

Change History (4)

by Mateusz Loskot, 9 years ago

Patch to impose last point to be equal to the first one in WKT for polygons

comment:1 by Mateusz Loskot, 9 years ago

Summary: EnsureImpose closed rings of polygon in WKT output

by Mateusz Loskot, 9 years ago

Attachment: close_polygon_wkt.cpp added

Simple test to illustrate effects of the patch

comment:2 by Mateusz Loskot, 9 years ago

Resolution: fixed
Status: newclosed

Applied in trunk r86233

Note: See TracTickets for help on using tickets.