Example #1
0
    def rewind(self):
        """Rewind vector map to cause reads to start at beginning. ::

            >>> test_vect = VectorTopo(test_vector_name)
            >>> test_vect.open(mode='r')
            >>> test_vect.next()
            Point(10.000000, 6.000000)
            >>> test_vect.next()
            Point(12.000000, 6.000000)
            >>> test_vect.next()
            Point(14.000000, 6.000000)
            >>> test_vect.rewind()
            >>> test_vect.next()
            Point(10.000000, 6.000000)
            >>> test_vect.close()

        ..
        """
        libvect.Vect_rewind(self.c_mapinfo)
Example #2
0
    def rewind(self):
        """Rewind vector map to cause reads to start at beginning. ::

            >>> mun = VectTopo('boundary_municp_sqlite')
            >>> mun.open()
            >>> mun.next()
            Boundary(v_id=1)
            >>> mun.next()
            Boundary(v_id=2)
            >>> mun.next()
            Boundary(v_id=3)
            >>> mun.rewind()
            >>> mun.next()
            Boundary(v_id=1)
            >>> mun.close()

        ..
        """
        libvect.Vect_rewind(self.c_mapinfo)
Example #3
0
    def rewind(self):
        """Rewind vector map to cause reads to start at beginning. ::

            >>> cens = VectorTopo('census')
            >>> cens.open(mode='r')
            >>> cens.next()
            Boundary(v_id=1)
            >>> cens.next()
            Boundary(v_id=2)
            >>> cens.next()
            Boundary(v_id=3)
            >>> cens.rewind()
            >>> cens.next()
            Boundary(v_id=1)
            >>> cens.close()

        ..
        """
        libvect.Vect_rewind(self.c_mapinfo)
Example #4
0
 def rewind(self):
     """Rewind vector map to cause reads to start at beginning."""
     if libvect.Vect_rewind(self.c_mapinfo) == -1:
         raise GrassError("Vect_rewind raise an error.")