geoc_gcj02tobd09.sql 761 B

123456789101112131415161718192021222324252627
  1. CREATE OR REPLACE FUNCTION "public"."geoc_gcj02tobd09"("geom" "public"."geometry")
  2. RETURNS "public"."geometry" AS $BODY$
  3. DECLARE
  4. BEGIN
  5. IF st_srid(geom) != '4490' and st_srid(geom) != '4326'THEN
  6. RETURN null;
  7. end if;
  8. case ST_GeometryType(geom)
  9. when 'ST_LineString' then
  10. return geoc_gcj02tobd09_line(geom);
  11. when 'ST_MultiLineString' then
  12. return geoc_gcj02tobd09_multiline(geom);
  13. when 'ST_Point' then
  14. return geoc_gcj02tobd09_point(geom);
  15. when 'ST_MultiPoint' then
  16. return geoc_gcj02tobd09_multipoint(geom);
  17. when 'ST_Polygon' then
  18. return geoc_gcj02tobd09_polygon(geom);
  19. when 'ST_MultiPolygon' then
  20. return geoc_gcj02tobd09_multipolygon(geom);
  21. ELSE
  22. RETURN null;
  23. END CASE;
  24. END;
  25. $BODY$
  26. LANGUAGE plpgsql VOLATILE
  27. COST 100