How to find duplicate polylines?

948 views
Skip to first unread message

soren

unread,
Dec 1, 2010, 7:32:10 AM12/1/10
to MapInfo-L
Hello!

I need to find duplicate polylines in a network. Is there a way to do
this in a easy way? I can not use the tool "Erase Duplicates" as this
will not work as I need to search for polylines and get the result
into a new table.

Thanks
Soren

Greg Driver

unread,
Dec 1, 2010, 7:55:17 AM12/1/10
to MapInfo-L
Soren,

You should be able to use the 'skimall' tool to detect duplicate
polyline objects. You can download it from the MapInfoTools website
-

http://tinyurl.com/2ga3pha

HTH

Greg Driver.

ktg cad

unread,
Dec 5, 2010, 2:09:04 AM12/5/10
to mapi...@googlegroups.com
Soren,

I easily make them visible on any linework without any macro, just try and see if that will be ok to your data (Not sure if your dataset is too large?) i select all the feature and make it editable, the ones that are duplicate will not be highlighted with selection set, thus we can easily make out that they are duplicated..

Just a manual way..

--
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



--
Kannan Krish
KTG Infotech
Geologic Mapping Services
Skypes- ktgcad
Yahoo-...@yahoo.in

911mapper

unread,
Dec 5, 2010, 4:55:16 PM12/5/10
to MapInfo-L
Soren

You way works only when there is an even number of objects

When there are 3,5,7.....objects then the select shows.

There are several mbx applications for finding duplicates

Eric Blasenheim

unread,
Dec 5, 2010, 5:34:32 PM12/5/10
to MapInfo-L
Since "Enhanced Rendering" option was added in Professional 9.5, the
highlighting XOR problem for even numbers of objects has gone away
(assuming you turn Enhanced Rendering on). The lack of an XOR option
in GDI+ forced us to use a completely different mechanism. In some
cases this could be somewhat slower but you will see the highlighted
objects regardless of overlap. You may want to change your
highlighting style in Preferences as renderinmg the selected objects
in that style looks different than XOR.

Eric Blasenheim
PBBI (MapInfo)
> > Soren- Hide quoted text -
>
> - Show quoted text -

soren

unread,
Dec 6, 2010, 2:58:32 AM12/6/10
to MapInfo-L
Kannan I am nor sure how this is done. If I select all in my window I
have no option to make them editable and yes my dataset is large.
I did use Greg's advice with the "skimall" its a bit of work and
unfortunately it has limits on the size of the dataset (+ 35 000) so I
needed to do many slices of the map.

Now I have 30 datasets with duplicates that I need to turn into one
dataset...

Thanks
Soren
> Yahoo-ktg...@yahoo.in

Peter Horsbøll Møller

unread,
Dec 6, 2010, 5:13:55 AM12/6/10
to mapi...@googlegroups.com
Soren,

How do you define duplicates? If you can define them for instance as objects with the same lenght/area and the same centroid, you can update a new column with these values and use the DeleteDuplicate tool that you'll find in your Tool Manager.

Normally Delete Duplicate works on a alfanumerical value in a column (or more columns? I don't remember).
So for it to work on spatial data, you need to create a column and insert values into this representing your spatial data.
You will probably not be able to insert the entire object as text, so you need to come up with values that can represent the object.   

HTH,

Peter Horsbøll Møller
Pitney Bowes Business Insight - MapInfo


2010/12/6 soren <soren.l...@hotmail.com>

soren

unread,
Dec 6, 2010, 5:44:44 AM12/6/10
to MapInfo-L
Peter,

I'ts a road network that do have duplicates links, I need to find them
and be able to highlight them as a new layer on top. Then later decide
what I should do with them...(removing them or not) some needs to be
removed and some might need to be there. So it can not be done with
automatic. I wish there was a function regarding any size of dataset
that could find objects with same lenght/area and same centroid as you
said and them save this to a new table.

Thanks
Soren

On Dec 6, 11:13 am, Peter Horsbøll Møller <mapinf...@horsboll-
moller.dk> wrote:
> Soren,
>
> How do you define duplicates? If you can define them for instance as objects
> with the same lenght/area and the same centroid, you can update a new column
> with these values and use the DeleteDuplicate tool that you'll find in your
> Tool Manager.
>
> Normally Delete Duplicate works on a alfanumerical value in a column (or
> more columns? I don't remember).
> So for it to work on spatial data, you need to create a column and insert
> values into this representing your spatial data.
> You will probably not be able to insert the entire object as text, so you
> need to come up with values that can represent the object.
>
> HTH,
>
> Peter Horsbøll Møller
> Pitney Bowes Business Insight - MapInfo
>
> 2010/12/6 soren <soren.lindqv...@hotmail.com>

Uffe Kousgaard

unread,
Dec 6, 2010, 6:09:02 AM12/6/10
to mapi...@googlegroups.com
Hi Soren,

It is in fact quite simple. Do as Peter suggests: Create a number of fields that make up what you define as duplicates. Some of them may be calculated length, area, centroid, number of segments or such.

Now run an SQL:

select field1,field2,......, count(*) "mycount"
from yourtable
group by field1, field2,.....
into tmp1

add a unique field dupID to tmp1, such as rowID. You have save tmp1 first as a "real" table, close tmp1 and then open the real table.

select * from tmp1
where mycount>1
into tmp2

select yourtable.ID,tmp2.dupID  from yourtable, tmp2
where yourtable.field1=tmp2.field1 and yourtable.field2=tmp2.field2 ......
into tmp3

You now have a list of ID's from your input table. Of course the ID field need to be unique. This can be linked to your original table.

The steps above are untested, so details may be missing.

Regards
Uffe Kousgaard
Reply all
Reply to author
Forward
0 new messages