コード例 #1
0
ファイル: core.py プロジェクト: lucashtnguyen/pygridtools
    def from_shapefile(cls, shapefile, icol='ii', jcol='jj'):
        """
        Build a ModelGrid from a shapefile of *nodes*.

        Parameters
        ----------
        outputfile : str
            The name of the shapefile of the grid *nodes*.
        icol, jcol : str, optional
            The names of the columns in the shapefile containing the
            I/J index of the nodes.

        Returns
        -------
        ModelGrid

        """

        df = iotools.readGridShapefile(shapefile, icol=icol, jcol=jcol)
        return cls.from_dataframes(df['easting'], df['northing'])
コード例 #2
0
ファイル: test_iotools.py プロジェクト: phobson/pygridtools
 def test_read_cellfile(self):
     result_df = iotools.readGridShapefile(self.cell_file)
     pdtest.assert_frame_equal(result_df, self.known_df)
コード例 #3
0
ファイル: test_iotools.py プロジェクト: phobson/pygridtools
 def test_read_pointfile(self):
     result_df = iotools.readGridShapefile(self.point_file, othercols=self.ocols)
     pdtest.assert_frame_equal(result_df, self.known_df)