[postgis-devel] ST_GeometrySplit
Chris Hodgson
chodgson at refractions.net
Wed Mar 10 10:38:04 PST 2010
Works for the line case though:
select st_astext(st_difference( st_geomfromtext('LINESTRING(0 0, 0 2)'),
st_geomfromtext('LINESTRING(-1 1, 1 1)')));
st_astext
--------------------------------------
MULTILINESTRING((0 0,0 1),(0 1,0 2))
Perhaps the point case is a precision issue? Or I don't know the exact
spec for this function.
Not the result I expect for the polygon-line case either:
select st_astext(st_difference( st_geomfromtext('POLYGON((0 0, 0 2, 2 0,
0 0))'), st_geomfromtext('LINESTRING(-1 1, 2 1)')));
st_astext
------------------------------------
POLYGON((0 0,0 1,0 2,1 1,2 0,0 0))
I'm running on old stuff here, maybe someone can check on a newer version...
select postgis_full_version();
postgis_full_version
-------------------------------------------------------------------------------------
POSTGIS="1.3.3" GEOS="3.0.0-CAPI-1.4.1" PROJ="Rel. 4.6.1, 21 August
2008" USE_STATS
Chris
Chris Hodgson wrote:
> Hmm... nevermind, I guess it's not.
>
> select st_astext(st_difference( st_geomfromtext('LINESTRING(0 0, 0
> 2)'), st_geomfromtext('POINT(0 1)')));
> st_astext ---------------------
> LINESTRING(0 0,0 2)
>
> Chris
>
> Chris Hodgson wrote:
>> Isn't this the same as st_difference(A,B), when given any of those
>> pairs of arguments? Wrap it in an st_dump() if you want to separate
>> the individual results?
>>
>> Chris
>>
>> strk wrote:
>>> Brain picking you guys about a ST_GeometrySplit.
>>>
>>> The cases of interest seem to be:
>>> - Split polygon by line
>>> - Split line by line
>>> - Split line by point
>>>
>>> Initial questions:
>>> - Should we allow multi-segment "blade" lines ?
>>> (where a single polygon or line might be cut in multiple pieces)
>>> - Should we allow multi-component inputs ?
>>> (where the "blade" might cut a single component)
>>>
>>> Both questions are related to the kind of returned output,
>>> that is: should output be always composed by 2 parts or
>>> possibly multiple parts ?
>>>
>>> Comments welcome.
>>>
>>> --strk;
>>>
>>> () Free GIS & Flash consultant/developer
>>> /\ http://strk.keybit.net/services.html
>>> _______________________________________________
>>> postgis-devel mailing list
>>> postgis-devel at postgis.refractions.net
>>> http://postgis.refractions.net/mailman/listinfo/postgis-devel
>>>
>>
>> _______________________________________________
>> postgis-devel mailing list
>> postgis-devel at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-devel
>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel
More information about the postgis-devel
mailing list