Пример #1
0
    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
 def test_read_cellfile(self):
     result_df = iotools.readGridShapefile(self.cell_file)
     pdtest.assert_frame_equal(result_df, self.known_df)
Пример #3
0
 def test_read_pointfile(self):
     result_df = iotools.readGridShapefile(self.point_file, othercols=self.ocols)
     pdtest.assert_frame_equal(result_df, self.known_df)