Python django.contrib.gis.shortcuts.numpy.array() Examples

The following are code examples for showing how to use django.contrib.gis.shortcuts.numpy.array(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
Project: liberator   Author: libscie   File: linestring.py    Creative Commons Zero v1.0 Universal 5 votes vote down vote up
def _listarr(self, func):
        """
        Internal routine that returns a sequence (list) corresponding with
        the given function.  Will return a numpy array if possible.
        """
        lst = [func(i) for i in range(len(self))]
        if numpy:
            return numpy.array(lst)  # ARRRR!
        else:
            return lst 
Example 2
Project: liberator   Author: libscie   File: linestring.py    Creative Commons Zero v1.0 Universal 5 votes vote down vote up
def array(self):
        "Returns a numpy array for the LineString."
        return self._listarr(self._cs.__getitem__) 
Example 3
Project: liberator   Author: libscie   File: linestring.py    Creative Commons Zero v1.0 Universal 5 votes vote down vote up
def x(self):
        "Returns a list or numpy array of the X variable."
        return self._listarr(self._cs.getX) 
Example 4
Project: liberator   Author: libscie   File: linestring.py    Creative Commons Zero v1.0 Universal 5 votes vote down vote up
def y(self):
        "Returns a list or numpy array of the Y variable."
        return self._listarr(self._cs.getY) 
Example 5
Project: liberator   Author: libscie   File: linestring.py    Creative Commons Zero v1.0 Universal 5 votes vote down vote up
def z(self):
        "Returns a list or numpy array of the Z variable."
        if not self.hasz:
            return None
        else:
            return self._listarr(self._cs.getZ)


# LinearRings are LineStrings used within Polygons. 
Example 6
Project: PopularityBased-SearchEngine   Author: rsunder10   File: linestring.py    MIT License 5 votes vote down vote up
def _listarr(self, func):
        """
        Internal routine that returns a sequence (list) corresponding with
        the given function.  Will return a numpy array if possible.
        """
        lst = [func(i) for i in range(len(self))]
        if numpy:
            return numpy.array(lst)  # ARRRR!
        else:
            return lst 
Example 7
Project: PopularityBased-SearchEngine   Author: rsunder10   File: linestring.py    MIT License 5 votes vote down vote up
def array(self):
        "Returns a numpy array for the LineString."
        return self._listarr(self._cs.__getitem__) 
Example 8
Project: PopularityBased-SearchEngine   Author: rsunder10   File: linestring.py    MIT License 5 votes vote down vote up
def x(self):
        "Returns a list or numpy array of the X variable."
        return self._listarr(self._cs.getX) 
Example 9
Project: PopularityBased-SearchEngine   Author: rsunder10   File: linestring.py    MIT License 5 votes vote down vote up
def y(self):
        "Returns a list or numpy array of the Y variable."
        return self._listarr(self._cs.getY) 
Example 10
Project: PopularityBased-SearchEngine   Author: rsunder10   File: linestring.py    MIT License 5 votes vote down vote up
def z(self):
        "Returns a list or numpy array of the Z variable."
        if not self.hasz:
            return None
        else:
            return self._listarr(self._cs.getZ)


# LinearRings are LineStrings used within Polygons. 
Example 11
Project: Gypsy   Author: benticarlos   File: linestring.py    MIT License 5 votes vote down vote up
def _listarr(self, func):
        """
        Internal routine that returns a sequence (list) corresponding with
        the given function.  Will return a numpy array if possible.
        """
        lst = [func(i) for i in range(len(self))]
        if numpy:
            return numpy.array(lst)  # ARRRR!
        else:
            return lst 
Example 12
Project: Gypsy   Author: benticarlos   File: linestring.py    MIT License 5 votes vote down vote up
def array(self):
        "Returns a numpy array for the LineString."
        return self._listarr(self._cs.__getitem__) 
Example 13
Project: Gypsy   Author: benticarlos   File: linestring.py    MIT License 5 votes vote down vote up
def x(self):
        "Returns a list or numpy array of the X variable."
        return self._listarr(self._cs.getX) 
Example 14
Project: Gypsy   Author: benticarlos   File: linestring.py    MIT License 5 votes vote down vote up
def y(self):
        "Returns a list or numpy array of the Y variable."
        return self._listarr(self._cs.getY) 
Example 15
Project: Gypsy   Author: benticarlos   File: linestring.py    MIT License 5 votes vote down vote up
def z(self):
        "Returns a list or numpy array of the Z variable."
        if not self.hasz:
            return None
        else:
            return self._listarr(self._cs.getZ)


# LinearRings are LineStrings used within Polygons. 
Example 16
Project: tribune   Author: alex-muliande   File: linestring.py    MIT License 5 votes vote down vote up
def _listarr(self, func):
        """
        Internal routine that returns a sequence (list) corresponding with
        the given function.  Will return a numpy array if possible.
        """
        lst = [func(i) for i in range(len(self))]
        if numpy:
            return numpy.array(lst)  # ARRRR!
        else:
            return lst 
Example 17
Project: tribune   Author: alex-muliande   File: linestring.py    MIT License 5 votes vote down vote up
def array(self):
        "Returns a numpy array for the LineString."
        return self._listarr(self._cs.__getitem__) 
Example 18
Project: tribune   Author: alex-muliande   File: linestring.py    MIT License 5 votes vote down vote up
def x(self):
        "Returns a list or numpy array of the X variable."
        return self._listarr(self._cs.getX) 
Example 19
Project: tribune   Author: alex-muliande   File: linestring.py    MIT License 5 votes vote down vote up
def y(self):
        "Returns a list or numpy array of the Y variable."
        return self._listarr(self._cs.getY) 
Example 20
Project: tribune   Author: alex-muliande   File: linestring.py    MIT License 5 votes vote down vote up
def z(self):
        "Returns a list or numpy array of the Z variable."
        if not self.hasz:
            return None
        else:
            return self._listarr(self._cs.getZ)


# LinearRings are LineStrings used within Polygons. 
Example 21
Project: Django_To_Do   Author: IEEE-VIT   File: linestring.py    MIT License 5 votes vote down vote up
def _listarr(self, func):
        """
        Return a sequence (list) corresponding with the given function.
        Return a numpy array if possible.
        """
        lst = [func(i) for i in range(len(self))]
        if numpy:
            return numpy.array(lst)  # ARRRR!
        else:
            return lst 
Example 22
Project: Django_To_Do   Author: IEEE-VIT   File: linestring.py    MIT License 5 votes vote down vote up
def array(self):
        "Return a numpy array for the LineString."
        return self._listarr(self._cs.__getitem__) 
Example 23
Project: Django_To_Do   Author: IEEE-VIT   File: linestring.py    MIT License 5 votes vote down vote up
def x(self):
        "Return a list or numpy array of the X variable."
        return self._listarr(self._cs.getX) 
Example 24
Project: Django_To_Do   Author: IEEE-VIT   File: linestring.py    MIT License 5 votes vote down vote up
def y(self):
        "Return a list or numpy array of the Y variable."
        return self._listarr(self._cs.getY) 
Example 25
Project: Django_To_Do   Author: IEEE-VIT   File: linestring.py    MIT License 5 votes vote down vote up
def z(self):
        "Return a list or numpy array of the Z variable."
        if not self.hasz:
            return None
        else:
            return self._listarr(self._cs.getZ)


# LinearRings are LineStrings used within Polygons. 
Example 26
Project: openhgsenti   Author: drexly   File: linestring.py    Apache License 2.0 5 votes vote down vote up
def _listarr(self, func):
        """
        Internal routine that returns a sequence (list) corresponding with
        the given function.  Will return a numpy array if possible.
        """
        lst = [func(i) for i in range(len(self))]
        if numpy:
            return numpy.array(lst)  # ARRRR!
        else:
            return lst 
Example 27
Project: openhgsenti   Author: drexly   File: linestring.py    Apache License 2.0 5 votes vote down vote up
def array(self):
        "Returns a numpy array for the LineString."
        return self._listarr(self._cs.__getitem__) 
Example 28
Project: openhgsenti   Author: drexly   File: linestring.py    Apache License 2.0 5 votes vote down vote up
def x(self):
        "Returns a list or numpy array of the X variable."
        return self._listarr(self._cs.getX) 
Example 29
Project: openhgsenti   Author: drexly   File: linestring.py    Apache License 2.0 5 votes vote down vote up
def y(self):
        "Returns a list or numpy array of the Y variable."
        return self._listarr(self._cs.getY) 
Example 30
Project: openhgsenti   Author: drexly   File: linestring.py    Apache License 2.0 5 votes vote down vote up
def z(self):
        "Returns a list or numpy array of the Z variable."
        if not self.hasz:
            return None
        else:
            return self._listarr(self._cs.getZ)


# LinearRings are LineStrings used within Polygons. 
Example 31
Project: Hood   Author: Monroe100   File: linestring.py    MIT License 5 votes vote down vote up
def _listarr(self, func):
        """
        Internal routine that returns a sequence (list) corresponding with
        the given function.  Will return a numpy array if possible.
        """
        lst = [func(i) for i in range(len(self))]
        if numpy:
            return numpy.array(lst)  # ARRRR!
        else:
            return lst 
Example 32
Project: Hood   Author: Monroe100   File: linestring.py    MIT License 5 votes vote down vote up
def array(self):
        "Returns a numpy array for the LineString."
        return self._listarr(self._cs.__getitem__) 
Example 33
Project: Hood   Author: Monroe100   File: linestring.py    MIT License 5 votes vote down vote up
def x(self):
        "Returns a list or numpy array of the X variable."
        return self._listarr(self._cs.getX) 
Example 34
Project: Hood   Author: Monroe100   File: linestring.py    MIT License 5 votes vote down vote up
def y(self):
        "Returns a list or numpy array of the Y variable."
        return self._listarr(self._cs.getY) 
Example 35
Project: Hood   Author: Monroe100   File: linestring.py    MIT License 5 votes vote down vote up
def z(self):
        "Returns a list or numpy array of the Z variable."
        if not self.hasz:
            return None
        else:
            return self._listarr(self._cs.getZ)


# LinearRings are LineStrings used within Polygons. 
Example 36
Project: VirtualGym   Author: LuBrian   File: linestring.py    MIT License 5 votes vote down vote up
def _listarr(self, func):
        """
        Internal routine that returns a sequence (list) corresponding with
        the given function.  Will return a numpy array if possible.
        """
        lst = [func(i) for i in range(len(self))]
        if numpy:
            return numpy.array(lst)  # ARRRR!
        else:
            return lst 
Example 37
Project: VirtualGym   Author: LuBrian   File: linestring.py    MIT License 5 votes vote down vote up
def array(self):
        "Returns a numpy array for the LineString."
        return self._listarr(self._cs.__getitem__) 
Example 38
Project: VirtualGym   Author: LuBrian   File: linestring.py    MIT License 5 votes vote down vote up
def x(self):
        "Returns a list or numpy array of the X variable."
        return self._listarr(self._cs.getX) 
Example 39
Project: VirtualGym   Author: LuBrian   File: linestring.py    MIT License 5 votes vote down vote up
def y(self):
        "Returns a list or numpy array of the Y variable."
        return self._listarr(self._cs.getY) 
Example 40
Project: VirtualGym   Author: LuBrian   File: linestring.py    MIT License 5 votes vote down vote up
def z(self):
        "Returns a list or numpy array of the Z variable."
        if not self.hasz:
            return None
        else:
            return self._listarr(self._cs.getZ)


# LinearRings are LineStrings used within Polygons. 
Example 41
Project: Uber-django-   Author: zecollokaris   File: linestring.py    MIT License 5 votes vote down vote up
def _listarr(self, func):
        """
        Return a sequence (list) corresponding with the given function.
        Return a numpy array if possible.
        """
        lst = [func(i) for i in range(len(self))]
        if numpy:
            return numpy.array(lst)  # ARRRR!
        else:
            return lst 
Example 42
Project: Uber-django-   Author: zecollokaris   File: linestring.py    MIT License 5 votes vote down vote up
def array(self):
        "Return a numpy array for the LineString."
        return self._listarr(self._cs.__getitem__) 
Example 43
Project: Uber-django-   Author: zecollokaris   File: linestring.py    MIT License 5 votes vote down vote up
def x(self):
        "Return a list or numpy array of the X variable."
        return self._listarr(self._cs.getX) 
Example 44
Project: Uber-django-   Author: zecollokaris   File: linestring.py    MIT License 5 votes vote down vote up
def y(self):
        "Return a list or numpy array of the Y variable."
        return self._listarr(self._cs.getY) 
Example 45
Project: Uber-django-   Author: zecollokaris   File: linestring.py    MIT License 5 votes vote down vote up
def z(self):
        "Return a list or numpy array of the Z variable."
        if not self.hasz:
            return None
        else:
            return self._listarr(self._cs.getZ)


# LinearRings are LineStrings used within Polygons. 
Example 46
Project: aspiring_youth   Author: sunx2   File: linestring.py    MIT License 5 votes vote down vote up
def _listarr(self, func):
        """
        Return a sequence (list) corresponding with the given function.
        Return a numpy array if possible.
        """
        lst = [func(i) for i in range(len(self))]
        if numpy:
            return numpy.array(lst)  # ARRRR!
        else:
            return lst 
Example 47
Project: aspiring_youth   Author: sunx2   File: linestring.py    MIT License 5 votes vote down vote up
def array(self):
        "Return a numpy array for the LineString."
        return self._listarr(self._cs.__getitem__) 
Example 48
Project: aspiring_youth   Author: sunx2   File: linestring.py    MIT License 5 votes vote down vote up
def x(self):
        "Return a list or numpy array of the X variable."
        return self._listarr(self._cs.getX) 
Example 49
Project: aspiring_youth   Author: sunx2   File: linestring.py    MIT License 5 votes vote down vote up
def y(self):
        "Return a list or numpy array of the Y variable."
        return self._listarr(self._cs.getY) 
Example 50
Project: aspiring_youth   Author: sunx2   File: linestring.py    MIT License 5 votes vote down vote up
def z(self):
        "Return a list or numpy array of the Z variable."
        if not self.hasz:
            return None
        else:
            return self._listarr(self._cs.getZ)


# LinearRings are LineStrings used within Polygons. 
Example 51
Project: Karmo-Onsite-Judge   Author: chunky2808   File: linestring.py    MIT License 5 votes vote down vote up
def _listarr(self, func):
        """
        Internal routine that returns a sequence (list) corresponding with
        the given function.  Will return a numpy array if possible.
        """
        lst = [func(i) for i in range(len(self))]
        if numpy:
            return numpy.array(lst)  # ARRRR!
        else:
            return lst 
Example 52
Project: Karmo-Onsite-Judge   Author: chunky2808   File: linestring.py    MIT License 5 votes vote down vote up
def array(self):
        "Returns a numpy array for the LineString."
        return self._listarr(self._cs.__getitem__) 
Example 53
Project: Karmo-Onsite-Judge   Author: chunky2808   File: linestring.py    MIT License 5 votes vote down vote up
def x(self):
        "Returns a list or numpy array of the X variable."
        return self._listarr(self._cs.getX) 
Example 54
Project: Karmo-Onsite-Judge   Author: chunky2808   File: linestring.py    MIT License 5 votes vote down vote up
def y(self):
        "Returns a list or numpy array of the Y variable."
        return self._listarr(self._cs.getY) 
Example 55
Project: Karmo-Onsite-Judge   Author: chunky2808   File: linestring.py    MIT License 5 votes vote down vote up
def z(self):
        "Returns a list or numpy array of the Z variable."
        if not self.hasz:
            return None
        else:
            return self._listarr(self._cs.getZ)


# LinearRings are LineStrings used within Polygons. 
Example 56
Project: kasir   Author: iColdPlayer   File: linestring.py    MIT License 5 votes vote down vote up
def _listarr(self, func):
        """
        Return a sequence (list) corresponding with the given function.
        Return a numpy array if possible.
        """
        lst = [func(i) for i in range(len(self))]
        if numpy:
            return numpy.array(lst)  # ARRRR!
        else:
            return lst 
Example 57
Project: kasir   Author: iColdPlayer   File: linestring.py    MIT License 5 votes vote down vote up
def array(self):
        "Return a numpy array for the LineString."
        return self._listarr(self._cs.__getitem__) 
Example 58
Project: kasir   Author: iColdPlayer   File: linestring.py    MIT License 5 votes vote down vote up
def x(self):
        "Return a list or numpy array of the X variable."
        return self._listarr(self._cs.getX) 
Example 59
Project: kasir   Author: iColdPlayer   File: linestring.py    MIT License 5 votes vote down vote up
def y(self):
        "Return a list or numpy array of the Y variable."
        return self._listarr(self._cs.getY) 
Example 60
Project: kasir   Author: iColdPlayer   File: linestring.py    MIT License 5 votes vote down vote up
def z(self):
        "Return a list or numpy array of the Z variable."
        if not self.hasz:
            return None
        else:
            return self._listarr(self._cs.getZ)


# LinearRings are LineStrings used within Polygons. 
Example 61
Project: open-cabinet   Author: CivicTechTO   File: linestring.py    MIT License 5 votes vote down vote up
def _listarr(self, func):
        """
        Internal routine that returns a sequence (list) corresponding with
        the given function.  Will return a numpy array if possible.
        """
        lst = [func(i) for i in range(len(self))]
        if numpy:
            return numpy.array(lst)  # ARRRR!
        else:
            return lst 
Example 62
Project: open-cabinet   Author: CivicTechTO   File: linestring.py    MIT License 5 votes vote down vote up
def array(self):
        "Returns a numpy array for the LineString."
        return self._listarr(self._cs.__getitem__) 
Example 63
Project: open-cabinet   Author: CivicTechTO   File: linestring.py    MIT License 5 votes vote down vote up
def x(self):
        "Returns a list or numpy array of the X variable."
        return self._listarr(self._cs.getX) 
Example 64
Project: open-cabinet   Author: CivicTechTO   File: linestring.py    MIT License 5 votes vote down vote up
def y(self):
        "Returns a list or numpy array of the Y variable."
        return self._listarr(self._cs.getY) 
Example 65
Project: open-cabinet   Author: CivicTechTO   File: linestring.py    MIT License 5 votes vote down vote up
def z(self):
        "Returns a list or numpy array of the Z variable."
        if not self.hasz:
            return None
        else:
            return self._listarr(self._cs.getZ)


# LinearRings are LineStrings used within Polygons. 
Example 66
Project: voteswap   Author: sbuss   File: linestring.py    MIT License 5 votes vote down vote up
def _listarr(self, func):
        """
        Internal routine that returns a sequence (list) corresponding with
        the given function.  Will return a numpy array if possible.
        """
        lst = [func(i) for i in range(len(self))]
        if numpy:
            return numpy.array(lst)  # ARRRR!
        else:
            return lst 
Example 67
Project: voteswap   Author: sbuss   File: linestring.py    MIT License 5 votes vote down vote up
def array(self):
        "Returns a numpy array for the LineString."
        return self._listarr(self._cs.__getitem__) 
Example 68
Project: voteswap   Author: sbuss   File: linestring.py    MIT License 5 votes vote down vote up
def x(self):
        "Returns a list or numpy array of the X variable."
        return self._listarr(self._cs.getX) 
Example 69
Project: voteswap   Author: sbuss   File: linestring.py    MIT License 5 votes vote down vote up
def y(self):
        "Returns a list or numpy array of the Y variable."
        return self._listarr(self._cs.getY) 
Example 70
Project: voteswap   Author: sbuss   File: linestring.py    MIT License 5 votes vote down vote up
def z(self):
        "Returns a list or numpy array of the Z variable."
        if not self.hasz:
            return None
        else:
            return self._listarr(self._cs.getZ)


# LinearRings are LineStrings used within Polygons.