0

Is there a way to run st_split from within QGIS? I am looking to split a polygon with a line feature. My data is stored in a PostGIS database, and I would like to perform this operation from within QGIS. I am aware of PG_Query for QGIS, but st_split is not a tool within the plugin.

Thanks...

  • only Vector>Data Management>Split Vector Layers but creates a shapfile can be imported into PostGIS with spit plugin – Mapperz Oct 4 '13 at 16:09
3

You can directly access PostGIS in QGIS to issue the sql command as follows:

  • add your db connection via Layer -- Add PostGIS Layer.
  • under Database -- DB Manager. connect to database. open the SQL Window.
  • issue the sql to split the line.

simple select statement to display in QGIS (click Load as Layer at bottom sql window):

select row_number() over() as id, st_split(line.the_geom,polygon.the_geom) as the_geom from line,polygon

create new table in postgis to hold:

create table new_data as select row_number() over() as id, st_split(line.the_geom,polygon.the_geom) as the_geom from line,polygon

st_split page entry

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.