6

The title is self-explanatory. I wonder if there is a simple function like ST_Force2D for the M values?

2
  • by "strip out" do you mean extract M values? or drop the M dimension?
    – Mike T
    Oct 3, 2014 at 0:31
  • @mikeT I mean drop the M dimension.
    – picardo
    Oct 3, 2014 at 0:32

2 Answers 2

7

The function is ST_Force3D if you have XYZM geometry, if it's XYM you should use ST_Force_2D.

From the manual:

  • ST_Force_2D — Forces the geometries into a "2-dimensional mode" so that all output representations will only have the X and Y coordinates.
  • ST_Force_3D — Forces the geometries into XYZ mode. This is an alias for ST_Force_3DZ.
  • ST_Force_3DZ — Forces the geometries into XYZ mode. This is a synonym for ST_Force_3D.
  • ST_Force_3DM — Forces the geometries into XYM mode.
  • ST_Force_4D — Forces the geometries into XYZM mode.
2

From Postgis 2.1.0. Reference

  • ST_Force2D — Force the geometries into a "2-dimensional mode".
  • ST_Force3D — Force the geometries into XYZ mode. This is an alias for ST_Force3DZ.
  • ST_Force3DZ — Force the geometries into XYZ mode.
  • ST_Force3DM — Force the geometries into XYM mode.
  • ST_Force4D — Force the geometries into XYZM mode.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.