OSM Linter
Advanced OSM linter for node and browsers
Install
npm
$ yarn osmlinter
web
API
closestEndNodes
Closest End Nodes, this validator detects if a line has ending nodes closer to other lines.
End Nodes touching lines are ignored.
JSOM Linter (Way end node near other highway)
Parameters
lines
(FeatureCollection | Feature<(LineString | MultiLineString)>) GeoJSON (Multi)LineString(s)options
Object? Optional parameters
Examples
const lines = turfconst endNodes = osmlinter//=endNodes
Returns FeatureCollection<Point> End nodes near other lines
index
Finds the angle between 3 points.
Parameters
startPoint
Array<number> Start Point CoordiantesmidPoint
Array<number> Mid Point CoordinatesendPoint
Array<number> End Point Coordinatesoptions
Examples
osmlinter//=45
Returns number angle
index
Detects if line is closed
Parameters
geojson
Feature<(LineString | MultiLineString | Polygon | MultiPolygon)> LineString(s) or Polygons(s)options
Object Optional parameters (optional, default{}
)
Examples
const line1 = turfconst line2 = turf osmlinter//=trueosmlinter//=false
Returns boolean true/false if line is closed
impossibleAngle
Impossible Angle, this validator detects lines with less likely turning angles.
Parameters
lines
(FeatureCollection | Feature<(LineString | MultiLineString)>) GeoJSON (Multi)LineString(s)options
Object? Optional parameters
Examples
const line = type: 'LineString' coordinates: 5 5 5 6 3 4osmlinter
Returns boolean true/false
isBuilding
Detects if geometry is highly likely to be a building
Parameters
geojson
Feature<(LineString | MultiLineString | Polygon | MultiPolygon)> LineString(s) or Polygons(s)options
Object Optional parameters (optional, default{}
)
Examples
const line = turf osmlinter//=true/false
Returns boolean true/false
isRiverbank
Detects if geometry is highly likely to be a riverbank
Parameters
geojson
Feature<(LineString | MultiLineString | Polygon | MultiPolygon)> LineString(s) or Polygons(s)options
Object Optional parameters (optional, default{}
)
Examples
const line = turf osmlinter//=true/false
Returns boolean true/false
totalNodes
Count the amount of Nodes in a GeoJSON Geometry
Parameters
geojson
GeoJSON GeoJSON
Examples
const line = turf osmlinter // => 2
Returns number Total number of nodes in GeoJSON