Tutorial: Magik Tips

Changing coordinate systems of a geometry

To cast a geometry in one coordinate system into another coordinate system,
use a coordinate system transform
transform.new_converting_cs_to_cs( from_cs, to_cs )

Note that from_cs and to_cs are coordinate system records, not the name of the coordinate system.

If from_cs or to_cs is longlat, then you probably want this record:
gis_program_manager.cached_dataset(:?????).collections[:sw_gis!coordinate_system].at("world_longlat_wgs84_degree")

So it would go something like this

  1. ll_xform « transform.new_converting_cs_to_cs( from_cs, ll_cs )
  2. a_ll_geom « a_geom.transform( ll_xform )
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License