smooth polygon

926 views
Skip to first unread message

Omar

unread,
Apr 3, 2007, 11:07:49 AM4/3/07
to MapInfo-L
Hi,
I see that I can smooth a polyline,
can I do it to a polygon in order to prevenet sharp edges?
is it possible to create a raster from a polygon layer and then do
some smooth to it?
Thanks

Mats Elfström

unread,
Apr 4, 2007, 9:30:46 AM4/4/07
to mapi...@googlegroups.com
Hi Omar!

Due to the weak topology in MapInfo, the line kind smoothing of
polygons is not feasible.
Because a polygon does not 'know' its neighbour, a smoothing of two
adjacent polygons would result in intertwining lines totally out of
control.

Mats.E

2007/4/3, Omar <ofer...@gmail.com>:

Jacques D. Paris

unread,
Apr 4, 2007, 10:05:37 AM4/4/07
to mapi...@googlegroups.com
The solution I have advanced in the last years was to brake all the polygons
into single common border segments (with my reg2plines); smooth those plines
with whatever tool you wish; recreate regions from the smooth plines (with
pline2reg).

All topological errors due to overlapping independently-smoothed plines are
avoided. Reg2plines generates a table with the single common border segments
having as attributes the region IDs on both sides (special code for
"exterior"). These codes/IDs are used by pline2reg to recreate the regions.

All that on www.paris-pc-gis.com/download.htm

Jacques Paris

Mats Elfström

unread,
Apr 4, 2007, 10:23:19 AM4/4/07
to mapi...@googlegroups.com
Hi Jacques!

Nice to hear from you - it has been a while.
Your solution is of course the best under the circumstances. I was on
the verge of describing the manual process to do that, but decided not
to since it quickly turned complicated. The crucial point is to
maintain the attributes which you have taken care of.
Also, I think Omar referred to the display smoothing of polylines, the
one that has little to do with the actual coordinates of the object.
Your scheme implies a smoothing where coordinate points are added or
removed as needed to create a smooth line (how do you define that
btw?).

Regards, Mats.E


2007/4/4, Jacques D. Paris <jac...@paris-pc-gis.com>:

Jacques D. Paris

unread,
Apr 4, 2007, 10:37:00 AM4/4/07
to mapi...@googlegroups.com
Yes, Mats, I am still around, but I am mostly a "distant eye" on what is
happening.

The process you described is I think called "thinning"; with the tools I
know, it does not add nodes, just remove some according to selected
criteria.

If Omar wants to show "smoothed-at-display-time polylines", he can simply
add the table with the common-border segments and hide the borders of the
original regions. One problem, if those regions have any fill, it will not
follow the "smoothed" plines.

If think that there is one tool to convert plines into smoothed lines, a
hard coding solution to what MI does on the fly at display time.

Keep well

Jacques

Uffe Kousgaard

unread,
Apr 4, 2007, 10:52:02 AM4/4/07
to mapi...@googlegroups.com
I wrote some code 3 years ago for smoothing polygons, by adding more nodes:
http://www.routeware.dk/download/smooth_poly3.zip

It is unpolished and for mapbasic users really, so don't expect too much in
terms of easy-to-use. But anyone can run the mbx and see the results
immediately.

The mapbasic code is included, but not the code for the DLL which does the
hard work.

Regards
Uffe Kousgaard

Reply all
Reply to author
Forward
0 new messages