Descriptions
There are two main steps to conduct land survey:
1. Measure longitude and latitude of your desired land by using GPS.
2. Using HTML code to calculate the land area accurately.
1. Measure longitude and latitude of your desired land by using GPS:
Using a GPS-enabled smartphone to measure longitude and latitude of a land:
Step 1: Ensure your smartphone's GPS is enabled.
Step 2: Open the Maps app or any GPS-enabled app on your smartphone.
Step 3: Wait for the app to acquire your current location. It may take a few moments to get a reliable GPS fix.
Step 4: Once your location is determined, the app should display your latitude and longitude on the screen. Typically, the values are shown in decimal degrees format.
For example, the latitude might look like: 37.7749
And the longitude might look like: -122.4194
Step 5: Take note of the latitude and longitude values.
And that's it! You've now measured your longitude and latitude using a GPS-enabled smartphone. Keep in mind that the accuracy of the GPS coordinates may vary depending on your location and the signal strength, but it should be reasonably accurate for most purposes.
2. Using HTML code to calculate the land area accurately:
Step 1: Open Notepad in your computer
Step 2: Copy the following code:1 and paste it to the notepad
Step 3: click the save button after naming index.html and close it
Step 4: Create a New folder and put the file inside it
Step 5: Open Fresh notepad again
Step 6: Copy the following code:2 and paste it to the notepad
Step 7:click the save button after naming survey.js and close it
Step 8: Keep the survey.js file in the same folder
Step 9: Now open it to your browser by clicking index.html file
You can calculate your expected area of land by pressing “calculate
Area” button.
The application will calculate and display the total surveyed area in square meters below the form.
Styling (Optional) You can add CSS styles to the head section of your HTML file to further customize the appearance of the web page.
You can enhance the application by adding more features, error handling, and validations as per your specific requirements.
And that’s the end of land survey!
Code: 1
<!DOCTYPE html>
<html>
<head>
<title>Land Survey Application</title>
<style>
/* Add your CSS styling here if needed */
</style>
</head>
<body>
<h1>Land Survey Application</h1>
<form id="surveyForm">
<label for="length">Length (in meters):</label>
<input type="number" id="length" required>
<br>
<label for="width">Width (in meters):</label>
<input type="number" id="width" required>
<br>
<button type="submit">Calculate Area</button>
</form>
<p>Total Surveyed Area: <span id="totalArea">0</span> sq. meters</p>
<script src="survey.js"></script>
</body>
</html>
Code: 2
// Function to calculate the total surveyed area
function calculateTotalArea() {
let length = parseFloat(document.getElementById("length").value);
let width = parseFloat(document.getElementById("width").value);
if (!isNaN(length) && !isNaN(width)) {
let totalArea = length * width;
document.getElementById("totalArea").textContent = totalArea.toFixed(2);
} else {
document.getElementById("totalArea").textContent = "Invalid input";
}
}
// Event listener to handle form submission
document.getElementById("surveyForm").addEventListener("submit", function(event) {
event.preventDefault(); // Prevent form submission and page reload
calculateTotalArea();
});
Add a review