def setUp(self): self.polygons = rf(get_path('Polygon.shp')) self.points = rf(get_path('Point.shp')) self.lines = rf(get_path('Line.shp')) self.target_poly = self.polygons.geometry[2] self.target_point = self.points.geometry[1] self.target_line = self.lines.geometry[0] self.dframes = [self.polygons, self.points, self.lines] self.targets = [self.target_poly, self.target_point, self.target_line]
def setUp(self): import pandas as pd self.columbus = pdio.read_files(get_path('columbus.shp')) grid = [Polygon([(0,0),(0,1),(1,1),(1,0)]), Polygon([(0,1),(0,2),(1,2),(1,1)]), Polygon([(1,2),(2,2),(2,1),(1,1)]), Polygon([(1,1),(2,1),(2,0),(1,0)])] regime = [0,0,1,1] ids = range(4) data = np.array((regime, ids)).T self.exdf = pd.DataFrame(data, columns=['regime', 'ids']) self.exdf['geometry'] = grid
def setUp(self): import pandas as pd self.columbus = pdio.read_files(get_path('columbus.shp')) grid = [ Polygon([(0, 0), (0, 1), (1, 1), (1, 0)]), Polygon([(0, 1), (0, 2), (1, 2), (1, 1)]), Polygon([(1, 2), (2, 2), (2, 1), (1, 1)]), Polygon([(1, 1), (2, 1), (2, 0), (1, 0)]) ] regime = [0, 0, 1, 1] ids = range(4) data = np.array((regime, ids)).T self.exdf = pd.DataFrame(data, columns=['regime', 'ids']) self.exdf['geometry'] = grid
def test_get_path(self): pathparts = os.path.normpath(ex.get_path('')).split(os.path.sep) self.localpath = os.path.join(*pathparts[-2:]) self.assertEquals(self.localpath, os.path.normpath('pysal/examples/'))
def test_get_path(self): pathparts = ex.get_path('').split('/') self.localpath = '/'.join(pathparts[-3:]) self.assertEquals(self.localpath, 'pysal/examples/')
def test_get_path(self): pathparts = ex.get_path("").split("/") self.localpath = "/".join(pathparts[-3:]) self.assertEquals(self.localpath, "pysal/examples/")