1

enter image description here

How to remove the line from inside the circle in QGIS?

  • Welcome to gis.stackexchange! Please note that a good question on this site is expected to show some degree of research on your part, i.e. what you have tried and - if applicable - code so far. For more info, you can check our faq. – underdark Jan 10 '17 at 19:33
  • Do you want to remove the entire line or just the line segment inside the circle? – Evan Carroll Jan 10 '17 at 20:17
  • Line segment inside the circle. – Brukarz Brukarz Jan 10 '17 at 20:36
  • Do you want to edit the vector data or are you aiming at a nice visualization? The latter probably requires the first, though. – user30184 Jan 10 '17 at 21:00
  • Im aiming at a nice visualization:) – Brukarz Brukarz Jan 10 '17 at 21:09
0

To demonstrate

  1. Create the x-point 0,0
  2. Create the y-point 3,0
  3. Create a circle around x-point with a radius of 1.
  4. Create a line from x-y.
  5. Find the difference between the line and the circle.
  6. Returns that as ST_AsText

Code,

WITH data AS (
    SELECT
      x AS point,
      ST_Buffer(x,1) AS circle,
      ST_MakeLine(x,y) AS line
    FROM ( VALUES
      (ST_MakePoint(0,0), ST_MakePoint(3,0))
    ) AS t(x, y)
)
SELECT ST_AsText(ST_Difference(line, circle))
FROM data;

Returns

      st_astext      
---------------------
 LINESTRING(1 0,3 0)

This excludes the circle (0,0) with a radius of one

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.