New answers tagged

0

I'm not sure if your points' centroids are next to your lines or exactly on the lines but if they are next to them, this might helps: Make sure that your original marker point layer, let's call it Original, has got a column including unique numbers for each point and call it "id", and another column, called "rotation_2" (real number). Using v.distance ...


0

You can use Coordinate (your Node) and LineString (your Segment) objects to solve the problem: // origin point Coordinate origin = new Coordinate(5, 0); // segments ArrayList<LineString> segmentList = new ArrayList(); LineString segmentA = new GeometryFactory().createLineString(new Coordinate[]{new Coordinate(0, 5), new Coordinate(5, 5)}); segmentList....


1

You can also just use the Intersect tool with one dataset as input as explained in How Intersect works: Intersect can run with a single input. In this case, instead of discovering intersections between the features from the different feature classes or layers, it will discover the intersections between features within the single input. This can be ...


1

Apologies for being vague, but this is a similar workflow i've used in ArcGIS and I'm sure it can translate to QGIS: Create a uniqueid for your Lakes Select by location Calculate code for Lakes Join uniqueid, code in new shapefile with Lakes uniqueid layer Export new Lakes Layer, delete uniqueid column Or create a python script/tool that will: Iterate ...


0

What you could do 'select by location', selecting only those lakes that fall within a county. Then update 'code' with the county code. I'm sure python could make this a lot faster.


1

After much trial and error, I went for a Python script to solve my problem as I want to get the Longitudes of the crossings in between nodes rather than getting the closest node. In retrospect, I should have been more clear about that in my question. Here's my code: from qgis.core import * from qgis.gui import * import qgis.utils import numpy as np """...


1

You could calculate lat and lon as attributes in you shapefile and then use the "select features using an expression" tool. Important to make sure that the lat and lon are using the same precision and scale as the coordinate that you are searching for. Amended - included steps for using the "Select features using an expression tool" You mentioned in your ...


0

Your script is too complex, simple use the modulo function def azimuth(point1, point2): '''azimuth between 2 shapely points (interval 0 - 360)''' angle = np.arctan2(point2.x - point1.x, point2.y - point1.y) return np.degrees(angle)if angle>0 else np.degrees(angle) + 360 azimuth(interP,P2) 112.61986494834154 azimuth(P2,interP) 292....


1

In order to calculate the angle P1-InterPoint-P2: Calculate the difference of the azimuths InterPoint-P1 and Interpoint-P2. Mind you that you have to investigate the azimuth according to the quadrant that it lies, so: if dx>0 & dy>0 : final azimith=azimuth if dx<0 & dy>0 : final azimuth=180-azimuth if dx<0 & dy<0: final ...


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 ...



Top 50 recent answers are included