How can I remove SRID information from PostGIS geometry? Is
ST_SetSRID(geom, 0) well-defined?
I am rendering maps, using PostGIS. To do this, I create a temporary table, and populate it by
ST_Transform():ing my geometries from EPSG:4326 to my desired map projection (usually EPSG:3006, SWEREF99TM) and using
ST_Affine() to scale and translate them into map coordinates (90-per-inch units on the paper). I then do some processing on this temporary table (cartographic generalization of different kinds), before marshalling it all out to the styling stage.
Apparently, the result of
ST_Affine(ST_Transform(..., srid), ...) is considered to be “in” that SRID, even though the
ST_Affine makes this dubious, at best. This means that whenever I want to add geometry from other sources into the mix, that, too, has to be tagged with that SRID, even though it is actually in “paper space”. This means that I have to keep track of the SRID in various places in my program, which are really only concerned with things like “25 mm from the left side of the paper”. If I don’t, PostGIS complains that I am doing
operations on geometries with different SRID:s.
It seems like PostGIS happily performs things like
ST_Intersects on geometries with no SRID, so if I could get everything to this state, I would be fine.