Infrastructure Map Server General Discussion

Infrastructure Map Server General Discussion

Reply
Valued Mentor
gluckett
Posts: 426
Registered: ‎10-10-2003
Message 1 of 6 (1,285 Views)
Accepted Solution

driving line colour from the database

1285 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

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.

Valued Mentor
gluckett
Posts: 426
Registered: ‎10-10-2003
Message 2 of 6 (1,274 Views)

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.

Member
mariakallbach2670
Posts: 4
Registered: ‎05-10-2010
Message 3 of 6 (1,092 Views)

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

Valued Mentor
gluckett
Posts: 426
Registered: ‎10-10-2003
Message 4 of 6 (1,078 Views)

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

Member
mariakallbach2670
Posts: 4
Registered: ‎05-10-2010
Message 5 of 6 (1,072 Views)

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.

Active Member
b.banzer
Posts: 10
Registered: ‎04-04-2011
Message 6 of 6 (731 Views)

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

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.