se_createsrtext.sql 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. -- This example demonstrates how to use the SE_CreateSrtext function
  2. -- to generate the OpenGIS Well-Known Text for a spatial reference
  3. -- coordinate system. This text string can be used in the srtext column
  4. -- of a spatial_references table entry.
  5. --
  6. -- SE_CreateSrtext will return the text string associated with the numeric
  7. -- constants in the ESRI Projection Engine definitions header file.
  8. -- This file is included with the Informix Spatial DataBlade and can be
  9. -- found in $INFORMIXDIR/extend/spatial.<version>/include/pedefs.h.
  10. --
  11. -- Note that not all constants in this file define coordinate systems;
  12. -- some constants define coordinate system "building blocks" such as
  13. -- units of measure, spheroids, datums, projections, etc. SE_CreateSrtext
  14. -- will still return the text strings for these components, but they
  15. -- cannot be used in the srtext column of a spatial_references entry.
  16. -- Only the PE_GCS_xxx and PE_PCS_xxx constants define full coordinate
  17. -- systems.
  18. -- Example #1: Clarke 1866 Ellipsoid. This by itself is not a
  19. -- coordinate system!
  20. EXECUTE FUNCTION SE_CreateSrtext(7008);
  21. -- Example #2: North American Datum 1983, unprojected:
  22. EXECUTE FUNCTION SE_CreateSrtext(4269);
  23. -- Example #3: UTM zone 17, northern hemisphere, WGS 1984 datum:
  24. EXECUTE FUNCTION SE_CreateSrtext(32617);
  25. -- Tip: You can transfer the output of SE_CreateSrtext directly into
  26. -- the spatial_references table with the following SQL statement.
  27. -- This example assumes that srid 1000 already exists.
  28. UPDATE spatial_references
  29. SET srtext = SE_CreateSrtext(4269) WHERE srid = 1000;