• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Autodesk MapGuide Enterprise

    Reply
    Mentor
    Posts: 245
    Registered: ‎10-10-2003
    Accepted Solution

    driving line colour from the database

    1070 Views, 5 Replies
    11-01-2011 06:31 PM

    Hi All,

    I have a database full of string colours:  0xFFFF00FF etc

     

    If I copy and paste this value for my Enhanced Styles it works fine for value, but if I choose the column I get Not A Number Error.  There is no TOHEX function... Sorry for the cross-post but this is a AIMS 2012 issue too

     

    COLOUR_DATABASE.png

    Please use plain text.
    Mentor
    Posts: 245
    Registered: ‎10-10-2003

    Re: driving line colour from the database

    11-03-2011 12:23 PM in reply to: gluckett

    Solved it.  You have to store you colours from ARGB for example RED FF FF 00 00 (hex) in Long Int in the database or mapguide can't see it.

     

    So just convert your data in the database to Long Int (FFFF0000) which is 4294901760  and Black is 0

     

    Crazy way to do it, but there you are.

    Please use plain text.
    New Member
    Posts: 2
    Registered: ‎05-10-2010

    Re: driving line colour from the database

    07-25-2012 06:55 AM in reply to: gluckett

    Hi gluckett,

     

    I had that problem, too. Fortunately I found this post. I followed your steps converting the strings to integer, but with no satisfied results. All the lines now appear in black with a slight transparency (just in MapGuide), although the alpha value in the hex-string was always "ff" (opaque). I even took your eample value which was red. In Map3D (2010) it appears in a kind of violet, in MapGuide (2010 and MG OS 2.4).

    Have you made any other experiences with that issue?

     

    - kind regards

    Please use plain text.
    Mentor
    Posts: 245
    Registered: ‎10-10-2003

    Re: driving line colour from the database

    07-27-2012 03:58 PM in reply to: gluckett

    yes, unfortunately...and sometimes the transparency doesn't come across either...painful little bug.  I haven't tried in AIMS 2013 and Map 3D 2013 so I may be fixed...

    Please use plain text.
    New Member
    Posts: 2
    Registered: ‎05-10-2010

    Re: driving line colour from the database

    07-29-2012 10:10 PM in reply to: gluckett

    I could find a solution:

    The attribute with the color-code (in integer) in the database should be from type string. It's a bit confusing, but that's how it works.

    Hope it works for you as well.

    Please use plain text.
    Active Member
    b.banzer
    Posts: 8
    Registered: ‎04-04-2011

    Re: driving line colour from the database

    10-19-2012 02:34 AM in reply to: mariakallbach2670

    Hi,

     

    I have kind of the same problem with the exception that I want to use the colors in the database for polygones.

     

    Unfortunately I don't find a solution to convert the data.

     

    I'm using an Oracle database and in my table I have a column for the colors of the type VARCHAR2 (10 byte).

     

    Could you explain me please what I need to do, in order to be able to select the color from the database.

     

    I found somewhere another solution for the problem but it does not work 100%. The colors are shown correctly on the drawing, but the colors in the legend are all balck.

     

    Thanks in advance!

     

    Bob

    Please use plain text.