Tag Info

New answers tagged

1

There are a couple of options. Option 1 You could do the query exactly like you have it, then add your linestring using GeoJSON on the client. You'd use CartoDB.js to draw you polygon layer and then use Leaflet to add the GeoJSON layer on top. Option 2 Use a multilayer visualization. The bottom layer you could have as you polygons (styled accordingly. ...


0

The Microsoft Developer Network help docs seem promising. Here is an example from the help on to test for intersection: DECLARE @geom1 geometry; DECLARE @geom2 geometry; DECLARE @result geometry; SELECT @geom1 = GeomCol1 FROM SpatialTable WHERE id = 1; SELECT @geom2 = GeomCol1 FROM SpatialTable WHERE id = 2; SELECT @result = @geom1.STIntersection(@geom2); ...


2

You need to think in terms of analytic geometry or vector geometry: I illustrate the approach with the first example (same with the others) with PyQGIS here but you can also use Shapely. You need to create a segment in the direction of line1 and calculate the point of intersection with line2. 1) Find the azimuth of line1 (How do I find vector line bearing ...


1

I can't give you python code (haven't used it for a while), but I hope that I can help you with a logic. To clarify: "Line" extends in both directions infinitely. If it does have ends it is called a "Line Segment". You will need to write 2 simple functions (I can post source code in Java if you need it): intersectionOfTwoLines(line1StartPoint, ...


0

A workaround would be to re-add the attributes after doing the clip, while converting from SpatialPolygons to SpatialPolygonsDataFrame. clip = gDifference(spdf1,spdf2, byid=TRUE) row.names(clip) = c("p1","p2") spdf3 <-SpatialPolygonsDataFrame(clip,data=as.data.frame(spdf1@data)) spdf3@data variable1 variable2 p1 232 235 p2 242 ...


4

There is few resolutions of this issue, maybe there are few better ones but this two should do also: 'By hand' (in steps) Cut every line with another line which intersects it Create table road_1 as Select row_number() over() as ID, input.name, (st_dump(st_split(input.geom, blade.geom))).geom as geom from roads input join roads blade ...


0

You can use PostGIS ST_NODE function or if you have PostGIS > 2.0 and want to do a cleaner job considering topology, you can follow instructions in this blog


0

For some project i had the same need. Much more than keeping the data.frame, we had to put in place further code to manage output geometry type, and proceed to some cleaning (e.g. clean geometry collections), to have some complete intersection geoprocess. In case you still need to do such a task in R, you can try the RFigisGeo package: #install RFigisGeo ...


2

Using QGIS 2.2 you can use the v.select function from GRASS to select features from one layer and how you want to select those features (if they overlap, touch, intersect etc) from another layer:


4

You can use Select By Location and then switch the selection by right clicking the layer that has the selection and choosing "Selection" and then "Switch Selection". The image shows something similar to how you might select the points that are identical. The final step would be to export the selection that remains after the switch by right-clicking the layer ...



Top 50 recent answers are included