<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic MultiPartShapeBuffer::GetMs appears to return the wrong pointer value in File Geodatabase API Questions</title>
    <link>https://community.esri.com/t5/file-geodatabase-api-questions/multipartshapebuffer-getms-appears-to-return-the/m-p/228293#M397</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm having problems setting M values in a shapePolylineZM, and I suspect that the problem is that MultiPartShapeBuffer::GetMs() returns the wrong pointer value. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's the relevant section of my code that creates and writes the shape:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp; struct pointInfo
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; pointInfo(double _easting, double _northing, double _height, double _shotPoint) 
&amp;nbsp;&amp;nbsp; : easting(_easting), northing(_northing), height(_height), shotPoint(_shotPoint)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; double easting, northing, height, shotPoint;
&amp;nbsp; };
&amp;nbsp; vector&amp;lt;pointInfo&amp;gt; vPoints; // uses grid coordinates

&amp;nbsp; // ... add elements to vPoints, here ...

&amp;nbsp; // Now create and populate the geometry
&amp;nbsp; MultiPartShapeBuffer polyline;
&amp;nbsp; polyline.Setup(shapePolylineZM, 1 /*part*/, vPoints.size());

&amp;nbsp; Point* point;
&amp;nbsp; polyline.GetPoints(point);

&amp;nbsp; double* z;
&amp;nbsp; polyline.GetZs(z);

&amp;nbsp; double* m;
&amp;nbsp; polyline.GetMs(m);

&amp;nbsp; for (vector&amp;lt;pointInfo&amp;gt;::const_iterator iter = vPoints.begin(); iter != vPoints.end(); ++iter)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; *z = iter-&amp;gt;height;
&amp;nbsp;&amp;nbsp; runParameters.geo-&amp;gt;SetPointFromGrid(
&amp;nbsp;&amp;nbsp;&amp;nbsp; point++, 
&amp;nbsp;&amp;nbsp;&amp;nbsp; runParameters.geo-&amp;gt;MetersToDest(iter-&amp;gt;easting), 
&amp;nbsp;&amp;nbsp;&amp;nbsp; runParameters.geo-&amp;gt;MetersToDest(iter-&amp;gt;northing),
&amp;nbsp;&amp;nbsp;&amp;nbsp; z++);
&amp;nbsp;&amp;nbsp; *m++ = iter-&amp;gt;shotPoint;
&amp;nbsp; }

&amp;nbsp; polyline.CalculateExtent();
&amp;nbsp; row.SetGeometry(polyline);
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I run this code then inspect the output by:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- load the geodatabase in ArcCatalog &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- drag the feature class into ArcMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- edit the feature ("Sketch Properties") to see the M values&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I find that the M values are all in the wrong positions, offset by two.&amp;nbsp; Eg given input data x, y, z, m of&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;449419.597, 7772022.067, -104.192, 6459.000&lt;BR /&gt;449392.902, 7772057.754,&amp;nbsp; -97.530, 6460.000&lt;BR /&gt;449364.398, 7772096.582, -109.500, 6461.000&lt;BR /&gt;449342.910, 7772129.191, -105.321, 6462.000&lt;BR /&gt;...&lt;BR /&gt;410753.369, 7830191.197&amp;nbsp; -238.440, 7864.000&lt;BR /&gt;410726.857, 7830233.149, -245.280, 7865.000&lt;BR /&gt;410701.461, 7830273.902, -250.414, 7866.000&lt;BR /&gt;410673.267, 7830313.504, -242.441, 7867.000&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get these x, y, z, m values in the output&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;449419.597, 7772022.067, -104.192, 6461.000&lt;BR /&gt;449392.902, 7772057.754,&amp;nbsp; -97.530, 6462.000&lt;BR /&gt;449364.398, 7772096.582, -109.500, ...&lt;BR /&gt;449342.910, 7772129.191, -105.321, ...&lt;BR /&gt;...&lt;BR /&gt;410753.369, 7830191.197&amp;nbsp; -238.440, 7866.000&lt;BR /&gt;410726.857, 7830233.149, -245.280, 7867.000&lt;BR /&gt;410701.461, 7830273.902, -250.414, 0.000&lt;BR /&gt;410673.267, 7830313.504, -242.441, 0.000&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A similar discrepancy occurs when I read a geometry. Eg I create a new geodatabase and feature class in ArcCatalog, then use ArcMap's editor to insert a row with x, y, z, m:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;72.000, 38.518, 180.000, 41.000&lt;BR /&gt;74.328, 38.153, 181.000, 42.000&lt;BR /&gt;75.982, 35.619, 182.000, 43.000&lt;BR /&gt;78.201, 32.217, 183.000, 44.000&lt;BR /&gt;78.930, 30.795, 160.000, 45.000&lt;BR /&gt;80.105, 28.504, 161.000, 26.000&lt;BR /&gt;81.176, 26.415, 162.000, 27.000&lt;BR /&gt;83.455, 21.225, 163.000, 28.000&lt;BR /&gt;80.018, 15.917, 164.000, 29.000&lt;BR /&gt;84.599, 15.960, 165.000, 30.000&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then I use this code to read the geometry&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; 
 MultiPartShapeBuffer polyline;
 row.GetGeometry(polyline);

 ShapeType st;
 polyline.GetShapeType(st);
 assert(st == shapePolylineZM);

 int numPoints;
 polyline.GetNumPoints(numPoints);

 Point* p;
 polyline.GetPoints(p);

 double* m;
 polyline.GetMs(m);

 for (int i = 0; i &amp;lt; numPoints; ++i)
 {
&amp;nbsp; wcout &amp;lt;&amp;lt; p&lt;I&gt;.x &amp;lt;&amp;lt; "\t" &amp;lt;&amp;lt; p&lt;I&gt;.y &amp;lt;&amp;lt; "\t" &amp;lt;&amp;lt; m&lt;I&gt; &amp;lt;&amp;lt; endl;
 }
&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and I get this result:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;72&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 38.5182 26&lt;BR /&gt;74.328&amp;nbsp; 38.1528 45&lt;BR /&gt;75.9815 35.6188 41&lt;BR /&gt;78.2013 32.217&amp;nbsp; 42&lt;BR /&gt;78.9303 30.7952 43&lt;BR /&gt;80.105&amp;nbsp; 28.5039 44&lt;BR /&gt;81.1763 26.4145 45&lt;BR /&gt;83.4546 21.2247 26&lt;BR /&gt;80.0181 15.9173 27&lt;BR /&gt;84.5989 15.9598 28&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;again the M values are in the wrong postion, offset by 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It looks to me as if GetMs is returning the wrong value. In fact if I do this (after the code above):&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
 double *mExtent;
 err = polyline.GetMExtent(mExtent);
 wcout &amp;lt;&amp;lt; "pointers: " &amp;lt;&amp;lt; m &amp;lt;&amp;lt; ", " &amp;lt;&amp;lt; mExtent &amp;lt;&amp;lt; ", " &amp;lt;&amp;lt; m - mExtent &amp;lt;&amp;lt; endl;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can see that GetMExtent and GetMs return the same value, whereas I expected m to be 2*sizeof(double) higher than mExtent, in accordance with the structure described in Extended Shapefile Record Format, M data section, which shows MMin and MMax before Ms.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I increment the pointer returned by GetMs by two, eg by using this class:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
 class MultiPartShapeBuffer_fix : public FileGDBAPI::MultiPartShapeBuffer
 {
 public:
&amp;nbsp; fgdbError GetMs(double*&amp;amp; mArray) const
&amp;nbsp; { 
&amp;nbsp;&amp;nbsp; fgdbError err = MultiPartShapeBuffer::GetMs(mArray);
&amp;nbsp;&amp;nbsp; if (SUCCEEDED(err))
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; mArray += 2;
&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; return err;
&amp;nbsp; }
 };

 MultiPartShapeBuffer_fix polyline;
 ...
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;My code appears to work properly, both reading and writing the geometry.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem appears in both v1.1 and 1.2 of FileGDB API.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It doesn't affect Z, only M.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I haven't tried other shapes, eg shapeGeneralPolyline&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I doing something wrong, or is there a bug in the API library?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the library is correct, what am I doing wrong?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the library has a bug, does it affect other shapes? I'm particularly interested in:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
 MultiPartShapeBuffer polyline;
 polyline.Setup(static_cast&amp;lt;ShapeType&amp;gt;(shapeGeneralPolyline | shapeHasZs | shapeHasMs | shapeHasCurves), ...);
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;because I have code that uses it, and I need to know whether my fix applies to all shapes or only some.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 11:06:46 GMT</pubDate>
    <dc:creator>__11</dc:creator>
    <dc:date>2021-12-11T11:06:46Z</dc:date>
    <item>
      <title>MultiPartShapeBuffer::GetMs appears to return the wrong pointer value</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/multipartshapebuffer-getms-appears-to-return-the/m-p/228293#M397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm having problems setting M values in a shapePolylineZM, and I suspect that the problem is that MultiPartShapeBuffer::GetMs() returns the wrong pointer value. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's the relevant section of my code that creates and writes the shape:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp; struct pointInfo
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; pointInfo(double _easting, double _northing, double _height, double _shotPoint) 
&amp;nbsp;&amp;nbsp; : easting(_easting), northing(_northing), height(_height), shotPoint(_shotPoint)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; double easting, northing, height, shotPoint;
&amp;nbsp; };
&amp;nbsp; vector&amp;lt;pointInfo&amp;gt; vPoints; // uses grid coordinates

&amp;nbsp; // ... add elements to vPoints, here ...

&amp;nbsp; // Now create and populate the geometry
&amp;nbsp; MultiPartShapeBuffer polyline;
&amp;nbsp; polyline.Setup(shapePolylineZM, 1 /*part*/, vPoints.size());

&amp;nbsp; Point* point;
&amp;nbsp; polyline.GetPoints(point);

&amp;nbsp; double* z;
&amp;nbsp; polyline.GetZs(z);

&amp;nbsp; double* m;
&amp;nbsp; polyline.GetMs(m);

&amp;nbsp; for (vector&amp;lt;pointInfo&amp;gt;::const_iterator iter = vPoints.begin(); iter != vPoints.end(); ++iter)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; *z = iter-&amp;gt;height;
&amp;nbsp;&amp;nbsp; runParameters.geo-&amp;gt;SetPointFromGrid(
&amp;nbsp;&amp;nbsp;&amp;nbsp; point++, 
&amp;nbsp;&amp;nbsp;&amp;nbsp; runParameters.geo-&amp;gt;MetersToDest(iter-&amp;gt;easting), 
&amp;nbsp;&amp;nbsp;&amp;nbsp; runParameters.geo-&amp;gt;MetersToDest(iter-&amp;gt;northing),
&amp;nbsp;&amp;nbsp;&amp;nbsp; z++);
&amp;nbsp;&amp;nbsp; *m++ = iter-&amp;gt;shotPoint;
&amp;nbsp; }

&amp;nbsp; polyline.CalculateExtent();
&amp;nbsp; row.SetGeometry(polyline);
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I run this code then inspect the output by:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- load the geodatabase in ArcCatalog &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- drag the feature class into ArcMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- edit the feature ("Sketch Properties") to see the M values&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I find that the M values are all in the wrong positions, offset by two.&amp;nbsp; Eg given input data x, y, z, m of&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;449419.597, 7772022.067, -104.192, 6459.000&lt;BR /&gt;449392.902, 7772057.754,&amp;nbsp; -97.530, 6460.000&lt;BR /&gt;449364.398, 7772096.582, -109.500, 6461.000&lt;BR /&gt;449342.910, 7772129.191, -105.321, 6462.000&lt;BR /&gt;...&lt;BR /&gt;410753.369, 7830191.197&amp;nbsp; -238.440, 7864.000&lt;BR /&gt;410726.857, 7830233.149, -245.280, 7865.000&lt;BR /&gt;410701.461, 7830273.902, -250.414, 7866.000&lt;BR /&gt;410673.267, 7830313.504, -242.441, 7867.000&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get these x, y, z, m values in the output&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;449419.597, 7772022.067, -104.192, 6461.000&lt;BR /&gt;449392.902, 7772057.754,&amp;nbsp; -97.530, 6462.000&lt;BR /&gt;449364.398, 7772096.582, -109.500, ...&lt;BR /&gt;449342.910, 7772129.191, -105.321, ...&lt;BR /&gt;...&lt;BR /&gt;410753.369, 7830191.197&amp;nbsp; -238.440, 7866.000&lt;BR /&gt;410726.857, 7830233.149, -245.280, 7867.000&lt;BR /&gt;410701.461, 7830273.902, -250.414, 0.000&lt;BR /&gt;410673.267, 7830313.504, -242.441, 0.000&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A similar discrepancy occurs when I read a geometry. Eg I create a new geodatabase and feature class in ArcCatalog, then use ArcMap's editor to insert a row with x, y, z, m:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;72.000, 38.518, 180.000, 41.000&lt;BR /&gt;74.328, 38.153, 181.000, 42.000&lt;BR /&gt;75.982, 35.619, 182.000, 43.000&lt;BR /&gt;78.201, 32.217, 183.000, 44.000&lt;BR /&gt;78.930, 30.795, 160.000, 45.000&lt;BR /&gt;80.105, 28.504, 161.000, 26.000&lt;BR /&gt;81.176, 26.415, 162.000, 27.000&lt;BR /&gt;83.455, 21.225, 163.000, 28.000&lt;BR /&gt;80.018, 15.917, 164.000, 29.000&lt;BR /&gt;84.599, 15.960, 165.000, 30.000&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then I use this code to read the geometry&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; 
 MultiPartShapeBuffer polyline;
 row.GetGeometry(polyline);

 ShapeType st;
 polyline.GetShapeType(st);
 assert(st == shapePolylineZM);

 int numPoints;
 polyline.GetNumPoints(numPoints);

 Point* p;
 polyline.GetPoints(p);

 double* m;
 polyline.GetMs(m);

 for (int i = 0; i &amp;lt; numPoints; ++i)
 {
&amp;nbsp; wcout &amp;lt;&amp;lt; p&lt;I&gt;.x &amp;lt;&amp;lt; "\t" &amp;lt;&amp;lt; p&lt;I&gt;.y &amp;lt;&amp;lt; "\t" &amp;lt;&amp;lt; m&lt;I&gt; &amp;lt;&amp;lt; endl;
 }
&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and I get this result:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;72&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 38.5182 26&lt;BR /&gt;74.328&amp;nbsp; 38.1528 45&lt;BR /&gt;75.9815 35.6188 41&lt;BR /&gt;78.2013 32.217&amp;nbsp; 42&lt;BR /&gt;78.9303 30.7952 43&lt;BR /&gt;80.105&amp;nbsp; 28.5039 44&lt;BR /&gt;81.1763 26.4145 45&lt;BR /&gt;83.4546 21.2247 26&lt;BR /&gt;80.0181 15.9173 27&lt;BR /&gt;84.5989 15.9598 28&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;again the M values are in the wrong postion, offset by 2&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It looks to me as if GetMs is returning the wrong value. In fact if I do this (after the code above):&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
 double *mExtent;
 err = polyline.GetMExtent(mExtent);
 wcout &amp;lt;&amp;lt; "pointers: " &amp;lt;&amp;lt; m &amp;lt;&amp;lt; ", " &amp;lt;&amp;lt; mExtent &amp;lt;&amp;lt; ", " &amp;lt;&amp;lt; m - mExtent &amp;lt;&amp;lt; endl;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can see that GetMExtent and GetMs return the same value, whereas I expected m to be 2*sizeof(double) higher than mExtent, in accordance with the structure described in Extended Shapefile Record Format, M data section, which shows MMin and MMax before Ms.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I increment the pointer returned by GetMs by two, eg by using this class:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
 class MultiPartShapeBuffer_fix : public FileGDBAPI::MultiPartShapeBuffer
 {
 public:
&amp;nbsp; fgdbError GetMs(double*&amp;amp; mArray) const
&amp;nbsp; { 
&amp;nbsp;&amp;nbsp; fgdbError err = MultiPartShapeBuffer::GetMs(mArray);
&amp;nbsp;&amp;nbsp; if (SUCCEEDED(err))
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; mArray += 2;
&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; return err;
&amp;nbsp; }
 };

 MultiPartShapeBuffer_fix polyline;
 ...
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;My code appears to work properly, both reading and writing the geometry.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem appears in both v1.1 and 1.2 of FileGDB API.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It doesn't affect Z, only M.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I haven't tried other shapes, eg shapeGeneralPolyline&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I doing something wrong, or is there a bug in the API library?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the library is correct, what am I doing wrong?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the library has a bug, does it affect other shapes? I'm particularly interested in:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
 MultiPartShapeBuffer polyline;
 polyline.Setup(static_cast&amp;lt;ShapeType&amp;gt;(shapeGeneralPolyline | shapeHasZs | shapeHasMs | shapeHasCurves), ...);
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;because I have code that uses it, and I need to know whether my fix applies to all shapes or only some.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:06:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/multipartshapebuffer-getms-appears-to-return-the/m-p/228293#M397</guid>
      <dc:creator>__11</dc:creator>
      <dc:date>2021-12-11T11:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: MultiPartShapeBuffer::GetMs appears to return the wrong pointer value</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/multipartshapebuffer-getms-appears-to-return-the/m-p/228294#M398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A quick test with &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
 MultiPartShapeBuffer polyline;
 polyline.Setup(static_cast&amp;lt;ShapeType&amp;gt;(shapeGeneralPolyline | shapeHasZs | shapeHasMs | shapeHasCurves), ... );

 ...

 double* m;
 polyline.GetMs(m);
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Shows the same problem. The same fix (MultiPartShapeBuffer_fix) seems to fix the problem (tested with writing the geometry, but not reading an existing one).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:06:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/multipartshapebuffer-getms-appears-to-return-the/m-p/228294#M398</guid>
      <dc:creator>__11</dc:creator>
      <dc:date>2021-12-11T11:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: MultiPartShapeBuffer::GetMs appears to return the wrong pointer value</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/multipartshapebuffer-getms-appears-to-return-the/m-p/228295#M399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I examined the code and found that there is a bug.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A fix will be included as part of the next bug fix release that will ship soon.&amp;nbsp; In the meantime, you can add an offset of 16 bytes to the pointer returned by GetMs.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Aug 2012 22:25:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/multipartshapebuffer-getms-appears-to-return-the/m-p/228295#M399</guid>
      <dc:creator>DavidSousa</dc:creator>
      <dc:date>2012-08-22T22:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: MultiPartShapeBuffer::GetMs appears to return the wrong pointer value</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/multipartshapebuffer-getms-appears-to-return-the/m-p/228296#M400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;A fix will be included as part of the next bug fix release that will ship soon.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for that. Do we have a more specific time frame than "soon". I don't need an actual date, but it would be helpful to know whether it is days, weeks or months away.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2012 00:47:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/multipartshapebuffer-getms-appears-to-return-the/m-p/228296#M400</guid>
      <dc:creator>__11</dc:creator>
      <dc:date>2012-08-23T00:47:52Z</dc:date>
    </item>
  </channel>
</rss>

