当前位置: 首页>>代码示例>>Python>>正文


Python point.Point方法代码示例

本文整理汇总了Python中django.contrib.gis.geos.point.Point方法的典型用法代码示例。如果您正苦于以下问题:Python point.Point方法的具体用法?Python point.Point怎么用?Python point.Point使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在django.contrib.gis.geos.point的用法示例。


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

示例1: _post_init

# 需要导入模块: from django.contrib.gis.geos import point [as 别名]
# 或者: from django.contrib.gis.geos.point import Point [as 别名]
def _post_init(self, srid):
        "Helper routine for performing post-initialization setup."
        # Setting the SRID, if given.
        if srid and isinstance(srid, int): self.srid = srid

        # Setting the class type (e.g., Point, Polygon, etc.)
        self.__class__ = GEOS_CLASSES[self.geom_typeid]

        # Setting the coordinate sequence for the geometry (will be None on
        # geometries that do not have coordinate sequences)
        self._set_cs() 
开发者ID:VirtualPlants,项目名称:tissuelab,代码行数:13,代码来源:geometry.py

示例2: has_cs

# 需要导入模块: from django.contrib.gis.geos import point [as 别名]
# 或者: from django.contrib.gis.geos.point import Point [as 别名]
def has_cs(self):
        "Returns True if this Geometry has a coordinate sequence, False if not."
        # Only these geometries are allowed to have coordinate sequences.
        if isinstance(self, (Point, LineString, LinearRing)):
            return True
        else:
            return False 
开发者ID:VirtualPlants,项目名称:tissuelab,代码行数:9,代码来源:geometry.py

示例3: project

# 需要导入模块: from django.contrib.gis.geos import point [as 别名]
# 或者: from django.contrib.gis.geos.point import Point [as 别名]
def project(self, point):
        if not isinstance(point, Point):
            raise TypeError('locate_point argument must be a Point')
        if not isinstance(self, (LineString, MultiLineString)):
            raise TypeError('locate_point only works on LineString and MultiLineString geometries')
        if not hasattr(capi, 'geos_project'):
            raise NotImplementedError('geos_project requires GEOS 3.2+')
        return capi.geos_project(self.ptr, point.ptr) 
开发者ID:VirtualPlants,项目名称:tissuelab,代码行数:10,代码来源:geometry.py

示例4: project_normalized

# 需要导入模块: from django.contrib.gis.geos import point [as 别名]
# 或者: from django.contrib.gis.geos.point import Point [as 别名]
def project_normalized(self, point):
        if not isinstance(point, Point):
            raise TypeError('locate_point argument must be a Point')
        if not isinstance(self, (LineString, MultiLineString)):
            raise TypeError('locate_point only works on LineString and MultiLineString geometries')
        if not hasattr(capi, 'geos_project_normalized'):
            raise NotImplementedError('project_normalized requires GEOS 3.2+')
        return capi.geos_project_normalized(self.ptr, point.ptr) 
开发者ID:VirtualPlants,项目名称:tissuelab,代码行数:10,代码来源:geometry.py

示例5: extent

# 需要导入模块: from django.contrib.gis.geos import point [as 别名]
# 或者: from django.contrib.gis.geos.point import Point [as 别名]
def extent(self):
        """
        Returns the extent of this geometry as a 4-tuple, consisting of
        (xmin, ymin, xmax, ymax).
        """
        env = self.envelope
        if isinstance(env, Point):
            xmin, ymin = env.tuple
            xmax, ymax = xmin, ymin
        else:
            xmin, ymin = env[0][0]
            xmax, ymax = env[0][2]
        return (xmin, ymin, xmax, ymax) 
开发者ID:VirtualPlants,项目名称:tissuelab,代码行数:15,代码来源:geometry.py


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