These foundations are ruins of the former city fortifications. Nowadays, there are only a few walls left.
More information at Campeche Travel http://www.campeche.travel/bateria-de-san-matias/
Address 2 Avenida Gustavo Díaz Ordaz, Campeche 24020, Mexico
Coordinates 19°51'45.914" N -90°30'42.289" E