Jump to content

Creating a TYP file with dashed lines


Recommended Posts

Posted

I'm using GenTyp to create TYP files for my custom maps. I've determined how to create solid line elements, but cannot see how to create a dashed line, for example.

 

Does anyone know the trick to creating a dashed line?

Posted

I'm using GenTyp to create TYP files for my custom maps. I've determined how to create solid line elements, but cannot see how to create a dashed line, for example.

 

Does anyone know the trick to creating a dashed line?

 

I don't use GenTyp, but this is an example of how you would do it using cpgsmapper directly. It does it by creating a 1 pixel wide bitmap.

 

[_line]

;Unpaved Road

Type=0x0a

UseOrientation=Y

Xpm="32 1 2 1"

"- c #008000"

" c #000000"

"------ ------ ------ ------ "

[end]

Posted

Thanks RWS. I can get close using your XML code; can you tell me what the 32 1 2 1 each mean? Plugging those into the XML code in MapSetToolKit creates a very faint line.

Posted

Thanks RWS. I can get close using your XML code; can you tell me what the 32 1 2 1 each mean? Plugging those into the XML code in MapSetToolKit creates a very faint line.

 

32 is the width of the bitmap, 1 is the height, 2 is the number of colors in the bitmap, I don't remember what the last 1 is.

 

The next two lines define the colors for the bitmap.

"- c #008000" means that a "-" is a pixel that will be dark green

" c #000000" means that a space is a pixel that will be the background color.

 

Here is an example of a 3 pixel wide bitmap:

[_line]
;Trail
Type=0x16
UseOrientation=Y
Xpm="32 3 2 1"
"* c #000000"
"  c #000000"
" ***			 ***			"
"*****  ******** ***** ********  "
" ***			 ***			"
[end]	 

 

This will create a small dot followed by a dash.

Posted

Thanks RWS. I can get close using your XML code; can you tell me what the 32 1 2 1 each mean? Plugging those into the XML code in MapSetToolKit creates a very faint line.

 

32 is the width of the bitmap, 1 is the height, 2 is the number of colors in the bitmap, I don't remember what the last 1 is.

 

The next two lines define the colors for the bitmap.

"- c #008000" means that a "-" is a pixel that will be dark green

" c #000000" means that a space is a pixel that will be the background color.

 

Here is an example of a 3 pixel wide bitmap:

[_line]
;Trail
Type=0x16
UseOrientation=Y
Xpm="32 3 2 1"
"* c #000000"
"  c #000000"
" ***			 ***			"
"*****  ******** ***** ********  "
" ***			 ***			"
[end]	 

 

This will create a small dot followed by a dash.

Posted

Outstanding. That works for me in GenTyp! Just curious: which part of the code creates the small dot, and which creates the dash?

 

Each character in the last three lines of text represents a pixel. If there is an "*" the pixel is on, if there is a " " then it's off.

Posted (edited)

I use Paint.NET (free graphics program) to make .bmp files to be imported into GenTYP to make custom lines and polygons. Making up the desired pattern is real easy using a graphics program. In the case of the following video demo I created a 32 x 3 pixel image to design a dashed line to be imported into GenTYP.

 

download file and play it in Windows Media Player

Dashed Line Video Demo

Edited by rws
Posted

Thanks everyone, this thread has been most helpful. With it I've been able to create various custom colored dashed and dotted lines of various sizes.

Posted

I have compiled a TYP file of customised road line widths and colours and loaded it with its OpenStreetMap gmapsupp.img to my Legend HCx. The resulting display is just as it should be. I ventured further to add dashed lines to represent footpaths and tracks. The result is only half successful: the dashes and line widths display correctly, but the colour of the dash always appears white, whatever hex code I have used so far.

Here is an extract from the .txt file:

[_line]

Type=0x16

XPM="32 2 2 1"

". c #009900"

"X c none"

".....XXX.....XXX.....XXX.....XXX"

".....XXX.....XXX.....XXX.....XXX"

[end]

 

[_line]

Type=0x0a

XPM="32 2 2 1"

". c #999999"

"X c none"

"............XXXX............XXXX"

"............XXXX............XXXX"

[end]

I wonder if anyone can throw any light on what might be wrong?

Posted (edited)

Hope this isn't too much of a hijack, but whenever I use "none" as a color selection in a polygon the other color shows up white. If I substitute a color for "none" in the sample below, the polygon becomes a sort of tan.

 

Any advice would be appreciated.

 

[_polygon]

Type=0x14

string1=4,LAS

string1=0x14,LAS

XPM="32 32 2 1",

"! c #FF7700",

"# c none",

"#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!",

"#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!",

"!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#",

"!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#",

"#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!",

... total of 32 lines...

"#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!",

"#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!",

"!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#",

"!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#!#"};

[end]

 

I just tried using c #000000 for transparent instead of "none", per RWSmith123's recommendation above, and that shows correctly as tan. Still, "none" is listed in the manual as a legitimate code, so any comments on syntax would be appreciated.

 

And thanks RWSmith123 for the Crater Lake tutorial. It got me started mapping.

Edited by seldom_sn
Posted (edited)

Looking at my GPS in daytime, against what I saw when I first created the TYP yesterday evening, I think this issue possibly relates to daytime/nighttime colours. I shall investigate further today.

Edited by dunmappin
Posted

My reference to the cGPSmapper manual guided me to the solution: the answer does appear to lie with entering both daytime and nighttime details into the .typ file. Here is the example from my .txt file:

[_line]

Type=0x16

XPM="32 2 4 1"

". c #009900"

"X c none"

"3 c #009900"

"4 c none"

".....XXX.....XXX.....XXX.....XXX"

".....XXX.....XXX.....XXX.....XXX"

[end]

 

[_line]

Type=0x0a

XPM="32 2 4 1"

". c #999999"

"X c none"

"3 c #999999"

"4 c none"

"............XXXX............XXXX"

"............XXXX............XXXX"

[end]

Posted

My reference to the cGPSmapper manual guided me to the solution: the answer does appear to lie with entering both daytime and nighttime details into the .typ file. Here is the example from my .txt file:

[_line]

Type=0x16

XPM="32 2 4 1"

". c #009900"

"X c none"

"3 c #009900"

"4 c none"

".....XXX.....XXX.....XXX.....XXX"

".....XXX.....XXX.....XXX.....XXX"

[end]

 

[_line]

Type=0x0a

XPM="32 2 4 1"

". c #999999"

"X c none"

"3 c #999999"

"4 c none"

"............XXXX............XXXX"

"............XXXX............XXXX"

[end]

 

Thanks, the day/night setting did it for my polygon, too. I saw it in the example, but didn't see it spelled out in the manual.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...