| Crates.io | tin-sea-geo-macros |
| lib.rs | tin-sea-geo-macros |
| version | 0.1.2 |
| created_at | 2025-10-13 00:30:34.172355+00 |
| updated_at | 2025-10-13 00:30:34.172355+00 |
| description | A Rust procedural macro library that provides convenient geographic information processing capabilities for SeaORM. |
| homepage | https://github.com/JiabinTang/tin-sea-geo-macros |
| repository | https://github.com/JiabinTang/tin-sea-geo-macros |
| max_upload_size | |
| id | 1879869 |
| size | 13,559 |
为 SeaORM 提供地理信息处理功能的 Rust 过程宏库。
[dependencies]
tin-sea-geo-macros = "0.1.0"
use tin_sea_geo_macros::with_geometry;
#[with_geometry]
struct Building {
id: i32,
name: String,
// 自动添加: geometry: String
}
use tin_sea_geo_macros::with_centroid;
#[with_centroid]
struct Location {
id: i32,
address: String,
// 自动添加: centroid: String
}
use tin_sea_geo_macros::with_geo;
#[with_geo]
struct District {
id: i32,
name: String,
// 自动添加: geometry: String 和 centroid: String
}
transform: 是否进行坐标转换(默认: true)srid: 目标坐标系 SRID(默认: 4326)db_field: 数据库几何字段名(默认: "geom")field: 生成的字段名MIT