• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python tools.get_as_epsg4326函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中trytond.modules.geotools.tools.get_as_epsg4326函数的典型用法代码示例。如果您正苦于以下问题:Python get_as_epsg4326函数的具体用法?Python get_as_epsg4326怎么用?Python get_as_epsg4326使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_as_epsg4326函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: get_image

    def get_image(self, ids):
        if self.geom is None:
            return buffer('')        

        EmpObj = Pool().get(self.__name__)
        objs = EmpObj.search([('dispositif', '=', self.dispositif.id)])
        pts, _envelope, area = get_as_epsg4326([obj.geom for obj in objs])

        points, _envelope, _area = get_as_epsg4326([self.geom])

        # Léger dézoom pour afficher correctement les points qui touchent la bbox
        envelope = [
            _envelope[0] - 0.01,
            _envelope[1] + 0.01,
            _envelope[2] - 0.01,
            _envelope[3] + 0.01,
        ]

        if points == []:
            return buffer('')

        m = MapRender(640, 480, envelope)

        # Ajoute les points de la placette        
        for entry in pts:
            if len(pts) == 0:
                continue            
            if entry == get_as_epsg4326([self.geom])[0][0]:                
                m.plot_geom(entry, None, None, color=(0, 0, 1, 1), bgcolor=self.BGCOLOR)
            else:                
                m.plot_geom(entry, None, None, color=(0, 0, 1, 0.5), bgcolor=self.BGCOLOR)

        m.plot_geom(points[0], str(self.num), None, color=self.COLOR, bgcolor=self.BGCOLOR)
        return buffer(m.render())
开发者ID:silpol,项目名称:tryton-bef,代码行数:34,代码来源:psdrf.py


示例2: get_image

    def get_image(self, ids):
        if self.site is None:
            return buffer('')

        MiscObj = Pool().get(self.__name__)
        # Récupère l'étendu de la zone de travaux
        areas, _envelope, _area = get_as_epsg4326([self.site.geom])

        # Léger dézoom pour afficher correctement les points qui touchent la bbox
        envelope = [
            _envelope[0] - 0.001,
            _envelope[1] + 0.001,
            _envelope[2] - 0.001,
            _envelope[3] + 0.001,
        ]

        objs = MiscObj.search([('site', '=', self.site.id)])
        misc_obj, _envelope, area = get_as_epsg4326([obj.geom for obj in objs])

        if misc_obj == []:
            return buffer('')
        
        m = MapRender(640, 480, envelope)       
        # Ajoute la zone de chantier
        m.plot_geom(areas[0], None, None, color=self.COLOR, bgcolor=(0, 0, 1, 0.1))
        m.plot_geom(get_as_epsg4326([self.geom])[0][0], None, None, color=self.COLOR, bgcolor=self.BGCOLOR)
        return buffer(m.render())
开发者ID:silpol,项目名称:tryton-bef,代码行数:27,代码来源:misc_obj.py


示例3: generate

    def generate(cls, records):
        for record in records:
            if record.num is None:
                continue                       

            # Récupère les placettes de mesure du dispositif
            EmpObj = Pool().get(record.__name__)
            objs = EmpObj.search([('dispositif', '=', record.dispositif.id)])
            pts, envelope, area = get_as_epsg4326([obj.geom for obj in objs])
            
            # Placette en cours
            points, _envelope, _area = get_as_epsg4326([record.geom])                     

            # Léger dézoom pour afficher correctement les points qui touchent la bbox
            envelope = [
                _envelope[0] - 0.001,
                _envelope[1] + 0.001,
                _envelope[2] - 0.001,
                _envelope[3] + 0.001,
            ]
            
            m = MapRender(640, 480, envelope, True)
            m.add_bg()

            # Ajoute les placettes du dispositif
            for entry in pts:
                if len(pts) == 0:
                    continue            
                if entry == get_as_epsg4326([record.geom])[0][0]:                
                    m.plot_geom(entry, None, None, color=(0, 0, 1, 1), bgcolor=record.BGCOLOR)
                else:                
                    m.plot_geom(entry, None, None, color=(0, 0, 1, 0.5), bgcolor=record.BGCOLOR)
            m.plot_geom(points[0], str(record.num), None, color=(1, 1, 1, 1), bgcolor=record.BGCOLOR)
            data = m.render()
            cls.write([record], {'image_map': buffer(data)})
开发者ID:silpol,项目名称:tryton-bef,代码行数:35,代码来源:psdrf.py


示例4: generate

 def generate(cls, records):
     for record in records:
         if record.code is None:
             continue
         
         lines, envelope, _line = get_as_epsg4326([record.equipement.geom])
         aires, _envelope, _aire = get_as_epsg4326([record.portee.geom])        
         areas, _envelope, _area = get_as_epsg4326([record.geom])
         points = [point.geom for point in record.arbre]
         points, _points_bbox, _points_area = get_as_epsg4326(points)
         
         # Léger dézoom pour afficher correctement les zones qui touchent la bbox
         envelope = [
             _envelope[0] - 0.0001,
             _envelope[1] + 0.0001,
             _envelope[2] - 0.0001,
             _envelope[3] + 0.0001,
         ]            
         
         m = MapRender(640, 480, envelope, True)
         m.add_bg()
         
         m.plot_geom(lines[0], None, None, color=(0, 0, 1, 0.3), bgcolor=(0, 0, 1, 0.1))
         m.plot_geom(aires[0], None, None, color=(0, 0, 1, 0.3), bgcolor=(0, 0, 1, 0.1))
         # Ajoute les points
         for point, rec in zip(points, record.arbre):
             m.plot_geom(point, rec.code , None, color=(1, 1, 1, 1), bgcolor=(1, 1, 1, 1))
         m.plot_geom(areas[0], record.code, None, color=cls.COLOR, bgcolor=cls.BGCOLOR)                 
        
         data = m.render()
         cls.write([record], {'image_map': buffer(data)})
开发者ID:silpol,项目名称:tryton-bef,代码行数:31,代码来源:rte.py


示例5: get_image

    def get_image(self, ids):
        if self.geom is None:
            return buffer('')
                
        lines, envelope, _line = get_as_epsg4326([self.equipement.geom])
        aires, _envelope, _aire = get_as_epsg4326([self.portee.geom])        
        areas, _envelope, _area = get_as_epsg4326([self.geom])
        points = [point.geom for point in self.arbre]
        points, _points_bbox, _points_area = get_as_epsg4326(points)        
        
        if areas == []:
            return buffer('')
            
        _envelope = bbox_aspect(envelope, 640, 480)    
            
        # Léger dézoom pour afficher correctement les aires qui touchent la bbox
        envelope = [
            _envelope[0] - 0.001,
            _envelope[1] + 0.001,
            _envelope[2] - 0.001,
            _envelope[3] + 0.001,
        ]                    

        m = MapRender(640, 480, envelope, True)
        
        m.plot_geom(lines[0], None, None, color=(0, 0, 1, 0.3), bgcolor=(0, 0, 1, 0.3))
        m.plot_geom(aires[0], None, None, color=(0, 0, 1, 0.3), bgcolor=(0, 0, 1, 0.3))        

        # Ajoute les points
        for point, rec in zip(points, self.arbre):
            m.plot_geom(point, None, None, color=(1, 1, 1, 1), bgcolor=(1, 1, 1, 1))

        m.plot_geom(areas[0], self.code, None, color=self.COLOR, bgcolor=self.BGCOLOR)   
        
        return buffer(m.render())    
开发者ID:silpol,项目名称:tryton-bef,代码行数:35,代码来源:rte.py


示例6: generate

    def generate(cls, records):
        for record in records:
            if record.address is None:
                continue

            town, envelope, area = get_as_epsg4326([record.address.my_city.contour])
            
            # Calcule de la bbox contenant tout les points
            _envelope = None
            for points in cls.search([]):
                _points, envelope, _area = get_as_epsg4326([points.geom])
                if envelope is None:
                    continue
                _envelope = envelope_union(envelope, _envelope)

            # Léger dézoom pour afficher correctement les points qui touchent la bbox
            envelope = [
                _envelope[0] - 0.001,
                _envelope[1] + 0.001,
                _envelope[2] - 0.001,
                _envelope[3] + 0.001,
            ]
            
            m = MapRender(640, 480, envelope, True)
            m.add_bg()
            for entry in cls.search([]):
                points, _envelope, _area = get_as_epsg4326([entry.geom])
                if len(points) == 0:
                    continue
                if record == entry:
                    m.plot_geom(points[0], None, None, color=cls.COLOR, bgcolor=cls.BGCOLOR)
                else:
                    m.plot_geom(points[0], None, None, color=(0, 0, 1, 1), bgcolor=cls.BGCOLOR)
            data = m.render()
            cls.write([record], {'image_map': buffer(data)})
开发者ID:silpol,项目名称:tryton-bef,代码行数:35,代码来源:allo_quoi.py


示例7: situation_map_gen

    def situation_map_gen(cls, records):
        """Render the situation map"""
        CadPlot = Pool().get('cadastre.parcelle')
        Plot = Pool().get('forest.plot')
        for record in records:
            cad_plots = [plot.geom for plot in record.cad_plots]
            cad_plots, envelope, cad_area = get_as_epsg4326(cad_plots)
            plots = [plot.geom for plot in record.plots]
            plots, plot_bbox, _plots_area = get_as_epsg4326(plots)

            if envelope is None:
                continue

            # Compute the envelope
            if plot_bbox is not None:
                envelope = envelope_union(envelope, plot_bbox)

            # Include the geometry of the town in the bbox of the map
            if record.address is not None and record.address.my_city is not None:
                # Include the town from the address in the bbox
                town_geo = osr_geo_from_field(record.address.my_city.contour)

                dst = osr.SpatialReference()
                dst.SetWellKnownGeogCS("EPSG:4326")
                town_geo.TransformTo(dst)
                envelope = envelope_union(envelope, town_geo.GetEnvelope())

            # Map title
            title = u'Plan de situation\n'
            title += u'Propriétaire: %s\n' % record.owner.name
            if record.address is not None \
                    and record.address.city is not None \
                    and record.address.my_city is not None:
                city = record.address.city
                dep = record.address.my_city.subdivision.parent.code.split('-')[1]
                title += u'Commune: %s (%s)\n' % (city, dep)
            title += u'Surface: %02i ha %02i a %02i ca\n\nLe ' % cls._area_to_a(cad_area)
            title += date.today().strftime('%02d/%02m/%Y')

            m = MapRender(1024, 768, envelope, True)
            m.add_bg()
            for plot in cad_plots:
                m.plot_geom(plot, None, u'Bois de La Forêt', color=CadPlot.COLOR, bgcolor=CadPlot.BGCOLOR)
            for plot in plots:
                m.plot_geom(plot, None, u'Parcelle forestière', linestyle='--', color=Plot.COLOR, bgcolor=Plot.BGCOLOR)

            data_nl = m.render()
            m.plot_legend()
            m.plot_compass()
            m.plot_scaling()
            cls._plot_logo(m)
            m.plot_title(title)
            data = m.render()
            cls.write([record], {
                'situation_map': buffer(data),
                'situation_map_nl': buffer(data_nl),
            })
开发者ID:silpol,项目名称:tryton-bef,代码行数:57,代码来源:forest.py


示例8: get_image

    def get_image(self, ids):
        if self.geom is None:
            return buffer('')

        points, _envelope, _area = get_as_epsg4326([self.geom])
        town, envelope, area = get_as_epsg4326([self.address.my_city.contour])
        if points == []:
            return buffer('')

        m = MapRender(640, 480, envelope)
        m.plot_geom(town[0], None, None, color=(0, 0, 1, 1), bgcolor=(0, 0, 0, 0))
        m.plot_geom(points[0], None, None, color=self.COLOR, bgcolor=self.BGCOLOR)
        return buffer(m.render())
开发者ID:silpol,项目名称:tryton-bef,代码行数:13,代码来源:allo_quoi.py


示例9: situation_closeup_map_gen

    def situation_closeup_map_gen(cls, records):
        """Render the situation map closeup"""
        CadPlot = Pool().get('cadastre.parcelle')
        Plot = Pool().get('forest.plot')
        for record in records:
            cad_plots = [plot.geom for plot in record.cad_plots]
            cad_plots, envelope, cad_area = get_as_epsg4326(cad_plots)
            plots = [plot.geom for plot in record.plots]
            plots, plot_bbox, _plots_area = get_as_epsg4326(plots)

            if envelope is None:
                continue

            # Compute the envelope
            if plot_bbox is not None:
                envelope = envelope_union(envelope, plot_bbox)

            # Map title
            title = u'Plan de situation\n'
            title += u'Propriétaire: %s\n' % record.owner.name
            if record.address is not None \
                    and record.address.city is not None \
                    and record.address.my_city is not None:
                city = record.address.city
                dep = record.address.my_city.subdivision.parent.code.split('-')[1]
                title += u'Commune: %s (%s)\n' % (city, dep)
            title += u'Surface: %02i ha %02i a %02i ca\n\nLe ' % cls._area_to_a(cad_area)
            title += date.today().strftime('%02d/%02m/%Y')

            m = MapRender(1024, 768, envelope, True)
            m.add_bg()
            cls._plot_misc_areas(m, record, False)
            for plot in cad_plots:
                m.plot_geom(plot, None, u'Bois de La Forêt', color=CadPlot.COLOR, bgcolor=CadPlot.BGCOLOR)
            for plot, rec in zip(plots, record.plots):
                m.plot_geom(plot, rec.short_name, None, linestyle='--', color=Plot.COLOR, bgcolor=Plot.BGCOLOR)

            cls._plot_misc_points(m, record, False)
            data_nl = m.render()
            m.plot_legend()
            m.plot_compass()
            m.plot_scaling()
            cls._plot_logo(m)
            m.plot_title(title)
            data = m.render()
            cls.write([record], {
                'situation_closeup_map': buffer(data),
                'situation_closeup_map_nl': buffer(data_nl),
            })
开发者ID:silpol,项目名称:tryton-bef,代码行数:49,代码来源:forest.py


示例10: image_map_gen

    def image_map_gen(cls, records):
        """Render the image map"""
        for record in records:
            # Récupère l'étendu de la zone de garden
            parcelle, _envelope, _area = get_as_epsg4326([record.parcelle.geom])

            # Léger dézoom pour afficher correctement les points qui touchent la bbox
            envelope = [_envelope[0] - 0.001, _envelope[1] + 0.001, _envelope[2] - 0.001, _envelope[3] + 0.001]

            if envelope is None:
                continue

            # Map title
            title = u"Plan local du jardin\n"
            title += date.today().strftime("%02d/%02m/%Y")

            m = MapRender(1024, 768, envelope, True)
            # Ajoute le fond de carte
            m.add_bg()

            # Ajoute la pracelle
            m.plot_geom(parcelle[0], record.name, u"Parcelle", color=cls.COLOR, bgcolor=cls.BGCOLOR)

            data_nl = m.render()
            m.plot_legend()
            m.plot_compass()
            m.plot_scaling()
            m.plot_title(title)
            data = m.render()
            cls.write([record], {"image_map": buffer(data)})
开发者ID:silpol,项目名称:tryton-bef,代码行数:30,代码来源:garden.py


示例11: get_image_all

    def get_image_all(self, ids):
        if self.address is None:
            return buffer('')

        town, envelope, area = get_as_epsg4326([self.address.my_city.contour])
                       
        m = MapRender(640, 480, envelope)
        m.plot_geom(town[0], None, None, color=(0, 0, 1, 1), bgcolor=(0, 0, 0, 0))
        for record in self.search([]):
            points, _envelope, _area = get_as_epsg4326([record.geom])
            if len(points) == 0:
                continue
            if record == self:
                m.plot_geom(points[0], None, None, color=self.COLOR, bgcolor=self.BGCOLOR)
            else:
                m.plot_geom(points[0], None, None, color=(0, 0, 1, 1), bgcolor=self.BGCOLOR)
        return buffer(m.render())
开发者ID:silpol,项目名称:tryton-bef,代码行数:17,代码来源:allo_quoi.py


示例12: situation_map_gen

    def situation_map_gen(cls, records):
        """Render the situation map"""
        for record in records:

            town, envelope_town, area_town = get_as_epsg4326([record.address.my_city.contour])

            # Récupère l'étendu de la zone de garden
            section, envelope_section, area_section = get_as_epsg4326([record.section.geom])
            lieudit, envelope_lieudit, area_lieudit = get_as_epsg4326([record.lieudit.geom])
            parcelle, envelope_parcelle, area_parcelle = get_as_epsg4326([record.parcelle.geom])

            # Léger dézoom pour afficher correctement les points qui touchent la bbox
            envelope = bbox_aspect(envelope_section, 640, 480)

            if envelope is None:
                continue

            # Map title
            title = u"Plan de situation du jardin\n"
            title += date.today().strftime("%02d/%02m/%Y")

            m = MapRender(1024, 768, envelope, True)
            # Ajoute le fond de carte
            m.add_bg()

            # Ajoute le contour de la ville
            m.plot_geom(town[0], None, u"Commune", color=(0, 0, 1, 1), bgcolor=(0, 0, 0, 0))

            # Ajoute la section
            m.plot_geom(section[0], None, u"Section", color=(0, 0, 1, 0.3), bgcolor=(0, 0, 1, 0.3))

            # Ajoute le lieud dit
            m.plot_geom(lieudit[0], None, u"Lieu-dit", color=(0, 1, 1, 0.3), bgcolor=(0, 1, 1, 0.3))

            # Ajoute la pracelle
            m.plot_geom(parcelle[0], record.name, u"Parcelle", color=cls.COLOR, bgcolor=cls.BGCOLOR)

            data_nl = m.render()
            m.plot_legend()
            m.plot_compass()
            m.plot_scaling()
            m.plot_title(title)
            data = m.render()
            cls.write([record], {"situation_map": buffer(data)})
开发者ID:silpol,项目名称:tryton-bef,代码行数:44,代码来源:garden.py


示例13: situation_map_gen

    def situation_map_gen(cls, records):
        """Render the situation map"""        
        for record in records:
            # Récupère l'étendu de la zone de travaux
            areas, _envelope, _area = get_as_epsg4326([record.geom])
            
            # Léger dézoom pour afficher correctement les points qui touchent la bbox
            envelope = [
                _envelope[0] - 0.001,
                _envelope[1] + 0.001,
                _envelope[2] - 0.001,
                _envelope[3] + 0.001,
            ]  

            if envelope is None:
                continue
                   
            # Include the geometry of the town in the bbox of the map
            if record.commune is not None and record.commune.name is not None:
                # Include the town from the commune in the bbox
                town_geo = osr_geo_from_field(record.commune.contour)

                dst = osr.SpatialReference()
                dst.SetWellKnownGeogCS("EPSG:4326")
                town_geo.TransformTo(dst)
                envelope = envelope_union(envelope, town_geo.GetEnvelope())

            # Map title
            title = u'Plan de situation communal\n'
            title += u'Propriétaire: %s\n' % record.owner.name
            if record.commune is not None \
                    and record.commune.name is not None \
                    and record.commune.name is not None:
                city = record.commune.name
                dep = record.commune.subdivision.parent.code.split('-')[1]
                title += u'Commune: %s (%s)\n' % (city, dep)
            title += u'Surface: %02i ha %02i a %02i ca\n\nLe ' % cls._area_to_a(_area)
            title += date.today().strftime('%02d/%02m/%Y')

            m = MapRender(1024, 768, envelope, True)
            # Ajoute le fond de carte
            m.add_bg()                     

            # Ajoute la zone de chantier
            m.plot_geom(areas[0], None, u'Site', color=cls.COLOR, bgcolor=cls.BGCOLOR) 

            data_nl = m.render()
            m.plot_legend()
            m.plot_compass()
            m.plot_scaling()
            cls._plot_logo(m)
            m.plot_title(title)
            data = m.render()
            cls.write([record], {
                'situation_map': buffer(data),
            })
开发者ID:silpol,项目名称:tryton-bef,代码行数:56,代码来源:site.py


示例14: get_image

    def get_image(self, ids):
        if self.forest is None:
            return buffer('')

        data = ''
        Plot = Pool().get(self.__name__)
        plots = Plot.search([('forest', '=', self.forest.id)])
        plots, envelope, area = get_as_epsg4326([plot.geom for plot in plots])

        if plots == []:
            return buffer('')

        envelope = bbox_aspect(envelope, 640, 480)

        m = MapRender(640, 480, envelope)
        for plot in plots:
            m.plot_geom(plot, None, color=self.COLOR, bgcolor=self.BGCOLOR)
        m.plot_geom(get_as_epsg4326([self.geom])[0][0], None, color=(1, 0, 0, 1), bgcolor=self.BGCOLOR)
        data = m.render()
        return buffer(data)
开发者ID:silpol,项目名称:tryton-bef,代码行数:20,代码来源:plot.py


示例15: _plot_misc_points

 def _plot_misc_points(cls, m, record, show_legend=True):
     """Plots the misc_obj_point geometries"""
     obj_point = [obj.geom for obj in record.misc_obj_point]
     obj_point, _obj_point_bbox, _obj_point_area = get_as_epsg4326(obj_point)
     no = 0
     for obj, rec in zip(obj_point, record.misc_obj_point):
         col = (1.0 - (no / float(len(obj_point)))) * 255
         no += 1
         if show_legend:
             name = rec.name
         else:
             name = None
         m.plot_geom(obj, name, None, color=(col, 0, 0, 0.5), bgcolor=(col, 0, 0, 0.5))
开发者ID:silpol,项目名称:tryton-bef,代码行数:13,代码来源:forest.py


示例16: _plot_misc_areas

    def _plot_misc_areas(cls, m, record, show_legend=True):
        """Plots the misc_obj_poly geometries"""
        obj_poly = [obj.geom for obj in record.misc_obj_poly]
        obj_poly, _obj_poly_bbox, _obj_poly_area = get_as_epsg4326(obj_poly)
        no = 0
        for obj, rec in zip(obj_poly, record.misc_obj_poly):
            col = 1.0 - (no / float(len(obj_poly)))
            no += 1
            m.plot_geom(obj, None, None, color=(col, col, 0, 0.5), bgcolor=(col, col, 0, 0.5))
            if show_legend:
                m.add_legend(rec.name, '-', color=(col, col, 0, 0.5), bgstyle='', bgcolor=(col, col, 0, 0.5))

        # Miscellaneous line objects
        obj_line = [obj.geom for obj in record.misc_obj_line]
        obj_line, _obj_line_bbox, _obj_line_area = get_as_epsg4326(obj_line)
        no = 0
        for obj, rec in zip(obj_line, record.misc_obj_line):
            col = 1.0 - (no / float(len(obj_line)))
            no += 1
            m.plot_geom(obj, None, None, color=(col, 0, 0, 1), bgcolor=(col, 0, 0, 1))
            if show_legend:
                m.add_legend(rec.name, '_', color=(col, 0, 0, 1), bgstyle='', bgcolor=(col, 0, 0, 1))
开发者ID:silpol,项目名称:tryton-bef,代码行数:22,代码来源:site.py


示例17: get_image

    def get_image(self, ids):
        if self.geom is None:
            return buffer('')
        
        plots, envelope, area = get_as_epsg4326([self.geom])

        if plots == []:
            return buffer('')

        envelope = bbox_aspect(envelope, 640, 480)

        m = MapRender(640, 480, envelope)
        m.plot_geom(plots[0], self.tex, color=self.COLOR, bgcolor=self.BGCOLOR)        
        data = m.render()
        return buffer(data)
开发者ID:silpol,项目名称:tryton-bef,代码行数:15,代码来源:cadastre.py


示例18: get_image

    def get_image(self, ids):
        if self.forest is None:
            return buffer("")

        MiscObj = Pool().get(self.__name__)
        CadPlot = Pool().get("forest.cad_plot")
        objs = MiscObj.search([("forest", "=", self.forest.id)])
        misc_obj, envelope, area = get_as_epsg4326([obj.geom for obj in objs])

        if misc_obj == []:
            return buffer("")

        cad_plots = [plot.geom for plot in self.forest.cad_plots]
        if cad_plots != []:
            cad_plots, cad_bbox, cad_area = get_as_epsg4326(cad_plots)

            envelope = envelope_union(envelope, cad_bbox)
            envelope = bbox_aspect(envelope, 640, 480)

        m = MapRender(640, 480, envelope)
        for plot in cad_plots:
            m.plot_geom(plot, None, None, color=CadPlot.COLOR, bgcolor=CadPlot.BGCOLOR)
        m.plot_geom(get_as_epsg4326([self.geom])[0][0], None, None, color=self.COLOR, bgcolor=self.BGCOLOR)
        return buffer(m.render())
开发者ID:silpol,项目名称:tryton-bef,代码行数:24,代码来源:track.py


示例19: get_image

    def get_image(self, ids):
        if self.information is None:
            return buffer('')

        PresObj = Pool().get(self.__name__)                

        objs = PresObj.search([('information', '=', self.information.id)])
        pres_obj, _envelope, area = get_as_epsg4326([obj.geom for obj in objs])

        # Léger dézoom pour afficher correctement les points qui touchent la bbox
        envelope = [
            _envelope[0] - 0.001,
            _envelope[1] + 0.001,
            _envelope[2] - 0.001,
            _envelope[3] + 0.001,
        ]

        if pres_obj == []:
            return buffer('')
        
        m = MapRender(640, 480, envelope)       
        # Ajoute les géométries        
        m.plot_geom(get_as_epsg4326([self.geom])[0][0], None, None, color=self.COLOR, bgcolor=self.BGCOLOR)
        return buffer(m.render())
开发者ID:silpol,项目名称:tryton-bef,代码行数:24,代码来源:pres_obj.py


示例20: situation_map_gen

    def situation_map_gen(cls, records):
        """Render the situation map"""        
        for record in records:
            # Récupère l'étendu de la zone de secteur
            areas, _envelope, _area = get_as_epsg4326([record.geom])
            
            # Léger dézoom pour afficher correctement les points qui touchent la bbox
            envelope = [
                _envelope[0] - 0.001,
                _envelope[1] + 0.001,
                _envelope[2] - 0.001,
                _envelope[3] + 0.001,
            ]  

            if envelope is None:
                continue
                   
            # Map title
            title = u'Plan de situation de la zone urbanisée\n'
            title += u'Surface: %02i ha %02i a %02i ca\n\nLe ' % cls._area_to_a(_area)
            title += date.today().strftime('%02d/%02m/%Y')

            m = MapRender(1024, 768, envelope, True)
            # Ajoute le fond de carte
            m.add_bg()                     

            # Ajoute la zone urbanisée
            m.plot_geom(areas[0], None, u'Zone urbanisé', color=cls.COLOR, bgcolor=cls.BGCOLOR) 

            data_nl = m.render()
            m.plot_legend()
            m.plot_compass()
            m.plot_scaling()
            cls._plot_logo(m)
            m.plot_title(title)
            data = m.render()
            cls.write([record], {
                'situation_map': buffer(data),
            })
开发者ID:silpol,项目名称:tryton-bef,代码行数:39,代码来源:document_urbanisme.py



注:本文中的trytond.modules.geotools.tools.get_as_epsg4326函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python map_render.MapRender类代码示例发布时间:2022-05-27
下一篇:
Python shapefile.ShapeUnzip类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap