Exemplo n.º 1
0
    def set_shapefile(self, shapefile, idVariable=None, full=False):
        """
        Adding meta data for writing headers of gal and gwt files.

        Parameters
        ----------

        shapefile :     string
                        shapefile name used to construct weights

        idVariable :    string
                        name of attribute in shapefile to associate with ids in the weights

        full :          boolean
                        True - write out entire path for shapefile, False
                        (default) only base of shapefile without extension

        """

        if full:
            self._shpName = shapefile
        else:
            self._shpName = BASENAME(shapefile).split(".")[0]

        self._varName = idVariable
Exemplo n.º 2
0
    def set_shapefile(self, shapefile, idVariable=None, full=False):
        """
        Adding metadata for writing headers of ``.gal`` and ``.gwt`` files.

        Parameters
        ----------
        shapefile : str
            The shapefile name used to construct weights.
        idVariable : str
            The name of the attribute in the shapefile to associate
            with ids in the weights.
        full : bool
            Write out the entire path for a shapefile (``True``) or
            only the base of the shapefile without extension (``False``).
            Default is ``True``.
        """

        if full:
            self._shpName = shapefile
        else:
            self._shpName = BASENAME(shapefile).split(".")[0]

        self._varName = idVariable