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
Goal: Enhance methods of Point returning coordinate values as String
Need from entity classes with point geometries - making json element serialization easier.
Point and Bounds classes, new optional parameter fractionDigits, see method definitions updated:
/// Writes coordinate values to [buffer] delimited by [delimiter]. /// /// Use [fractionDigits] to set a number of decimals to nums with decimals.voidwriteValues(
StringSink buffer, {
String delimiter =',',
int? fractionDigits,
});
/// Returns coordinate values as a string delimimited by [delimiter]. /// /// Use [fractionDigits] to set a number of decimals to nums with decimals.StringvaluesAsString({
String delimiter =',',
int? fractionDigits,
});
Point class, new method:
/// Returns WKT coords (ie. "35 10" for a point with x=35 and y=10). /// /// Use [fractionDigits] to set a number of decimals to nums with decimals.StringtoWktCoords({int? fractionDigits}) =>valuesAsString(delimiter:' ', fractionDigits: fractionDigits);
Also internal utility function:
/// Uses `String.toStringAsFixed()` when [n] contains decimals./// /// For example returns '15' if a double value is 15.00, and '15.50' if a double/// value is 15.50./// /// See: https://stackoverflow.com/questions/39958472/dart-numberformatStringtoStringAsFixedWhenDecimals(num n, int fractionDigits) =>
n.toStringAsFixed(n.truncateToDouble() == n ?0: fractionDigits);
The text was updated successfully, but these errors were encountered:
Goal: Enhance methods of Point returning coordinate values as String
Need from entity classes with point geometries - making json element serialization easier.
Point
andBounds
classes, new optional parameterfractionDigits
, see method definitions updated:Point
class, new method:Also internal utility function:
The text was updated successfully, but these errors were encountered: