This project allows users to interact with an AI to get location-specific details and visualize the location in Google Earth Pro. The backend service uses OpenCage geocoding API, Hugging Face’s Gemma model, and Google Earth Pro for visualization. It generates KML files based on AI-generated responses and opens them in Google Earth Pro for 3D visualization of locations.
- Location-Based Interaction: Ask the AI to take you to any location (e.g., "Take me to Mumbai") and get an interactive KML file that shows the location in Google Earth Pro.
- Geospatial Visualization: Uses KML (Keyhole Markup Language) to visualize geographical data in Google Earth Pro.
- AI Integration: Uses Hugging Face API for generating natural language responses based on the user input.
- Dynamic Geocoding: Uses the OpenCage API to translate location names into geographical coordinates.
- Node.js (>= 14.x)
- Google Earth Pro installed on your system.
- API Key for OpenCage and Hugging Face.
-
Clone the repository:
git clone https://github.com/your-username/your-repository.git cd your-repository -
Install the dependencies:
npm install
-
Create a
.envfile in the root directory of the project with the following content:HF_TOKEN=your_huggingface_api_token OPENCAGE_KEY=your_opencage_api_key -
Run the server:
node server.mjs
The backend server will run on
http://localhost:3001.
You can ask the AI to take you to a location, such as:
"Take me to Mumbai"
The AI will process the request, fetch the location details, and generate a KML file for visualization in Google Earth Pro. The generated KML file is to be opened in Google Earth Pro manually by the user.
-
Request Type: POST
-
URL:
http://localhost:3001/generate-kml -
Body:
{ "prompt": "Take me to Mumbai" }The server will return a JSON response with the generated KML file path and status.
{
"message": "KML generated and launched successfully!",
"location": "Mumbai"
}Once the KML file is generated, the user can manually open the file in Google Earth Pro to visually explore the location. Ensure that Google Earth Pro is installed and correctly set up on your system.
This project is licensed under the MIT License - see the LICENSE file for details.