Get the middle line of the River polygon

2,690 views
Skip to first unread message

TamasPiszak

unread,
Apr 27, 2011, 8:40:08 AM4/27/11
to MapInfo-L
Hi group!
Is it possible in Mapinfo somehow to get the middle line of a poligon
feature?

Thanks in advance

InterRob

unread,
Apr 28, 2011, 3:46:38 PM4/28/11
to mapi...@googlegroups.com
There is no easy solution to this. In fact, there is no solid definition of a "middle line" of a polygon, either...

Anyway, one approach would be to find a linear trend line (e.g. least squares), taking all polygon nodes as a point cloud... 

Good luck!
Rob

2011/4/27 TamasPiszak <piszak...@gmail.com>
--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en

Davidll

unread,
Apr 28, 2011, 8:33:08 PM4/28/11
to MapInfo-L
FME has a 'Centre Line Replacer' transformer/function. Of course you
would have to buy FME! (you can get a trial version).

The transformer notes include the following if you have any ambitions
to implement something yourself:

The algorithm used to calculate the angular bisector network for the
Medial Axis or Straight Skeleton mode was designed by Petr Felkel and
Stepan Obdrzalek and is provided as-is, with no warranties. The paper
outlining this algorithm is referenced in Straight Skeleton
Implementation, 1998, "SCCG 98: Proceedings of the 14th Spring
Conference on Computer Graphics," pages 210-218, ISBN 80-223-0837-4
(Publisher: Comenius University, Bratislava).

Cheers
David L

Bill Thoen

unread,
Apr 28, 2011, 10:24:22 PM4/28/11
to mapi...@googlegroups.com
On 4/28/2011 1:46 PM, InterRob wrote:
> There is no easy solution to this. In fact, there is no solid
> definition of a "middle line" of a polygon, either...
>
> Anyway, one approach would be to find a linear trend line (e.g. least
> squares), taking all polygon nodes as a point cloud...
>
> Good luck!
> Rob
>
> 2011/4/27 TamasPiszak <piszak...@gmail.com
> <mailto:piszak...@gmail.com>>

>
> Hi group!
> Is it possible in Mapinfo somehow to get the middle line of a poligon
> feature?
> Making a Centerline from a polygon
>
If you need a "mathematically pure" solution, then this a hard problem,
but I believe a solution is shown in most Computational Geometry books.
If you just need "looks right", then here's a quick trick. This is
easier to show than explain so I've included a small map which should
appear on the right.

This is done using 10-mile buffers. You make a buffer around the
polyline of your polygon, then run Convert to Polylines on the buffer,
then run Disaggregate on the parallel lines and repeat until your
central polylines are essentially linear. It's relatively easy to
program in MapBasic if your Jommetry-fu is decent, because there are a
couple of tough spots.

As you get closer to the center the polylines get more and more linear,
so the final step is to thread your center line through the most
end-point like point in the center ring, and then I added a smoothing
operation to the line.


--
*Bill Thoen*
GISnet - www.gisnet.com
303-786-9961

Bill Thoen

unread,
Apr 28, 2011, 10:28:01 PM4/28/11
to mapi...@googlegroups.com
2nd try on the centerline map.

--
Bill Thoen
GISnet - www.gisnet.com
303-786-9961

Javier Valencia

unread,
Apr 28, 2011, 11:16:20 PM4/28/11
to mapi...@googlegroups.com

The graphs looks more like middle of the” lake” rather than the “river.” A river contour would look more like this:

 

 

Best regards,

 

Javier Valencia, PE

President

Valencia Technology Group, LLC

14315 S. Twilight Ln.

Suite #14

Olathe, Kansas 66062-4571

913-829-0888 Office

913-915-3137 Cell

913-649-2904 Fax

javier....@vtgonline.com

 

Visit us at: http://www.vtgonline.com

 

Confidentiality Notice

This electronic mail (including any attachments) may contain information that is privileged, confidential, and/or otherwise protected from disclosure to anyone other than its intended recipient(s). Any dissemination or use of this electronic email or its contents (including any attachments) by persons other than the intended recipient(s) is strictly prohibited. If you have received this message in error, please notify us immediately at 913-829-0888 or by reply email so that we may correct our internal records. Please then delete the original message (including any attachments) in its entirety.

 


--
image001.jpg
image002.jpg
image003.png
image004.jpg

TamasPiszak

unread,
Apr 29, 2011, 1:50:08 AM4/29/11
to MapInfo-L
Thank you all of you!
This project was quite urgent and the length of the river was only
some hundred kilometer, so we just drew it, but the informations you
give was quite interresting.
I will read some paper about it!
Thanks again

On ápr. 29, 05:16, "Javier Valencia" <javier.valen...@vtgonline.com>
wrote:
> The graphs looks more like middle of the" lake" rather than the "river." A
> river contour would look more like this:
>
> Best regards,
>
> Javier Valencia, PE
> President
>
> Valencia Technology Group, LLC
> 14315 S. Twilight Ln.
> Suite #14
> Olathe, Kansas 66062-4571
> 913-829-0888 Office
> 913-915-3137 Cell
> 913-649-2904 Fax
>  <mailto:javier.valen...@vtgonline.com> javier.valen...@vtgonline.com
>
> Visit us at:  <http://www.vtgonline.com/>http://www.vtgonline.com
>
> Confidentiality Notice
> This electronic mail (including any attachments) may contain information
> that is privileged, confidential, and/or otherwise protected from disclosure
> to anyone other than its intended recipient(s). Any dissemination or use of
> this electronic email or its contents (including any attachments) by persons
> other than the intended recipient(s) is strictly prohibited. If you have
> received this message in error, please notify us immediately at 913-829-0888
> or by reply email so that we may correct our internal records. Please then
> delete the original message (including any attachments) in its entirety.
>
>   _____  
>
> From:mapi...@googlegroups.com[mailto:mapi...@googlegroups.com]On
> Behalf Of Bill Thoen
> Sent: Thursday, April 28, 2011 9:28 PMTo:mapi...@googlegroups.com
> Subject: Re: [MI-L] Get the middle line of the River polygon
>
> 2nd try on the centerline map.
> --
> Bill Thoen
> GISnet -www.gisnet.com
> 303-786-9961
> --
> You received this message because you are subscribed to the
> Google Groups "MapInfo-L" group.To post a message to this group, sendemail tomap...@googlegroups.com
> To unsubscribe from this group, go to:http://groups.google.com/group/mapinfo-l/subscribe?hl=en
> For more options, information and links to MapInfo resources (searching
> archives, feature requests, to visit our Wiki, visit the Welcome page athttp://groups.google.com/group/mapinfo-l?hl=en
>
>  image001.jpg
> 34KMegtekintésNézet
>
>  image002.jpg
> 1KMegtekintésNézet
>
>  image003.png
> 14KMegtekintésNézet
>
>  image004.jpg
> 45KMegtekintésNézet

Gamiz Ribelles, Sergi (Regsa)

unread,
Apr 29, 2011, 5:07:42 AM4/29/11
to mapi...@googlegroups.com
Hi, Tamas Piszak,

Many months ago, I posted the same question and I received two tools: they are still very rough, but they solve enough depending on your scale. I prefer Simple_Region_Center_Line 3.MBX for roads, streams, and similars with 1-10 m wide. They don't work well enough for regions 100 m wide or grater.
  • Simple_Region_Center_Line_3.MBX is the third attempt from Tony Pilkington.  (I have the source code also, but I don't share it with you without the author's permission)
  • Trace region.MBX cames from the author of http://mapbasic.net/ . It works worse
in Center line.GIF I show the results of Simple_Region_Center_Line_3.MBX  with roads, tracks and parcels (center line red, parcels blue).
As shown, it works fine with roads, but sometimes you'll need to edit it. Application on parcels may produce abnormal results
Hope this helps
 
Sergi Gàmiz Ribelles

-----Mensaje original-----
De: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] En nombre de TamasPiszak
Enviado el: miércoles, 27 de abril de 2011 14:40
Para: MapInfo-L
Asunto: [MI-L] Get the middle line of the River polygon
Simple_Region_Centre_Line_3.MBX
trace region.MBX
Center line.gif

Andy Harfoot

unread,
May 5, 2011, 11:52:58 AM5/5/11
to mapi...@googlegroups.com
In 2008 I used the FME Centre Line Replacer in Straight Skeleton mode,
coupled with some MapBasic, to automate the extraction of a centreline
for the majority of the rivers in Scotland from the Ordnance Survey's
MasterMap product, so I can confirm that this approach works quite well.
On a few occasions the algorithm generated strange results that had to
be manually fixed, I suspect these were due to coordinate rounding errors.

Cheers,

Andy


--
Andy Harfoot

GeoData Institute
University of Southampton
Southampton
SO17 1BJ

Tel: +44 (0)23 8059 2719
Fax: +44 (0)23 8059 2849

www.geodata.soton.ac.uk

---------------------------------------
For further information about GeoData's
Training Courses, please visit:
www.gis-train.com
---------------------------------------

Reply all
Reply to author
Forward
0 new messages