New answers tagged

1

In PostGIS, if you just want the row number you can do this: SELECT row_number() over () as gid, sbqry.geom FROM (SELECT ST_Intersection(land_parcels.geometry, flood_zone.geometry) AS geom FROM land_parcels, flood_zone WHERE ST_Intersects(land_parcels.geometry, flood_zone.geometry) AND NOT ST_Touches(land_parcels.geometry, ...


0

The Intersect tool, when run on polygon input(s), and requesting LINE output, will produce the result that you are after i.e. the lines in common to neighboring polygons. This is is described in the ArcGIS Help about how Intersect works. As noted by @klewis the lines that result are "duplicated" but this is easily addressed by running Dissolve on that ...


1

It can be done with Python but here, a solution with a virtual layer. Layer -> Add Layer -> Add Virtual Layer... In the "Query" field, use something like : WITH r AS ( SELECT c.pgid AS pgid, pg.geometry AS geometry /*:polygon:3163*/ , Line_Locate_Point(line.geometry, StartPoint(c.geometry) ) AS location FROM ( SELECT line.id AS lineid, pg.id as ...


1

you can use feature to line if you have an advanced licence (which is the case if you have split line at point). Below is a snapshot of the feature to line help in ArcGIS.


3

To do this efficiently you should read the 250,000 lines into a list with a da cursor (I assumed AO_Testing_Ln had the smaller number of features, but if AO_Fishnet_Testing has fewer lines it should be placed in the list instead). Then you should loop through a cursor on the Fishnet and loop through each line in the lineList to check for intersections. You ...


2

Why do you want to create a point output? Do the following: add a field and calculate the length of the "fligth line" intersect the "flight line" with the "buffer polygon" dissolve the "flight line buffer polygon line" depending on the "buffer polygon" calculate the length of the "flight line buffer polygon dissolve line" devide the length of the "flight ...


3

I've reproduced your problem and did some benchmarking. I've created an intersection between a polygon layer and with horizontal lines (every km), then with lines at 45°, and then with the same lines at 45° split every km vertically (which equals to sqrt(2) = 1,414 km). Here are the results of the intersection query: horizontal : 8.7 sec (no index) ...


0

This works: select row_to_json(t) from ( SELECT A.rid, pvc FROM rasterA A JOIN rasterB B ON ST_Intersects(A.rast, B.rast), ST_ValueCount(A.rast,1) AS pvc ) as t;



Top 50 recent answers are included