Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I struggle to do split operation in postgis I tried to build a query but Im always fail.

Id like to cut a multipoligon with a blade (a linestring) into two pieces. These two objects have specific SRID of my country.

query:

CREATE TABLE Cut_result AS
SELECT ST_SPLIT(poligon,blade)
FROM (SELECT
ST_MakeLine(700264 126376, 780844 122481)::geometry(LINESTRING,23700) AS blade),
SELECT FROM county AS poligon;

ERROR

ERROR:  syntax error at or near "126376"
LINE 5: ST_MakeLine(700264 126376, 780844 122481)::geometry(LINESTRI...
                           ^
********** Error **********
share|improve this question

closed as unclear what you're asking by BradHards, PolyGeo, Fezter, Paul, Curlew Feb 8 at 10:43

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

    
It looks like you are mixing a table (county / poligon) and the geometry, but its hard to tell - perhaps you could tell us what happens instead of "Im always fail"? That is, we know it doesn't work, but an error message might help more. Also, what is the schema for county, and what do you expect Cut_result to look like? –  BradHards Feb 7 at 23:17
    
So I have a multipoligon called County which I want to cut into two pieces with a line called Blade. –  Balazs Feb 7 at 23:24
    
What table is the county multipolygon stored in? What do you want Cut-Result to look like? –  BradHards Feb 7 at 23:43
    
County is a table with geom and other columns. It is a multipoligon –  Balazs Feb 7 at 23:44
1  
I can't help you - there is no way to tell what the right commands would be unless you can tell me what the input data schema is. Sorry. –  BradHards Feb 8 at 0:18

1 Answer 1

The error you are seeing is because ST_MakeLine does not accept WKT style arguments. There are multiple usage options, but for you, probably something like:

ST_MakeLine(ST_MakePoint(700264, 126376, 23700), ST_MakePoint(780844, 122481, 23700))

will be best.

That may not fix the real problem (in that you aren't specifying the table that County multipolygon should be selected from), but since you didn't tell us that, we should make that a separate question if you need more help.

share|improve this answer

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