Section 1312. If a person has, in good faith, constructed a building encroaching on another person's land, the constructor is the owner of the building, subject to his paying the owner of the land for the use of such land and having his rights on the encroached land registered as servitude. The owner of the land may demand cancellation of the registration if subsequently the building is totally destroyed.
If the constructor of the building is in bad faith, the owner of the land may require that it be removed by the constructor and the land put in its former condition, at the expense of the latter.
Section 1313. If the conditional owner of a piece of land has constructed a building on it and the land becomes afterwards the property of another person by effect of the condition, the provisions of this Code concerning Undue Enrichment shall apply.
Section 1314. The provisions of Sections 1310, 1311 and 1313 apply mutatis mutandis to any kind of work which is fixed to land, and to the planting of trees or crops.
However, in case of paddy or other crops harvested one or more times a year, the owner of the land must either allow the person in good faith or the conditional owner who has made the planting to remain in the possession of the land till after the harvest on payment of a sum of money based on the rental value of the land, or take immediate possession of the land on payment of compensation to the other party.
Section 1315. When a person has constructed buildings, or has made any other work which is fixed to land, or has planted trees or crops, on his land with materials belonging to another person, he becomes the owner of the materials, but he must pay for their value.
Section 1316. If several movables belonging to different persons have been joined in such matter that they become component parts or indivisible, the different persons become co-owners of the composite thing, each person's share being proportionate to the value of his thing at the time of its being joined with the other things.
If one of the things could be regarded as the principal thing, the owner becomes the sole owner of the composite thing, but he must pay the value of the other things to their respective owners.
Section 1317. If a person uses materials belonging to another person to make a new thing, the latter person becomes the owner of such thing, irrespective of the question whether the materials can or cannot assume their former condition, but he must pay for the work.