Fractal geometry of ecological habitats