Fractal geometry for modeling and measuring urban patterns