petern48 commented on PR #288:
URL: https://github.com/apache/sedona-db/pull/288#issuecomment-3507193414

   The first thing I'm going to do is check the corresponding PostGIS docs for 
ST_Reverse [here](https://postgis.net/docs/ST_Reverse.html), since this is the 
behavior I want to follow. I found this by simply searching "ST_Reverse 
PostGIS" on Google.
   
   Looking at the top, we see the function signature.
   
   <img width="300" height="35" alt="image" 
src="https://github.com/user-attachments/assets/ec77266e-04c3-46ba-a4ed-ca5377c09cba";
 />
   
   `geometry ST_Reverse(geometry g1);`
   
   The first "geometry" indicates the return type, the second "geometry" 
indicates the arguments to the function. So in whole, this function takes a 
single geometry as input and outputs a geometry. Now the best way to go about 
implementing this whole thing is to find a similar function to model it as. 
Luckily, I noticed ST_Centroid has the same argument and return types 
(`geometry ST_Centroid(geometry g1);`), and it's already implemented in 
SedonaDB here 
[st_centroid.rs](https://github.com/apache/sedona-db/blob/94ce7db5287b39218b803eae057a4eb92a50c397/c/sedona-geos/src/st_centroid.rs).
 Now I'll create my new `st_reverse.rs` file in the location 
`c/sedona-geos/src/` along with the other geos functions. AND I'm going to 
**COPY-PASTE** the contents of 
[st_centroid.rs](https://github.com/apache/sedona-db/blob/94ce7db5287b39218b803eae057a4eb92a50c397/c/sedona-geos/src/st_centroid.rs)
 into it because I know most of the code will be the same. Click on the 
following commit to see it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to