Geo-Web-Project / specs

1 stars 1 forks source link

How to enforce contiguous land parcels? #15

Closed codynhat closed 3 years ago

codynhat commented 3 years ago

A land parcel should only be allowed to be made up of contiguous geohashes. How can this be done?

codynhat commented 3 years ago

One potential strategy is for the contract to accept an ordered list of geohashes when claiming land. Each geohash must border the previous. The contract will need some logic to determine whether two geohashes share a border. This is a linear operation scaling with the number of geohashes a plot of land makes up.

codynhat commented 3 years ago

Minting requires on input:

A path is an array of directions:

enum Direction { North, South, East, West }

Starting from the base geohash this path is followed, with each geohash along the way:

This is a concise way of ensuring a land parcel is contiguous and never overlaps with other parcels.

codynhat commented 3 years ago

@gravenp Should diagonal geohashes be considered contiguous? Is a parcel valid if it is made up of two geohashes, where they border corners?

gravenp commented 3 years ago

I'd lean toward no. The geohashes are small enough that any "normal" parcel of land can reasonably be assembled without needing diagonals. Seems like the diagonals would be potentially more useful for gaming the system (creating undesirable land parcels that block others out) than practical purposes.