ST_Transform function dosen't support on mapd 4.1


#1

Hi,
I have a sql with St_Transform() function. But mapd dosen’t support this function. You can see my sql below.

select ST_Transform(mapd_geo, 900913) from MapPolygon Where ST_DISTANCE(ST_GeomFromText( ‘POLYGON((30.790879726409912 38.82883467963268,30.793320536613464 38.8288346796326,30.793320536613464 38.8317264905966,30.790879726409912 38.83172649059667, 30.790879726409912 38.82883467963268))’, 4326),mapd_geo )=0

Result:
Exception: Function ST_Transform not supported

Note:I am using mapd cpu 4.1 docker version.

Thanks
Kayhan


#2

Hi Kayhan,

ST_Transform is not currently supported in projections.
But it can be used to transform geo inputs to other functions, for example, you can calculate your distance in webmercator, which would be in meters:

select ST_DISTANCE(ST_Transform(ST_GeomFromText( ‘POLYGON((30.790879726409912 38.82883467963268,30.793320536613464 38.8288346796326,30.793320536613464 38.8317264905966,30.790879726409912 38.83172649059667, 30.790879726409912 38.82883467963268))’, 4326), 900913), ST_Transform(mapd_geo, 900913) ) from MapPolygon


#3

Hi Dash,

Actually I want to use St_Distance function as a St_Contains function. Because St_Contains dosen’t work on mapd 4.1 cpu docker version. My solution use St_Distance function in where condition.


#4

Sure, ST_Distance is a viable approximation for ST_Contains.
We’ll look into the issues you’re having with ST_Contains.


#5

Thank you very much.