0

I am using the simplekml library to draw some polygons in a kmz file, but when I do the zoom on them, they disappear.

This is the code which draws the polygons:

                ls2 = doc2.newpolygon(name=self.data[y]['lwpolylineConvertName'])
                len4 = len(self.data[y]['lwpolylinePoints'])
                for x in range(len4):
                    cord = str (self.data[y]['lwpolylinePoints'][x])
                    pStart1 = header.re.sub('\[', '', cord)
                    pStart2 = header.re.sub('\]', '', pStart1)
                    pStart3 = header.re.sub(' +', '', pStart2)
                    pStartOk = str(pStart3)
                    a,b = pStartOk.split(',')
                    c = 0
                    longlat = self.p2(a,b, inverse=True)
                    longlat2 = longlat + (c,)

                    test2.append(longlat2)


                ls2.description = ("Pisten -> " + str(y))
                ls2.outerboundaryis = test2
                ls2.style.linestyle.width = 1
                ls2.extrude = 1
                ls2.altitudemode = header.simplekml.AltitudeMode.clamptoground

enter image description here

  • Welcome to GIS SE! We're a little different from other sites. We're a Q&A site, not a discussion forum. For questions that involve code we ask that you show us where you are stuck with your own code by including a code snippet in your question. There is an edit button beneath your question which will enable you to do that and a {} button that enables you to format any highlighted code nicely. Please check out our short tour for more about how the site works. Thanks. – PolyGeo Nov 25 '19 at 11:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.