How to use the fastkml.config.etree.tostring function in fastkml

To help you get started, we’ve selected a few fastkml examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cleder / fastkml / fastkml / base.py View on Github external
def to_string(self, prettyprint=True):
        """ Return the KML Object as serialized xml """
        if config.LXML and prettyprint:
            return etree.tostring(
                self.etree_element(),
                encoding='utf-8',
                pretty_print=True).decode('UTF-8')
        else:
            return etree.tostring(
                self.etree_element(),
                encoding='utf-8').decode('UTF-8')
github cleder / fastkml / fastkml / kml.py View on Github external
return
        linearring = element.find('%sLinearRing' % self.ns)
        if linearring is not None:
            geom = Geometry(ns=self.ns)
            geom.from_element(linearring)
            self._geometry = geom
            return
        multigeometry = element.find('%sMultiGeometry' % self.ns)
        if multigeometry is not None:
            geom = Geometry(ns=self.ns)
            geom.from_element(multigeometry)
            self._geometry = geom
            return

        logger.warn('No geometries found')
        logger.debug(u'Problem with element: {}'.format(etree.tostring(element)))
        #raise ValueError('No geometries found')
github cleder / fastkml / fastkml / atom.py View on Github external
def to_string(self, prettyprint=True):
        """ Return the ATOM Object as serialized xml """
        if LXML and prettyprint:
            return etree.tostring(
                self.etree_element(),
                encoding='utf-8',
                pretty_print=True).decode('UTF-8')
        else:
            return etree.tostring(
                self.etree_element(),
                encoding='utf-8').decode('UTF-8')
github cleder / fastkml / fastkml / base.py View on Github external
def to_string(self, prettyprint=True):
        """ Return the KML Object as serialized xml """
        if config.LXML and prettyprint:
            return etree.tostring(
                self.etree_element(),
                encoding='utf-8',
                pretty_print=True).decode('UTF-8')
        else:
            return etree.tostring(
                self.etree_element(),
                encoding='utf-8').decode('UTF-8')
github cleder / fastkml / fastkml / atom.py View on Github external
def to_string(self, prettyprint=True):
        """ Return the ATOM Object as serialized xml """
        if LXML and prettyprint:
            return etree.tostring(
                self.etree_element(),
                encoding='utf-8',
                pretty_print=True).decode('UTF-8')
        else:
            return etree.tostring(
                self.etree_element(),
                encoding='utf-8').decode('UTF-8')
github cleder / fastkml / fastkml / kml.py View on Github external
def to_string(self, prettyprint=False):
        """ Return the KML Object as serialized xml """
        if config.LXML and prettyprint:
            return etree.tostring(
                self.etree_element(),
                encoding='utf-8',
                pretty_print=True).decode('UTF-8')
        else:
            return etree.tostring(
                self.etree_element(),
                encoding='utf-8').decode('UTF-8')
github cleder / fastkml / fastkml / kml.py View on Github external
def to_string(self, prettyprint=False):
        """ Return the KML Object as serialized xml """
        if config.LXML and prettyprint:
            return etree.tostring(
                self.etree_element(),
                encoding='utf-8',
                pretty_print=True).decode('UTF-8')
        else:
            return etree.tostring(
                self.etree_element(),
                encoding='utf-8').decode('UTF-8')