Programmatically defining which overlapping object appears on top

36 views
Skip to first unread message

Nick

unread,
Aug 11, 2023, 12:52:37 PM8/11/23
to MapInfo-L
Hello,

I have datasets where multiple polygons will either intersect or be directly underneath each other.  The objects are different colors; however, have the same fill patterns (must be that way); therefore, sometimes when never data is appended, it is unable to be seen because it sits directly underneath the already existing data in the .TAB file.

Is there a way to tell MapInfo that you wish to have the latest uploaded data always sit on top of the already existing data? 

I don't believe there was the last time I researched this; however, it has been a while, so I figured I'd reach out and see if anyone knew if this was possible now in 2023?

Thanks for any help in advance.
Nick

Uffe Kousgaard

unread,
Aug 11, 2023, 5:31:59 PM8/11/23
to mapi...@googlegroups.com
Hi Nick,

Rumour has that it is possible if you run a query on your table, sorted by the sequence you want the objects to be drawn and then use that query on your map.

Regards
Uffe Kousgaard
--
--
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

---
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapinfo-l+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapinfo-l/1dd1c87d-0f2a-42c9-b0a4-e40fc358ac37n%40googlegroups.com.

Peter Horsbøll Møller

unread,
Aug 13, 2023, 12:09:21 PM8/13/23
to mapi...@googlegroups.com

The rumor has been written down in a #MapInfoMonday post:

https://community.precisely.com/discussion/mapinfo-monday-how-can-i-control-the-drawing-order-of-a-layer

 

Peter

 

Peter Horsbøll Møller
Principal Sales Engineer - Distinguished Engineer

 

From: mapi...@googlegroups.com <mapi...@googlegroups.com> On Behalf Of Uffe Kousgaard
Sent: 11. august 2023 23:32
To: mapi...@googlegroups.com
Subject: Re: [MI-L] Programmatically defining which overlapping object appears on top

 

This message originated Externally. Use proper judgement and caution with attachments, links, or responses.

 

Nick

unread,
Aug 14, 2023, 10:06:48 AM8/14/23
to MapInfo-L
Peter,

Thank you for the document link you sent.

Would these same methods apply when using MapXtreme 9.0 or higher?  The application that I am using does have a "DateCreated" field which is a date/time field that I could try to sort by and see if I can get this to work.


Peter Horsbøll Møller

unread,
Aug 14, 2023, 10:32:31 AM8/14/23
to mapi...@googlegroups.com

Yeah, that should work too, I’d think

You may have some additional options using MapXtreme.

 

I’m not that well-versed in MapXtreme though.

 

Peter

 

Peter Horsbøll Møller
Principal Sales Engineer - Distinguished Engineer

 

From: mapi...@googlegroups.com <mapi...@googlegroups.com> On Behalf Of Nick
Sent: 14. august 2023 16:07
To: MapInfo-L <mapi...@googlegroups.com>
Subject: Re: [MI-L] Programmatically defining which overlapping object appears on top

 

This message originated Externally. Use proper judgement and caution with attachments, links, or responses.

 

Peter,

 

Thank you for the document link you sent.

 

Would these same methods apply when using MapXtreme 9.0 or higher?  The application that I am using does have a "DateCreated" field which is a date/time field that I could try to sort by and see if I can get this to work.

 

 

--

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

---
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapinfo-l+...@googlegroups.com.

Nick

unread,
Aug 14, 2023, 3:19:47 PM8/14/23
to MapInfo-L
Peter,

I was able to do some testing in MapInfo Pro v 2021.1 and I had success sorting by my "DateCreated" field. 

When I did ASC, the objects that I have appeared one way, and when I did DESC sort order, the selected objects appeared on top.

This is great to know; however, now I have another question.....

There is no way to be able to do this based on a generic text field is there?  For example, if I had a data column that was a string that had say "A", "B", and "C".

If I always wanted "B" to be on top, an ORDER BY clause would not be able to handle that; therefore, is there any other way to make that possibly happen?  So, instead of the column name "DateCreated", actually having the value of the column driving the display of the objects on the map?

I hope this makes sense.   As always, thanks in advance, for your contributions to this forum.

Peter Horsbøll Møller

unread,
Aug 15, 2023, 1:04:36 AM8/15/23
to mapi...@googlegroups.com

Hi Nick

 

If it’s just one value you want to have on top, you can add an expression making sure that value is sorted last in your query.

 

Here’s my example:

My table has a column BYGN_UUID where some records don’t have a value.

I want these to appear on top of other records with a value.

 

I created an expression to assign the value 0 to the records with no values, and the other records I assign the value 1.

 

This the expression I add to the projection list in my Select statement:

Str$(IIf(b.BYGN_UUID = "", 0, 1)) As "OrderBy"

 

I use the IIf() function to compare the values in the column, and then return either 1 or 0 depending on the value.

I name this new column OrderBy and sort my query descending based on this column

 

Select b.*, Str$(IIf(b.BYGN_UUID = "", 0, 1)) As "OrderBy"

From Building_Rooftops As "b"

Order By OrderBy Desc

Into Selection

 

Cheers

Peter

 

Peter Horsbøll Møller
Principal Sales Engineer - Distinguished Engineer

 

From: mapi...@googlegroups.com <mapi...@googlegroups.com> On Behalf Of Nick
Sent: 14. august 2023 21:20
To: MapInfo-L <mapi...@googlegroups.com>
Subject: Re: [MI-L] Programmatically defining which overlapping object appears on top

 

This message originated Externally. Use proper judgement and caution with attachments, links, or responses.

 

Peter,

--

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

---
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapinfo-l+...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages