コード例 #1
0
ファイル: shapefile.py プロジェクト: waffle-iron/pychron
    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))
コード例 #2
0
ファイル: shapefile.py プロジェクト: OSUPychron/pychron
    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))
コード例 #3
0
ファイル: geo_task.py プロジェクト: jirhiker/pychron
    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')
コード例 #4
0
    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))
コード例 #5
0
ファイル: shapefile.py プロジェクト: OSUPychron/pychron
    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))
コード例 #6
0
ファイル: geo_task.py プロジェクト: waffle-iron/pychron
    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')
コード例 #7
0
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
コード例 #8
0
def write_shape_file(pts, attrs, p):
    writer = ShapeFileWriter()
    writer.write_points(p, points=pts,
                        attrs=attrs)