2727import org .apache .sedona .common .geometryObjects .Box3D ;
2828import org .apache .sedona .flink .Box2DTypeSerializer ;
2929import org .apache .sedona .flink .Box3DTypeSerializer ;
30+ import org .apache .sedona .flink .GeographyTypeSerializer ;
3031import org .apache .sedona .flink .GeometryArrayTypeSerializer ;
3132import org .apache .sedona .flink .GeometryTypeSerializer ;
3233import org .geotools .api .referencing .FactoryException ;
@@ -106,6 +107,16 @@ public Double eval(
106107 Geometry geom = (Geometry ) o ;
107108 return org .apache .sedona .common .Functions .area (geom );
108109 }
110+
111+ @ DataTypeHint ("Double" )
112+ public Double eval (
113+ @ DataTypeHint (
114+ value = "RAW" ,
115+ rawSerializer = GeographyTypeSerializer .class ,
116+ bridgedTo = org .apache .sedona .common .S2Geography .Geography .class )
117+ org .apache .sedona .common .S2Geography .Geography geog ) {
118+ return org .apache .sedona .common .geography .Functions .area (geog );
119+ }
109120 }
110121
111122 public static class ST_AreaSpheroid extends ScalarFunction {
@@ -238,6 +249,50 @@ public Geometry eval(
238249 Geometry geom = (Geometry ) o ;
239250 return org .apache .sedona .common .Functions .buffer (geom , radius , useSpheroid , params );
240251 }
252+
253+ @ DataTypeHint (
254+ value = "RAW" ,
255+ rawSerializer = GeographyTypeSerializer .class ,
256+ bridgedTo = org .apache .sedona .common .S2Geography .Geography .class )
257+ public org .apache .sedona .common .S2Geography .Geography eval (
258+ @ DataTypeHint (
259+ value = "RAW" ,
260+ rawSerializer = GeographyTypeSerializer .class ,
261+ bridgedTo = org .apache .sedona .common .S2Geography .Geography .class )
262+ org .apache .sedona .common .S2Geography .Geography geog ,
263+ @ DataTypeHint ("Double" ) Double radius ) {
264+ return org .apache .sedona .common .geography .Functions .buffer (geog , radius );
265+ }
266+
267+ @ DataTypeHint (
268+ value = "RAW" ,
269+ rawSerializer = GeographyTypeSerializer .class ,
270+ bridgedTo = org .apache .sedona .common .S2Geography .Geography .class )
271+ public org .apache .sedona .common .S2Geography .Geography eval (
272+ @ DataTypeHint (
273+ value = "RAW" ,
274+ rawSerializer = GeographyTypeSerializer .class ,
275+ bridgedTo = org .apache .sedona .common .S2Geography .Geography .class )
276+ org .apache .sedona .common .S2Geography .Geography geog ,
277+ @ DataTypeHint ("Double" ) Double radius ,
278+ @ DataTypeHint ("Boolean" ) Boolean useSpheroid ) {
279+ return org .apache .sedona .common .geography .Functions .buffer (geog , radius , useSpheroid );
280+ }
281+
282+ @ DataTypeHint (
283+ value = "RAW" ,
284+ rawSerializer = GeographyTypeSerializer .class ,
285+ bridgedTo = org .apache .sedona .common .S2Geography .Geography .class )
286+ public org .apache .sedona .common .S2Geography .Geography eval (
287+ @ DataTypeHint (
288+ value = "RAW" ,
289+ rawSerializer = GeographyTypeSerializer .class ,
290+ bridgedTo = org .apache .sedona .common .S2Geography .Geography .class )
291+ org .apache .sedona .common .S2Geography .Geography geog ,
292+ @ DataTypeHint ("Double" ) Double radius ,
293+ @ DataTypeHint ("String" ) String parameters ) {
294+ return org .apache .sedona .common .geography .Functions .buffer (geog , radius , parameters );
295+ }
241296 }
242297
243298 public static class ST_BestSRID extends ScalarFunction {
@@ -360,6 +415,19 @@ public Geometry eval(
360415 Geometry geom = (Geometry ) o ;
361416 return org .apache .sedona .common .Functions .getCentroid (geom );
362417 }
418+
419+ @ DataTypeHint (
420+ value = "RAW" ,
421+ rawSerializer = GeographyTypeSerializer .class ,
422+ bridgedTo = org .apache .sedona .common .S2Geography .Geography .class )
423+ public org .apache .sedona .common .S2Geography .Geography eval (
424+ @ DataTypeHint (
425+ value = "RAW" ,
426+ rawSerializer = GeographyTypeSerializer .class ,
427+ bridgedTo = org .apache .sedona .common .S2Geography .Geography .class )
428+ org .apache .sedona .common .S2Geography .Geography geog ) {
429+ return org .apache .sedona .common .geography .Functions .centroid (geog );
430+ }
363431 }
364432
365433 public static class ST_Collect extends ScalarFunction {
@@ -504,6 +572,20 @@ public Geometry eval(
504572 Geometry geom = (Geometry ) o ;
505573 return org .apache .sedona .common .Functions .envelope (geom );
506574 }
575+
576+ @ DataTypeHint (
577+ value = "RAW" ,
578+ rawSerializer = GeographyTypeSerializer .class ,
579+ bridgedTo = org .apache .sedona .common .S2Geography .Geography .class )
580+ public org .apache .sedona .common .S2Geography .Geography eval (
581+ @ DataTypeHint (
582+ value = "RAW" ,
583+ rawSerializer = GeographyTypeSerializer .class ,
584+ bridgedTo = org .apache .sedona .common .S2Geography .Geography .class )
585+ org .apache .sedona .common .S2Geography .Geography geog ,
586+ @ DataTypeHint ("Boolean" ) Boolean splitAtAntiMeridian ) {
587+ return org .apache .sedona .common .geography .Functions .getEnvelope (geog , splitAtAntiMeridian );
588+ }
507589 }
508590
509591 public static class ST_Box2D extends ScalarFunction {
@@ -673,6 +755,21 @@ public Double eval(
673755 Geometry geom2 = (Geometry ) o2 ;
674756 return org .apache .sedona .common .Functions .distance (geom1 , geom2 );
675757 }
758+
759+ @ DataTypeHint ("Double" )
760+ public Double eval (
761+ @ DataTypeHint (
762+ value = "RAW" ,
763+ rawSerializer = GeographyTypeSerializer .class ,
764+ bridgedTo = org .apache .sedona .common .S2Geography .Geography .class )
765+ org .apache .sedona .common .S2Geography .Geography g1 ,
766+ @ DataTypeHint (
767+ value = "RAW" ,
768+ rawSerializer = GeographyTypeSerializer .class ,
769+ bridgedTo = org .apache .sedona .common .S2Geography .Geography .class )
770+ org .apache .sedona .common .S2Geography .Geography g2 ) {
771+ return org .apache .sedona .common .geography .Functions .distance (g1 , g2 );
772+ }
676773 }
677774
678775 public static class ST_DistanceSphere extends ScalarFunction {
@@ -809,6 +906,16 @@ public String eval(
809906 Geometry geom = (Geometry ) o ;
810907 return org .apache .sedona .common .Functions .geometryType (geom );
811908 }
909+
910+ @ DataTypeHint ("String" )
911+ public String eval (
912+ @ DataTypeHint (
913+ value = "RAW" ,
914+ rawSerializer = GeographyTypeSerializer .class ,
915+ bridgedTo = org .apache .sedona .common .S2Geography .Geography .class )
916+ org .apache .sedona .common .S2Geography .Geography geog ) {
917+ return org .apache .sedona .common .geography .Functions .geometryType (geog );
918+ }
812919 }
813920
814921 public static class ST_Intersection extends ScalarFunction {
@@ -844,6 +951,16 @@ public Double eval(
844951 Geometry geom = (Geometry ) o ;
845952 return org .apache .sedona .common .Functions .length (geom );
846953 }
954+
955+ @ DataTypeHint ("Double" )
956+ public Double eval (
957+ @ DataTypeHint (
958+ value = "RAW" ,
959+ rawSerializer = GeographyTypeSerializer .class ,
960+ bridgedTo = org .apache .sedona .common .S2Geography .Geography .class )
961+ org .apache .sedona .common .S2Geography .Geography geog ) {
962+ return org .apache .sedona .common .geography .Functions .length (geog );
963+ }
847964 }
848965
849966 public static class ST_Length2D extends ScalarFunction {
@@ -1319,6 +1436,16 @@ public Integer eval(
13191436 Geometry geom = (Geometry ) o ;
13201437 return org .apache .sedona .common .Functions .nPoints (geom );
13211438 }
1439+
1440+ @ DataTypeHint ("Integer" )
1441+ public Integer eval (
1442+ @ DataTypeHint (
1443+ value = "RAW" ,
1444+ rawSerializer = GeographyTypeSerializer .class ,
1445+ bridgedTo = org .apache .sedona .common .S2Geography .Geography .class )
1446+ org .apache .sedona .common .S2Geography .Geography geog ) {
1447+ return org .apache .sedona .common .geography .Functions .nPoints (geog );
1448+ }
13221449 }
13231450
13241451 public static class ST_NumGeometries extends ScalarFunction {
@@ -1332,6 +1459,16 @@ public Integer eval(
13321459 Geometry geom = (Geometry ) o ;
13331460 return org .apache .sedona .common .Functions .numGeometries (geom );
13341461 }
1462+
1463+ @ DataTypeHint ("Integer" )
1464+ public Integer eval (
1465+ @ DataTypeHint (
1466+ value = "RAW" ,
1467+ rawSerializer = GeographyTypeSerializer .class ,
1468+ bridgedTo = org .apache .sedona .common .S2Geography .Geography .class )
1469+ org .apache .sedona .common .S2Geography .Geography geog ) {
1470+ return org .apache .sedona .common .geography .Functions .numGeometries (geog );
1471+ }
13351472 }
13361473
13371474 public static class ST_NumInteriorRings extends ScalarFunction {
@@ -1387,6 +1524,16 @@ public String eval(
13871524 Geometry geom = (Geometry ) o ;
13881525 return org .apache .sedona .common .Functions .asEWKT (geom );
13891526 }
1527+
1528+ @ DataTypeHint ("String" )
1529+ public String eval (
1530+ @ DataTypeHint (
1531+ value = "RAW" ,
1532+ rawSerializer = GeographyTypeSerializer .class ,
1533+ bridgedTo = org .apache .sedona .common .S2Geography .Geography .class )
1534+ org .apache .sedona .common .S2Geography .Geography geog ) {
1535+ return org .apache .sedona .common .geography .Functions .asEWKT (geog );
1536+ }
13901537 }
13911538
13921539 public static class ST_AsText extends ScalarFunction {
@@ -1420,6 +1567,16 @@ public String eval(
14201567 Box3D box ) {
14211568 return org .apache .sedona .common .Functions .box3dAsText (box );
14221569 }
1570+
1571+ @ DataTypeHint ("String" )
1572+ public String eval (
1573+ @ DataTypeHint (
1574+ value = "RAW" ,
1575+ rawSerializer = GeographyTypeSerializer .class ,
1576+ bridgedTo = org .apache .sedona .common .S2Geography .Geography .class )
1577+ org .apache .sedona .common .S2Geography .Geography geog ) {
1578+ return org .apache .sedona .common .geography .Functions .asText (geog );
1579+ }
14231580 }
14241581
14251582 public static class ST_AsEWKB extends ScalarFunction {
0 commit comments