[Qgis-developer] Postgresql provider - Use ST_RemoveRepeatedPoints for server-side simplification

kimaidou kimaidou at gmail.com
Tue Dec 1 07:17:46 PST 2015


oups, gmail got rid of the table... Here is a human readable version

Method used --> vertex number

"geom" --> 3 763 284 |
st_snaptogrid( "geom", 407.618 ) --> 1 220 892
st_removerepeatedpoints( "geom", 407.618 ) --> 689 300
st_simplify( st_removerepeatedpoints( "geom", 407.618 ), 356.665, true )
--> 303 292


2015-12-01 16:15 GMT+01:00 kimaidou <kimaidou at gmail.com>:

> Hi,
>
> New PR update with addition of missing SIP bindings and use of ST_Simplify
> with third parameter "True" to decrease the size of data to download by
> QGIS.
> Please help to test with various data and report.
>
> Some quick results, with the same data and query as mentioned in the PR,
> to show how the number of vertexes decreases. It would lead to best
> performance also because the data will be downloaded from the PostGIS faster
> query number of vertexes "geom" 3 763 284 st_snaptogrid( "geom", 407.618 )
> 1 220 892 st_removerepeatedpoints( "geom", 407.618 ) 689 300 st_simplify(
> st_removerepeatedpoints( "geom", 407.618 ), 356.665, true ) 303 292
>
> Of course, this is done when viewing the whole layer (zoom to layer
> extent). For big scales, this PR will not improve so drastically the
> situation compared to the previous use if ST_SnapToGrid
>
> Should we not accept the PR so that many more users can try it with master
> branch ?
>
> Cheers
> Michaël
>
> 2015-11-27 14:27 GMT+01:00 kimaidou <kimaidou at gmail.com>:
>
>> Hi all,
>>
>> I updated my PR.
>> I made some quick tests, and it seems this PR can improve speed for
>> PostGIS layers ( with PostGIS 2.2 )
>> More details in the last comment [1]
>>
>> Please help to test it with a variety of data types and complexity.
>>
>> [1] https://github.com/qgis/QGIS/pull/2410#issuecomment-160138487
>>
>> Regards
>> Michaël aka "kimaidou"
>>
>> 2015-10-30 11:50 GMT+01:00 kimaidou <kimaidou at gmail.com>:
>>
>>> Hi all
>>>
>>> Following the blog post written by Paul Ramsey [1], I decided to propose
>>> using PostGIS 2.2 ST_RemoveRepeatedPoints function instead of ST_SnapToGrid
>>> to do the server side simplification
>>>
>>> We could also investigate other new features, such as the 3rd parameter
>>> for ST_Simplify, but we use St_SimplifyPreserveTopology in QGIS, and I do
>>> not think this function has got this new parameter too.
>>>
>>> I made a pull request : see [2]
>>> Please help me to test and review it
>>>
>>> [1] http://blog.cartodb.com/smaller-faster/
>>> [2] https://github.com/qgis/QGIS/pull/2410
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20151201/e2edf844/attachment.html>


More information about the Qgis-developer mailing list