Posts tagged with 'ST_Transform'

ST_Transform and ST_SetSRID: To project or not to project?

People often get confused between the ST_Transform and ST_SetSRID functions.

  1. ST_SetSRID doesn’t change the coordinates but adds meta data to state what spatial reference system the coordinate actually are. If you stamped your WGS 84 long lat data as a meter based projection. Guess what? Its still long lat. A spade by any other name is still a spade so don’t use ST_SetSRID and expect to magically get meter coordinates.

  2. ST_Transform is used to change the underlying coordinates from a known spatial reference system to another known spatial reference system.

In PostGIS 2+ it’s pretty easy to correct mistakes you’ve made with standard ALTER TABLE commands. We’ll demonstrate a couple of scenarios

Read More…