def test_write_prj(self): epsg = '3031' writer = ShapeFileWriter() writer.write_prj(self.test_path, epsg) head, _ = os.path.splitext(self.test_path) p = '{}.prj'.format(head) self.assertTrue(os.path.isfile(p))
def test_write_prj(self): epsg='3031' writer = ShapeFileWriter() writer.write_prj(self.test_path, epsg) head, _=os.path.splitext(self.test_path) p='{}.prj'.format(head) self.assertTrue(os.path.isfile(p))
def export_shapefile(self): writer=ShapeFileWriter() p=os.path.join(paths.disseration, 'data','minnabluff','gis','test_points.shp') if writer.write_points(p, points=self.points, attrs=('sample', 'material', 'age', 'age_error')): if self.confirmation_dialog('Shape file saved to {}\n\n Do you want to open in QGIS ?'.format(p)): self.view_file(p, application='QGIS') else: self.warning_dialog('Failed saving shape file')
def test_something(self): writer = ShapeFileWriter() p=self.test_path if os.path.isfile(p): os.unlink(p) writer.write_points(p, points=self.points, attrs=('sample', 'material','age', 'age_error')) self.assertTrue(os.path.isfile(p))
def export_shapefile(self): from pychron.geo.shape_file_writer import ShapeFileWriter writer = ShapeFileWriter() p = os.path.join(paths.disseration, 'data', 'minnabluff', 'gis', 'test_points.shp') if writer.write_points(p, points=self.points, attrs=('sample', 'material', 'age', 'age_error')): if self.confirmation_dialog('Shape file saved to {}\n\n Do you want to open in QGIS ?'.format(p)): self.view_file(p, application='QGIS') else: self.warning_dialog('Failed saving shape file')
def make_sample_shape_file(dbname): geo = get_processor(dbname) attrs = ['sample', 'material', 'labnumber'] atypes = ['C', 'C', 'C'] attrs = zip(attrs, atypes) if geo.connect(): groups = make_sample_points(geo) writer = ShapeFileWriter() for name, pts in groups: # print name, pts p = os.path.join(paths.dissertation, 'data', 'minnabluff', 'gis', '{}.shp'.format(name)) if writer.write_points(p, points=pts, attrs=attrs): pass
def write_shape_file(pts, attrs, p): writer = ShapeFileWriter() writer.write_points(p, points=pts, attrs=attrs)