Python Forum
simplekml change shape&color
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
simplekml change shape&color
#1
I am trying to change the newpoint default shape , the code below return no errors but the result still using default Yellow shape in Googlmap.
.I wanted to change it to RED Rectangular shape.
Huh Cry
import simplekml 

''' code below doesn't work either.
from simplekml import *
from simplekml import Shape, Color
'''
kml = simplekml.Kml()
kml.shape='rectangle'
kml.color='r'
kml.newpoint(name="test", coords=[(18.432314,-33.988862)])
kml.save("test.kml")
Reply
#2
help~
Reply
#3
import simplekml

kml = simplekml.Kml()
pt2 = kml.newpoint(name="test", coords=[(18.432314,-33.988862)])
# use square icon
pt2.style.iconstyle.icon.href = 'http://maps.google.com/mapfiles/kml/shapes/placemark_square.png'
# set color of icon to be cyan (RGB=#00ffff)
pt2.style.iconstyle.color ='ffffff00' # aabbggrr
print("Output: test.kml")
kml.save("test.kml")
Yoriz write Aug-20-2022, 09:40 PM:
Please post all code, output and errors (in their entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  output shape problem with np.arange alan6690 5 668 Dec-26-2023, 05:44 PM
Last Post: deanhystad
  Turtle Star Fill Color Yellow-White Interchanging Color Effect codelab 9 989 Oct-25-2023, 09:09 AM
Last Post: codelab
  Can't properly shape an array maaaa2401 3 2,312 Dec-18-2020, 09:32 AM
Last Post: maaaa2401
  Change the color automatically Dragonos 5 2,833 Jul-28-2020, 01:17 PM
Last Post: Dragonos
  ValueError: shape mismatched: objects cannot be broadcast to a single shape Laplace12 0 4,500 Jul-14-2020, 11:45 AM
Last Post: Laplace12
  Use of input function to change screen background color in Turtles Oldman45 3 4,846 Jul-10-2020, 09:54 AM
Last Post: Oldman45
  Receiving ValueError("bad input shape {0}".format(shape)) error SuryaCitizen 2 3,503 Jun-01-2020, 06:45 AM
Last Post: pyzyx3qwerty
  Fill a value in triangle shape in Matrix lynx 0 1,869 Dec-07-2019, 06:32 AM
Last Post: lynx
  Change Text Color Output in Python bluethundr 2 8,718 Mar-06-2019, 10:23 PM
Last Post: bluethundr
  ValueError: could not broadcast input array from shape (1555200) into shape (0) promach 1 3,870 Jun-18-2018, 08:00 AM
Last Post: promach

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020