How to use the @turf/line-intersect.default function in @turf/line-intersect

To help you get started, we’ve selected a few @turf/line-intersect examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github noncomputable / AgentMaps / tool / browserlessbuildings.js View on Github external
street_layers.eachLayer(function(street_layer) {
		status_update("Removing superfluous units from streets. Checking street " + i + " of " + street_layers.count() + "...");
		
		let street_feature = street_layer.feature;
		for (let unit_feature of processed_unit_features) {
			let intersection_exists = lineIntersect(street_feature, unit_feature).features.length > 0;
			if (intersection_exists) {
				processed_unit_features.splice(processed_unit_features.indexOf(unit_feature), 1, null);
			}	
		}	

		processed_unit_features = processed_unit_features.filter(feature => feature === null ? false : true);
		i++;
	});
github ngageoint / geopackage-js / lib / features / user / featureDao.js View on Github external
function verifyFeature(geometry, boundingBox) {
  try {
    if (geometry.type == 'Point') {
      return geometry;
    } else if (geometry.type == 'LineString') {
      var intersect = LineIntersect(geometry, boundingBox.toGeoJSON().geometry);
      if (intersect.features.length) {
        return geometry;
      } else if (BooleanWithin(geometry, boundingBox.toGeoJSON().geometry)) {
        return geometry;
      }
    } else if (geometry.type == 'Polygon') {
      var polyIntersect = Intersect(geometry, boundingBox.toGeoJSON().geometry);
      if (polyIntersect) {
        return geometry;
      } else if (BooleanWithin(geometry, boundingBox.toGeoJSON().geometry)) {
        return geometry;
      }
    }
  } catch (e) {}
}
github noncomputable / AgentMaps / src / buildings.js View on Github external
street_layers.eachLayer(function(street_layer) {
		let street_feature = street_layer.feature;
		for (let unit_feature of processed_unit_features) {
			let intersection_exists = lineIntersect(street_feature, unit_feature).features.length > 0;
			if (intersection_exists) {
				processed_unit_features.splice(processed_unit_features.indexOf(unit_feature), 1, null);
			}
		}	
	
		processed_unit_features = processed_unit_features.filter(feature => feature === null ? false : true);
	});

@turf/line-intersect

turf line-intersect module

MIT
Latest version published 4 months ago

Package Health Score

97 / 100
Full package analysis

Popular @turf/line-intersect functions