Repository navigation
Releases
Releases · mark1russell7/geo
v0.5.3
- Fix:
simplifyRegionsandregionSimplifiergive the same output as the search of each position, also near a pole. Since 0.3.2, the search of a span skips each position whose bound is less than the best angle. - Before, the bound of a position very near a pole was able to be less than its angle. So the search was able to skip a position with an angle that was larger than the best angle.
- The fix: the bound is the larger of the box bound and the probe value of the edge. The measure of the angle uses these two values. So the bound is not less than the angle, also in floating point.
- A property test of CI found this fault with a viewer at the south pole. A new test keeps that case.
- PATCH: a bug fix with no change of the public API. Thus the version is a PATCH change.
v0.5.2
bboxCentergives the middle of a box: the middle of its latitudes, and the middle of its arc of longitudes. For a box that crosses the antimeridian, the middle is on the arc across the antimeridian.- The closed box has the result, also when the width of the box is one rounding step.
- The middle is a place for a label of a region, or for the first view of a map. It is not the centroid of a shape.
- PATCH: a new export before 1.0.0. This change adds one function, and it changes no function. Thus the version is a PATCH change (before 1.0.0, a new feature is a PATCH change).
v0.5.1
bufferKmandbufferMetersare faster, with the same guarantee. Each point at a distance ofdistance - toleranceor less is in the result. Each point atdistance + toleranceor more is not.- The cells are larger. The diameter of a cell is 5/8 of the tolerance or less, from the haversine formula. Before, the side of a cell was 1/4 of the tolerance.
- The search of the nearest point of an edge stops when its result is within 1/16 of the tolerance. The center of a block of cells gives its value to a corner of the grid.
- A buffer uses approximately 9 cells for each tolerance of the length of its boundary. Before, it used approximately 16. On the cases of the bench, the trigonometric operations decrease 2.1 to 2.9 times.
- The positions of a result can change. The guarantee does not change.
- PATCH: faster functions, with no change of the API. Thus the version is a PATCH change.
v0.5.0
toUnitVectorgives a point as a vector with the length 1, on the axes of ECEF.fromUnitVectorgives the point in the direction of a vector. The new type isUnitVector.intermediatePointgives the point at a part of the way along the great circle between two points.densifygives a copy of a geometry with more positions on its edges. No part of an edge is longer than a step in degrees. Each new position is on the straight line in longitude and latitude of its edge.MAX_DENSIFY_POSITIONSis the limit of the new positions of one call ofdensify(1,000,000).- These functions are for a drawing on a globe:
densifymakes the edges short, andtoUnitVectorputs each position on the sphere. The README gives the rules. - The new error code
vectorrefuses a vector with the length 0. The new error codesteprefuses a step ofdensifythat is not more than 0, or that adds too many positions. - Fix:
bboxOfGeoJsongives the ends of each edge with no rounding. Before, the east of an edge waswest + (east - west)in floating point. So the box of the line from 1.1 to 6.8 had the east 6.799999999999999, and it did not contain the end of the line. - Fix: two edges with a common position give two arcs that touch. Before, a gap of one rounding step was possible between them. So the line through the longitudes -180, 0.1 and 180 got a box from 0.1 to 0.09999999999999432, not from -180 to 180.
GeoErrorCodehas two new values. A caller with a fullswitchon the codes must add them. Thus the version is a MINOR change (before 1.0.0, a breaking change is a MINOR change).
v0.4.4
bufferKmandbufferMetersgive the buffer of a GeoJSON geometry. The buffer is the area within a distance of the geometry, as a GeoJSON Polygon or MultiPolygon. Each point at a distance ofdistance - toleranceor less is in the result, and each point atdistance + toleranceor more is not. The README gives the rules.BufferOptionshas the optionstoleranceandmaxCells.DEFAULT_MAX_BUFFER_CELLSis the default limit of the cells (1,000,000).- The error codes
tolerance,max-cells,too-many-cellsandradiusalso refuse incorrect options of a buffer. - PATCH: new exports before 1.0.0. This change adds functions, and it changes no function. Thus the version is a PATCH change (before 1.0.0, a new feature is a PATCH change).
v0.4.3
distanceBetweenGeometriesKmanddistanceBetweenGeometriesMetersgive the great-circle distance between the nearest points of two GeoJSON geometries. The distance is 0 when the geometries have a common point. The README gives the rules.- This change adds two functions, and it does not change the existing API. Before 1.0.0, a new function is a PATCH change. Thus the version is a PATCH change.
v0.4.2
geodesicInversegives the length of the shortest geodesic between two points on an ellipsoid, and its bearings at the two points.geodesicDirectgives the point at a distance along a geodesic on an initial bearing.WGS84is the ellipsoid of WGS84, and the default of the two functions. The new types areEllipsoid,GeodesicInverseandGeodesicDirect.- The functions use the method of Karney (2013). The code is a port of GeographicLib 2.2.0 for JavaScript, with the MIT license. On WGS84, the tests hold a limit of 1e-6 m for a distance and 1e-9 degrees for a bearing or a position.
- The error code
radiusalso refuses an ellipsoid with an equatorial radius or a polar radius that is not more than 0. - PATCH: new exports before 1.0.0. This change adds functions, and it changes no function. Thus the version is a PATCH change (before 1.0.0, a new feature is a PATCH change).
v0.4.1
pointLocator(polygon)examines a polygon one time, and gives a function that locates each point. For each point, it gives the result oflocatePoint.- The locator puts the edges of each part in bands of latitude. A point examines only the edges of its band, with the exact test
rayEdgeof@mark1russell7/predicates0.1.5. - This change adds an export, and it does not change the old API. Thus the version is a PATCH change (before 1.0.0, a new feature is a PATCH change).
v0.4.0
circleKmandcircleMetersgive a circle on the Earth as a GeoJSON Polygon or MultiPolygon, for a map. A circle across the antimeridian is cut there. A circle around a pole has an edge along the pole. The README gives the rules.- The option
verticessets the number of the vertices. The default isDEFAULT_CIRCLE_VERTICES(64), and the limit isMAX_CIRCLE_VERTICES(65,536). - The new error code
verticesrefuses a number of vertices that is not an integer from 3 toMAX_CIRCLE_VERTICES. GeoErrorCodehas a new value. A caller with a fullswitchon the codes must add it. Thus the version is a MINOR change (before 1.0.0, a breaking change is a MINOR change).
v0.3.2
- Version 0.3.2 of
@mark1russell7/geoon npm.