Jump to content

 
Photo

KML symbology

- - - - -

  • Please log in to reply
12 replies to this topic

#1
Rob

Rob

    Legendary Contributor

  • Moderator
  • PipPipPipPipPip
  • 418 posts
  • Gender:Male
  • Location:Kailua, Hawaii
  • Interests:anything outside.
  • United States

If I create a KML file of some line features and load it in Google Earth, is there any way to change symbology beyond color and width?

Anything in the code I can tweak?

#2
Andrew Patterson

Andrew Patterson

    Key Contributor

  • Validated Member
  • PipPipPip
  • 99 posts
  • Gender:Male
  • Location:Toronto, ON
  • Canada

If I create a KML file of some line features and load it in Google Earth, is there any way to change symbology beyond color and width?

Anything in the code I can tweak?


For lines? No, I don't believe you can, though I'd be interested in hearing about it if I'm wrong. I know it's possible to tinker with the symbology of points (Placemarks) but not lines I don't think.
Andrew Patterson
Lead Software Architect
Avenza Systems Inc.

email: andrew@avenza.com
phone: 416.487.5116

#3
Matthew Hampton

Matthew Hampton

    Hall of Fame

  • Moderator
  • PipPipPipPipPipPipPip
  • 1,290 posts
  • Gender:Male
  • Location:Portland, Oregon
  • Interests:Playing in the mountains and rivers.
  • United States

What beyond stroke color/width did you want to change?


If I create a KML file of some line features and load it in Google Earth, is there any way to change symbology beyond color and width?

Anything in the code I can tweak?


Oregon Metro - Portland, OR
www.oregonmetro.gov


#4
Rob

Rob

    Legendary Contributor

  • Moderator
  • PipPipPipPipPip
  • 418 posts
  • Gender:Male
  • Location:Kailua, Hawaii
  • Interests:anything outside.
  • United States

i was thinking dashes or dots or some other symbology.

#5
Andrew Patterson

Andrew Patterson

    Key Contributor

  • Validated Member
  • PipPipPip
  • 99 posts
  • Gender:Male
  • Location:Toronto, ON
  • Canada

i was thinking dashes or dots or some other symbology.


I just checked the KML reference site maintained by Google and it looks like the only thing you can do with lines is width & colour I'm afraid :(
Andrew Patterson
Lead Software Architect
Avenza Systems Inc.

email: andrew@avenza.com
phone: 416.487.5116

#6
Matthew Hampton

Matthew Hampton

    Hall of Fame

  • Moderator
  • PipPipPipPipPipPipPip
  • 1,290 posts
  • Gender:Male
  • Location:Portland, Oregon
  • Interests:Playing in the mountains and rivers.
  • United States

I am after a similar thing (cased dashes). I had thought you could do cased lines by using the polystyle tag - but I haven't tried it yet.

If you figure anything out, please post back - I'll do the same.

Oregon Metro - Portland, OR
www.oregonmetro.gov


#7
Andrew Patterson

Andrew Patterson

    Key Contributor

  • Validated Member
  • PipPipPip
  • 99 posts
  • Gender:Male
  • Location:Toronto, ON
  • Canada

I am after a similar thing (cased dashes). I had thought you could do cased lines by using the polystyle tag - but I haven't tried it yet.


From the spec, it looks like the only additional things you can do with PolyLines is determine if the outline should be drawn or not & specify the fill colour. So no help there.
Andrew Patterson
Lead Software Architect
Avenza Systems Inc.

email: andrew@avenza.com
phone: 416.487.5116

#8
Rob

Rob

    Legendary Contributor

  • Moderator
  • PipPipPipPipPip
  • 418 posts
  • Gender:Male
  • Location:Kailua, Hawaii
  • Interests:anything outside.
  • United States

I am after a similar thing (cased dashes). I had thought you could do cased lines by using the polystyle tag - but I haven't tried it yet.


From the spec, it looks like the only additional things you can do with PolyLines is determine if the outline should be drawn or not & specify the fill colour. So no help there.


I've found a small .exe called shp2kml that offers a little more control (over Global Mapper, which i had been using), but that only gets into different line colors per attributes rather than line style. I've also seen that the Arctool box in 9.2 has a KML export that is based off of a layer file, and I'm going to try that out later this week when I have time. I'm not holding my breath per your guys posts and what i've seen online, but if it is the key, I'll def post back results.

thanks.

#9
Hans van der Maarel

Hans van der Maarel

    CartoTalk Editor-in-Chief

  • Admin
  • PipPipPipPipPipPipPip
  • 3,838 posts
  • Gender:Male
  • Location:The Netherlands
  • Interests:Cartography, GIS, history, popular science, music.
  • Netherlands

Maybe Tiles2KML could do the trick, but I doubt it. If there's no support in the KML definition for more complex linestyles like dashes, there's nothing you can do. Well... except rendering every dash as a separate line object, but that would seriously bloat your file...
Hans van der Maarel - Cartotalk Editor
Red Geographics
Email: hans@redgeographics.com / Twitter: @redgeographics

#10
Andrew Patterson

Andrew Patterson

    Key Contributor

  • Validated Member
  • PipPipPip
  • 99 posts
  • Gender:Male
  • Location:Toronto, ON
  • Canada

Maybe Tiles2KML could do the trick, but I doubt it. If there's no support in the KML definition for more complex linestyles like dashes, there's nothing you can do. Well... except rendering every dash as a separate line object, but that would seriously bloat your file...


Heh, I suppose you could do that! Though you're right, it would hurt size-wise!

I know it won't help you right now, but you should go to the KML discussion forums and throw in a feature request. The KML spec is still seeing quite a bit of movement (I should know, I wrote a KML reader/writer for MAPublisher!). KML's focus is on points, really, but as it matures there's no reason for it not to have proper cartographic line styles, or at least a sub-set. Dashed lines seems like a pretty reasonable request frankly.
Andrew Patterson
Lead Software Architect
Avenza Systems Inc.

email: andrew@avenza.com
phone: 416.487.5116

#11
ELeFevre

ELeFevre

    Hall of Fame

  • Associate Admin
  • PipPipPipPipPipPipPip
  • 1,049 posts
  • Gender:Male
  • Location:Louisville, Colorado USA
  • Interests:Cartography, musical instruments, reading, hiking, craft beer
  • United States

I ran a test with Arc2Earth and came up with the same thing. Sorry.



#12
Rob

Rob

    Legendary Contributor

  • Moderator
  • PipPipPipPipPip
  • 418 posts
  • Gender:Male
  • Location:Kailua, Hawaii
  • Interests:anything outside.
  • United States

If there's no support in the KML definition for more complex linestyles like dashes, there's nothing you can do.


And that seems to be the case. the Arc tool Layer to KML converted blue dashed lines to just blue lines in a KMZ.

Oh well, I'm sure in the future there will be more options.

#13
Matthew Hampton

Matthew Hampton

    Hall of Fame

  • Moderator
  • PipPipPipPipPipPipPip
  • 1,290 posts
  • Gender:Male
  • Location:Portland, Oregon
  • Interests:Playing in the mountains and rivers.
  • United States

If only they could adopt the following tags where a dashed line could be coded as follows:

<LineStyle>
<color>ffffffff</color>
<width>2</width>
<mode>dashed</mode>
<alternatecolor>00000000</alternatecolor>
<dashsize>5</dashsize>
</LineStyle>


Perhaps in the 3.0 spec?

The line casing would be a little different, but can be currently (clunkily) accomplished by overlaying multiple coincident KML's with different stroke widths.



If there's no support in the KML definition for more complex linestyles like dashes, there's nothing you can do.


And that seems to be the case. the Arc tool Layer to KML converted blue dashed lines to just blue lines in a KMZ.

Oh well, I'm sure in the future there will be more options.


Oregon Metro - Portland, OR
www.oregonmetro.gov





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->