A comprehensive Full-Stack application for analyzing and visualizing lunar elemental composition data. This project integrates a Python Flask backend for data processing with a Next.js frontend for interactive visualization.
This application enables users to:
- Input lunar coordinates (latitude/longitude)
- Analyze elemental composition (Magnesium vs Sodium, Calcium, Iron, Aluminum, Silicon)
- Generate interactive maps with SNR (Signal-to-Noise Ratio) detection
- Visualize lunar surface data with geographical overlays
Use Case: ISRO lunar mapping and scientific analysis for identifying mineral-rich regions on the Moon's surface.
Inter_IIT_13.0-main/
βββ Inter_iit_isro-main/ # Python Flask Backend
β βββ app.py # Flask application & route handlers
β βββ coordinate_skibidi.py # Map generation & polygon logic
β βββ requirement.txt # Python dependencies
β βββ data/ # Element composition CSV files
β β βββ Mg_vs_Na.csv
β β βββ Mg_vs_Ca.csv
β β βββ Mg_vs_Fe.csv
β β βββ Mg_vs_Al.csv
β β βββ Mg_vs_Si.csv
β βββ map_images/ # Pre-generated map HTML files
β βββ templates/ # Flask HTML templates
β β βββ index.html # Input form
β β βββ map.html # Map display
β βββ static/ # Static assets
β βββ css/styles.css
βββ Mapping_isro/ # Next.js Frontend
βββ package.json # Node dependencies
βββ tsconfig.json # TypeScript configuration
βββ next.config.ts # Next.js configuration
βββ app/ # Next.js app directory
βββ pages/ # Page routes
β βββ index.tsx # Home page
β βββ map.tsx # Map visualization page
β βββ api/process-data.ts # API routes
βββ components/ # React components
β βββ Layout.tsx
β βββ InputForm.tsx
β βββ earth.tsx
β βββ SolarSystem.tsx
β βββ Splash.tsx
βββ public/ # Static files
βββ styles/ # Global styles
- Python 3.8+
- Node.js 16+
- npm or yarn
-
Navigate to the backend directory:
cd Inter_iit_isro-main -
Install Python dependencies:
pip install -r requirement.txt
-
Run the Flask server:
python app.py
- Server runs on
http://localhost:5000
- Server runs on
-
API Endpoints:
GET /- Render input formPOST /generate_map- Generate map for given coordinates
-
Navigate to the frontend directory:
cd Mapping_isro -
Install Node dependencies:
npm install # or yarn install -
Run the development server:
npm run dev # or yarn dev- Open http://localhost:3000 in your browser
-
Build for production:
npm run build npm start
The data/ directory contains CSV files with lunar element composition data:
| File | Description |
|---|---|
Mg_vs_Na.csv |
Magnesium vs Sodium distribution |
Mg_vs_Ca.csv |
Magnesium vs Calcium distribution |
Mg_vs_Fe.csv |
Magnesium vs Iron distribution |
Mg_vs_Al.csv |
Magnesium vs Aluminum distribution |
Mg_vs_Si.csv |
Magnesium vs Silicon distribution |
Data Format: Each CSV contains polygonal regions with SNR values for elemental analysis.
- Flask - Web framework
- Folium - Map visualization (uses NASA Moon imagery)
- Pandas - Data processing
- Shapely - Geometric operations
- Python - Core language
- Next.js - React framework
- React 18 - UI components
- TypeScript - Type safety
- Leaflet - Interactive maps
- Mapbox GL - Advanced mapping
- Three.js - 3D visualization
- Plotly.js - Data visualization
- Framer Motion - Animations
β
Coordinate Input - Enter lunar latitude/longitude
β
Elemental Analysis - View SNR data for 5 element combinations
β
Interactive Maps - Folium-based polygon visualization
β
NASA Imagery Integration - LRO WAC Mosaic base layer
β
Error Handling - Validation for invalid coordinates
β
Responsive Design - Mobile-friendly interface
- Multi-element comparison
- SNR-based polygon highlighting
- Dynamic color generation
- Polygon boundary detection
- Historical map caching
User Input (Latitude, Longitude)
β
Flask Form Submission
β
Backend Processing (generate_map)
β
CSV Data Lookup & Analysis
β
Shapely Polygon Detection
β
Folium Map Generation
β
HTML Output
β
Frontend Display
Request Body:
{
"latitude": "20.5",
"longitude": "35.2"
}Response:
- Success: HTML map with highlighted polygons
- Error: Error message (invalid coordinates or no polygons found)
Error Codes:
ValueError- Invalid numerical inputKeyError- Missing form parametersException- General server error
- Debug mode enabled by default (change in production)
- Port:
5000 - Template directory:
templates/ - Static directory:
static/
- Port:
3000 - API base:
/api/ - Environment variables configured in
.env.local
Flask - Web framework
pandas - Data manipulation
folium - Map visualization
shapely - Geometric operations
next - React framework
react - UI library
react-dom - React DOM
leaflet - Interactive maps
mapbox-gl - Advanced mapping
three - 3D graphics
plotly.js - Data charts
framer-motion - Animations
| Issue | Solution |
|---|---|
| Module not found (Python) | Run pip install -r requirement.txt |
| Port already in use | Change port in app.py or package.json |
| Invalid coordinates | Ensure latitude (-90 to 90) and longitude (-180 to 180) |
| No polygons found | Try different coordinates on lunar surface |
| Build errors (Next.js) | Run npm install and clear .next/ directory |
- Flask Documentation
- Next.js Documentation
- Folium Documentation
- Leaflet Documentation
- NASA Moon Imagery
Inter_IIT Project - Collaboration between IIT institutions
ISRO Lunar Mapping Initiative
This project is part of the Inter_IIT 13.0 competition. All rights reserved.
This application demonstrates:
- Full-Stack JavaScript/Python development
- Geospatial data processing
- Interactive map visualization
- Scientific data analysis
- Backend-Frontend integration
For issues or questions:
- Check the Troubleshooting section
- Review error messages in browser console
- Check Flask server logs
- Verify data files exist in
data/directory
Last Updated: February 2026
Version: 1.0.0