mirror of
https://github.com/K-Dense-AI/claude-scientific-skills.git
synced 2026-03-27 07:09:27 +08:00
Improve GeoMaster skill with Rust support, troubleshooting, and modern workflows
Major improvements to the GeoMaster geospatial science skill: ### New Features - Added Rust geospatial support (GeoRust crates: geo, proj, shapefile, rstar) - Added comprehensive coordinate systems reference documentation - Added troubleshooting guide with common error fixes - Added cloud-native workflows (STAC, Planetary Computer, COG) - Added automatic skill activation configuration ### Reference Documentation - NEW: references/coordinate-systems.md - CRS fundamentals, UTM zones, EPSG codes - NEW: references/troubleshooting.md - Installation fixes, runtime errors, performance tips - UPDATED: references/programming-languages.md - Now covers 8 languages (added Rust) ### Main Skill File - Streamlined SKILL.md from 690 to 362 lines (500-line rule compliance) - Enhanced installation instructions with uv and conda - Added modern cloud-native workflow examples - Added performance optimization tips ### Documentation - NEW: GEOMASTER_IMPROVEMENTS.md - Complete changelog and testing guide - UPDATED: README.md - Highlight new capabilities ### Skill Activation - Created skill-rules.json with 150+ keywords and 50+ intent patterns - Supports file-based and content-based automatic activation The skill now covers 8 programming languages (Python, R, Julia, JavaScript, C++, Java, Go, Rust) with 500+ code examples across 70+ geospatial topics.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Multi-Language Geospatial Programming
|
||||
|
||||
Geospatial programming across 7 languages: R, Julia, JavaScript, C++, Java, Go, and Python.
|
||||
Geospatial programming across 8 languages: R, Julia, JavaScript, C++, Java, Go, Rust, and Python.
|
||||
|
||||
## R Geospatial
|
||||
|
||||
@@ -391,3 +391,66 @@ func main() {
|
||||
```
|
||||
|
||||
For more code examples across all languages, see [code-examples.md](code-examples.md).
|
||||
|
||||
## Rust Geospatial
|
||||
|
||||
### GeoRust (Geographic Rust)
|
||||
|
||||
The Rust geospatial ecosystem includes crates for geometry operations, projections, and file I/O.
|
||||
|
||||
\`\`\`rust
|
||||
// Cargo.toml dependencies:
|
||||
// geo = "0.28"
|
||||
// geo-types = "0.7"
|
||||
// proj = "0.27"
|
||||
// shapefile = "0.5"
|
||||
|
||||
use geo::{Coord, Point, LineString, Polygon, Geometry};
|
||||
use geo::prelude::*;
|
||||
use proj::Proj;
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
// Create a point
|
||||
let point = Point::new(-122.4_f64, 37.7_f64);
|
||||
|
||||
// Create a linestring
|
||||
let linestring = LineString::new(vec![
|
||||
Coord { x: -122.4, y: 37.7 },
|
||||
Coord { x: -122.3, y: 37.8 },
|
||||
Coord { x: -122.2, y: 37.9 },
|
||||
]);
|
||||
|
||||
// Create a polygon
|
||||
let polygon = Polygon::new(
|
||||
LineString::new(vec![
|
||||
Coord { x: -122.4, y: 37.7 },
|
||||
Coord { x: -122.3, y: 37.7 },
|
||||
Coord { x: -122.3, y: 37.8 },
|
||||
Coord { x: -122.4, y: 37.8 },
|
||||
Coord { x: -2.4, y: 37.7 }, // Close the ring
|
||||
]),
|
||||
vec![], // No interior rings
|
||||
);
|
||||
|
||||
// Geometric operations
|
||||
let buffered = polygon.buffer(1000.0); // Buffer in CRS units
|
||||
let centroid = polygon.centroid();
|
||||
let convex_hull = polygon.convex_hull();
|
||||
let simplified = polygon.simplify(&1.0); // Tolerance
|
||||
|
||||
// Spatial relationships
|
||||
let point_within = point.within(&polygon);
|
||||
let line_intersects = linestring.intersects(&polygon);
|
||||
|
||||
// Coordinate transformation
|
||||
let from = "EPSG:4326";
|
||||
let to = "EPSG:32610";
|
||||
let proj = Proj::new_known_crs(from, to, None)?;
|
||||
let transformed = proj.convert(point)?;
|
||||
|
||||
println!("Point: {:?}", point);
|
||||
println!("Within polygon: {}", point_within);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
\`\`\`
|
||||
|
||||
Reference in New Issue
Block a user