Actions for the recovery of real estate, the foreclosure of a mortgage or other lien thereon, the partition thereof, the determination in any form of an estate or interest therein, and for injuries to lands within this state, shall be tried in the county where such real estate or some part thereof is situated, subject to the power of the court to change the place of trial in the cases specified in section 542.11, clauses (1), (3), and (4). If the county designated in the complaint is not the proper county, the court therein shall have no jurisdiction of the action.