Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pixel as centroids optimization #648

Merged
merged 6 commits into from
Nov 26, 2021

Conversation

mngr777
Copy link
Contributor

@mngr777 mngr777 commented Nov 25, 2021

  • ST_PixelAsCentroids, ST_PixelAsCentroid rewritten to use new C function RASTER_getPixelCentroids (mostly copied from RASTER_getPixelPolygons).
  • Test updated to add a case for rotated raster.

ST_PixelAsCentroids(rast, 1) execution time comparison for some sizes of raster:

Raster size Exec. time before Exec. time after
100x100 44.677 ms 4.228 ms
200x200 183.234 ms 17.441 ms
500x500 1144.930 ms 141.880 ms
1000x1000 4630.656 ms 573.416 ms
2000x2000 18302.578 ms 2290.872 ms
5000x5000 115014.318 ms 14121.408 ms

(On Intel Core i7-11370H @ 3.30GHz × 8, 16 Gb RAM)

Copy link
Member

@Komzpa Komzpa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please also add a line about this change into NEWS file that will credit it properly? Thanks.

raster/rt_pg/rtpg_geometry.c Outdated Show resolved Hide resolved
raster/rt_pg/rtpg_geometry.c Outdated Show resolved Hide resolved
@strk strk closed this in 98d041b Nov 26, 2021
@strk strk merged commit 6450b84 into postgis:master Nov 26, 2021
@mngr777 mngr777 deleted the pixel-as-centroids-optimization branch May 14, 2022 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants