Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determine geometry field at build time #9

Open
p4ken opened this issue Oct 6, 2024 · 1 comment
Open

Determine geometry field at build time #9

p4ken opened this issue Oct 6, 2024 · 1 comment

Comments

@p4ken
Copy link
Owner

p4ken commented Oct 6, 2024

No description provided.

@p4ken
Copy link
Owner Author

p4ken commented Oct 14, 2024

Plan 1

use geoserde::geometry;

#[derive(Default, Serialize)]
struct MyFeature {
    title: String,
    #[serde(with = "geometry")]
    location: Point,
}
  • missing geometry => runtime error

Plan 2

use geoserde::GeoSerde;

#[derive(Default, Serialize, GeoSerde)]
struct MyFeature {
    title: String,
    #[geoserde(geometry)]
    location: Point,
}
  • missing geometry => build error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant