def get_height_map(
        self,
        center_point,
        size=2048,
        pixels_per_meter=1,
        extension=2,
        height=1,
    ):
        """
        Get height of the map for terrain generation
        :param size: [m] length and width
        :param center_point: 2D point, the center to select the rectangular region
        :param pixels_per_meter: the returned map will be in (size*pixels_per_meter * size*pixels_per_meter) size
        :param extension: If > 1, the returned height map's drivable region will be enlarged.
        :param height: height of drivable area.
        :return: heightfield image in uint 16 nparray
        """
        center_p = center_point

        # if self._height_map is None:
        extension = max(1, extension)
        all_lanes = self.get_map_features()
        polygons = []

        for obj in all_lanes.values():
            if MetaDriveType.is_lane(obj["type"]):
                polygons.append(obj["polygon"])

        size = int(size * pixels_per_meter)
        mask = np.zeros([size, size, 1])

        need_scale = abs(extension - 1) > 1e-1

        for sidewalk in self.sidewalks.values():
            polygons.append(sidewalk["polygon"])

        for polygon in polygons:
            points = [
                [
                    int((x - center_p[0]) * pixels_per_meter + size / 2),
                    int((y - center_p[1]) * pixels_per_meter) + size / 2
                ] for x, y in polygon
            ]
            cv2.fillPoly(mask, np.asarray([points]).astype(np.int32), color=[height])
        if need_scale:
            # Define a kernel. A 3x3 rectangle kernel
            kernel = np.ones(((extension + 1) * pixels_per_meter, (extension + 1) * pixels_per_meter), np.uint8)

            # Apply dilation
            mask = cv2.dilate(mask, kernel, iterations=1)
            mask = np.expand_dims(mask, axis=-1)
        #     self._height_map = mask
        # return self._height_map
        return mask

        Get height of the map for terrain generation
        :param size: [m] length and width
        :param center_point: 2D point, the center to select the rectangular region
        :param pixels_per_meter: the returned map will be in (size*pixels_per_meter * size*pixels_per_meter) size
        :param extension: If > 1, the returned height map's drivable region will be enlarged.
        :param height: height of drivable area.
        :return: heightfield image in uint 16 nparray
        
metadrive/component/map/base_map.py