test
Documentation for the provided code:
Types:
Functions:
- getLocationFromGeoJSONPoint(data):
- Extracts the latitude and longitude from a GeoJSON point.
- Parameters:
- data: A partial GeoJsonPoint object or null/undefined.
- Returns:
- A GetLocationFromGeoJSONPointReturnType object with latitude and longitude if the data is valid, otherwise undefined.
Example usage:
const geojsonPoint = {
type: "Point",
coordinates: [-74.0060, 40.7128],
};
const location = getLocationFromGeoJSONPoint(geojsonPoint);
if (location) {
console.log(f"Latitude: {location.latitude}, Longitude: {location.longitude}");
} else {
console.log("Invalid GeoJSON point.");
}