You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have separate constructors if the caller wants to assume their data is a certain dimension. The hope is that the new constructors will be more performant since each coordinate doesn't require heap allocations. I'm not tied to these method names.
enumGeoJson<C>{Geometry(Geometry<C>),Feature(Feature<C>),FeatureCollection(FeatureCollection<C>),}impl<C>GeoJson<C>{/// Parse a string into `GeoJson`pubfnfrom_str(s:&str) -> Result<GeoJson<Vec<f32>>,Error>{ ...}/// Parse a string into `GeoJson`. Coordinates are assumed to have two dimensions./// If a non-two-dimensional coordinate is encountered, an error will be returned.pubfnfrom_str_2d(s:&str) -> Result<GeoJson<(f32,f32)>,Error>{ ...}/// Parse a string into `GeoJson`. Coordinates are assumed to have three dimensions./// If a non-three-dimensional coordinate is encountered, an error will be returned.pubfnfrom_str_3d(s:&str) -> Result<GeoJson<(f32,f32,f32)>,Error>{ ...}}enumValue<C>{Point(C),MultiPoint(Vec<C>),
...
}
The text was updated successfully, but these errors were encountered:
frewsxcv
changed the title
Idea: Separate constructors for different dimensions of coordinates
Separate constructors for different dimensions of coordinates
Jul 15, 2020
Have separate constructors if the caller wants to assume their data is a certain dimension. The hope is that the new constructors will be more performant since each coordinate doesn't require heap allocations. I'm not tied to these method names.
The text was updated successfully, but these errors were encountered: