-
Notifications
You must be signed in to change notification settings - Fork 81
Description
📚 Overview
This feature enhances the Land Registry system by allowing users to register land using polygon boundaries rather than a single coordinate. The update will improve realism and verification against real-world land boundaries.
🔍 Background
Currently, the Land Registry smart contract uses the Location struct that supports only a single latitude/longitude pair, which is insufficient for representing actual land boundaries. With this update, users will be able to select multiple points on a map to form polygon boundaries. This effort will involve modifications to the smart contract, frontend UI, validation logic, and tests.
🛠️ Requirements & Tasks
-
Smart Contract Updates:
- Refactor the Location data structure to support a list of coordinates (Polygon) with a minimum of 3 points.
- Introduce new structs as proposed:
Coordinatewith latitude and longitude.Polygoncontaining an array ofCoordinate.
- Update contract events, functions, and data indexing logic to work with the new structure.
- Implement validations ensuring the submitted coordinates form a closed polygon.
-
Frontend Updates:
- Update the map interface to allow users to select multiple points for defining land boundaries.
- Ensure the UI guides users to select at least 3 coordinates for a valid polygon.
-
Testing:
- Update or create new tests to validate the new registration flow with polygon boundaries.
-
Migration/Backward Compatibility (if needed):
- Provide logic to handle or migrate existing land records stored with the old structure.
⚙️ Definition of Done
- Land can be registered with a polygon boundary comprising 3 or more coordinates.
- Coordinates selection is implemented and functional on the frontend map interface.
- All contract and frontend changes are thoroughly tested and deployed.
- The indexer (if applicable) supports the new location format.
📄 References
For additional context, refer to the README on project setup and architecture.
Let's get this feature rolled out to improve the accuracy and validity of our land registration process! 🚀