Happy #MapInfoMonday! And yes, the calendar shows Wednesday but during the release week for MapInfo Pro v2023, we decided to do #MapInfoMonday articles all week long!
Our Native TAB format has supported M and Z values for a long while, but we haven't done much to make this accessible to you. You have been able to use MapBasic to inspect M & Z values on objects brought into MapInfo Pro through formats like GeoJSON, ESRI Shape, and others.
With MapInfo Pro v2023, we have extended this in several ways.
The support for M & Z values allows you to assign two attributes at the node level. Until now, attributes have been assigned at the record level which meant that the entire object would hold a given value. With M & Z support, you can assign one or two values to the individual node of a polyline or polygon. This means the value can vary along your object.
A couple of examples where M & Z values can be useful. Imagine you are a fiber optic company laying down fibers. When you measure these, you also capture the elevation along the fiber. Until now, you would have to store that elevation in a separate table of points where the Z value would be stored in a column. With support for M & Z values, you can store the elevation on the node of the polyline.
The next step is to visualize your data in 3D. here you will be able to take advantage of the elevation stored on the nodes and position the fiber at the measured elevation. This should position your fiber lines underground.
It can of course also be lines hanging in the air like the example you can see in the 3D Map below.
Before you can take advantage of storing M & Z values in a MapInfo TAB file, the table needs to be configured to support M & Z. You do this in the New Table Structure dialog when you create the table. You will find the Support M/Z option just above the Projections... button.
Commit Table Rain_Water_Pipe As "C:\Sewer\Rain Water Pipe ZM.TAB" TYPE NATIVEX Charset "UTF-8" SupportMZ On
Create Map For Rain_Water_Pipe_ZM CoordSys Table Rain_Water_Pipe SupportMZ On
OBJ_GEO_POINTM and OBJ_GEO_POINTM. Here's an example for setting the Z value:
Alter Object oOutput Geography OBJ_GEO_POINTZ, fZ
For polylines and polygons, you must use the Node clause with the Alter Object statement and the Set Position option to specify values on existing nodes. Here is another example where I set the M value on an existing node. Notice how I omit the parameters for X, Y, and Z in this case as I don't want to change those.
Alter Object oOutput Node Set Position nSegment, nNode (, , , fM)
Hopefully this gives you some ideas on how to start using MapBasic to work with the Z and M values. I will also highlight that the source code for the DrawTools add-in which I will address in a moment can be found on GitHub. This may provide you with some additional resources for getting started. DrawTools takes advantage of a module - OBJECTMZLib - in the Common MapBasic libraries that also can be found on GitHub.The OBJECTMZLib holds functions that allow you to update a specific object with M and/or Z values. It also has functions for Offsetting objects in XYZ.
Only polygons, polylines, points, and multipoint objects support M & Z values.
Many object processing tools do not support M & Z values and will be disabled if the editable layer supports M & Z values. That's tools like Erase, Erase Outside, and others that modify your spatial object typically using another spatial object. This has been put in place to not lose the M 6 Z values assigned to the objects being processed. Object Processing can still be done via MapBasic statements but it will be up to the developer to handle potential M & Z values.
We will also be looking into adding Z/M support to EFAL, GDAL and our MIF/MID format.
If you want to give the new version of MapInfo Pro a try, grab a 30-day trial version and take it out for a spin. We would love your feedback!
As I mentioned above this is one of several #MapInfoMonday articles about the new features of MapInfo Pro v2023. Stay tuned for more!
------------------------------Peter Horsbøll MøllerPrincipal Presales Consultant | Distinguished EngineerPrecisely | Trust in Data------------------------------
A couple of questions:
1) Does MIF now support M/Z values?
2) If the old TAB format has supported it for many years, how do you create such a table from scratch, pre-2023? I remember to have seen it mentioned in the MFAL library, but never looked into it. It has a type called CSYS_MZ_INFO. EFAL seems to have functions for it too.
3) Do you have a sample table to download?
Thanks for these follow-up questions.
1) I have added that to the original post. We still need to add this support to EFAL, GDAL, and the MIF/MID format
2) This may be a question for @Bob Fortin.
3) I have attached a table with powerlines where the nodes have been assigned a Z value
re: #2 -- The support was there before, but only used when caching Z/M values upon opening shapefiles or geopackage and more recently OGR tables such as geojson. There was no way to create a table from scratch until this release.