Trespassing can occur on both private and public properties. While one might be inclined to think that public properties/buildings imply public access sans restrictions or permission, it is not always true. Certain public establishments may not be always open to the public, may have areas for which you need permission to enter, and may have other entry restrictions in place. Please refer to this resource for more information and clarity.