CMY color in USGS polygons

307 views
Skip to first unread message

Ike

unread,
Dec 30, 2023, 1:30:27 AM12/30/23
to MapInfo-L
Is there a way to utilize CMY colors found in some USGS Geologic map products (only available as .shp) when converted to .tab?

The .shp file has Color_cmy field for each polygon.  Is there a way to Thematically map these colors to match ( or closely) match original USGS colors?  Alternatively is there a way to modify the region style to match these original colors?

Thanks,
Ike

Uffe Kousgaard

unread,
Dec 30, 2023, 2:42:49 AM12/30/23
to mapi...@googlegroups.com
Hi,

Code for this task, could look like the one below. It assumes 3 seperate fields, with c, m and y values.
In the range 0-255. Adapt for your specific file format. Untested !!

Regards
Uffe Kousgaard


include "mapbasic.def"

dim obj as object
dim row as integer
Dim b_fillstyle As Brush

fetch first from mytable
row = 1
while not eot(mytable)
  obj = mytable.object
  b_fillstyle = makebrush(2,rgb(255-mytable.c, 255-mytable.m, 255-mytable.y),0)
  alter object obj Info OBJ_INFO_BRUSH, b_fillstyle

  update mytable
  set object = obj
  where rowid = row

  fetch next from mytable
  row = row+1
wend
--
--
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/5d2d5bf5-dd61-4443-b056-b65e6135060en%40googlegroups.com.

Ike

unread,
Dec 31, 2023, 6:48:42 PM12/31/23
to MapInfo-L
Thank you Uffe,
I'm unfamiliar with coding.  I'll look into using Mapbasic.
Cheers, Ike
Reply all
Reply to author
Forward
0 new messages