Saturday 6 August 2016

ST_BestSRID function in PostGIS


This talk by Paul Ramsey mentions that there is a _ST_BestSRID function in PostGIS. I assume it exists to find the best projection when casting unprojected data for other uses.


I cannot find docs on this. Is it actually exposed, and if so, what are the parameters?



Answer



Yes that is correct. The functions that start with _ are not documented because they are what we consider "private" functions, not for general consumption.



If you look at the functions with smiley faces on this page: http://postgis.net/docs/PostGIS_Special_Functions_Index.html#PostGIS_TypeFunctionMatrix


You will see they all use this _ST_BestSRID functions (and there are two forms of that function). The smiley is meant to say these are functions using a hack, and not using pure geodetic calculate.


Study the code behind the smiley face functions and it should be clear how to use _STBestSRID in all its forms.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...