MapGuide Open Source:  Home |  Download |  Internals

Ticket #502 (reopened defect)

Opened 4 months ago

Last modified 3 months ago

Feature Join rendering can be momentarily broken due to incorrect case on secondary attribute

Reported by: jng Assigned to: brucedechant
Priority: high Milestone: 2.1
Component: General Version: 2.0.0
Severity: critical Keywords: feature join
Cc: External ID:

Description

Consider a primary feature source with the following sample data.

ID
A001
A002
A003
A004
A005
A006
....
A194

Now consider that we are joining to a secondary feature source via ODBC, with the following sample data.

IDValue
A001A
A002C
A003A
......
A015B
a016C
A017A
A018C
......
A044A

Suppose now we create a layer off of this joined feature source and theming on the values of the "Value" property, including a default style.

If you preview this layer, you'll notice a "break" at A016 (as it doesn't have a corresponding match) which is fine, but a fair amount of features "after" A016 (number unknown) will also be NULL on the ODBC side, until rendering resumes normally, see attached image for a visual explaination.

If you were to view this data via the schema report, the joined class would look something like...

IDJoined_IDJoined_Value
A001A001A
A002A002C
A003A003A

....

A015A015B
A016NULLNULL <--- Correct, there is no corresponding match
A017NULLNULL <--- This is not correct, there is a corresponding match.
A018NULLNULL <--- Ditto

.... Some features later....

A044A044A

If the a016 was changed to A016 on the ODBC side, the feature join will render normally.

Attachments

error.png (150.2 kB) - added by jng on 03/17/08 01:06:22.
Image describing the join rendering bug

Change History

03/17/08 01:06:22 changed by jng

  • attachment error.png added.

Image describing the join rendering bug

03/20/08 16:25:27 changed by tomfukushima

  • owner set to brucedechant.

03/20/08 17:11:39 changed by brucedechant

  • status changed from new to closed.
  • resolution set to wontfix.

This is as expected because the join keys are strings. When strings are used as keys they are case sensitive. This is one of the dangers in using a non numeric key.

03/20/08 23:14:06 changed by jng

I understand that join keys are case-sensitive, but should it be null-ing the valid secondary rows after that bad key (A016) ?

03/24/08 17:47:14 changed by brucedechant

  • status changed from closed to reopened.
  • resolution deleted.

In 1st reading this I missed a very important detail. Thank you for pointing that out.

I had a look at the code and the problem is the way the join algorithm tries to do a match. It essentially tries to compare A016 with a016 and doesn't match so it ends up advancing the primary and tries to find something that matches with a016, but because of the way string comparisons work all the capital letters are less than all of the lower cse letters and so everything in the primary after this point never finds a match in the secondary.

I am going to reopen this as it is definitely a defect.