Cannot solely remove M value of Shapefiles

I would say: "You are another teacher", but she is a woman and I am a man

Personal Teleportation: From Rags to Riches

One verb to replace 'be a member of' a club

Why didn't Miles's spider sense work before?

How does a predictive coding aid in lossless compression?

What reasons are there for a Capitalist to oppose a 100% inheritance tax?

Is it possible to create a QR code using text?

Can I run a new neutral wire to repair a broken circuit?

Why is this clock signal connected to a capacitor to gnd?

A friend helped me with a presentation – plagiarism or not?

Little known, relatively unlikely, but scientifically plausible, apocalyptic (or near apocalyptic) events

How much of data wrangling is a data scientist's job?

Avoiding the "not like other girls" trope?

Forgetting the musical notes while performing in concert

Is there an expression that means doing something right before you will need it rather than doing it in case you might need it?

Cursor Replacement for Newbies

How to prevent "they're falling in love" trope

Is there a hemisphere-neutral way of specifying a season?

What mechanic is there to disable a threat instead of killing it?

Can my sorcerer use a spellbook only to collect spells and scribe scrolls, not cast?

Why do bosons tend to occupy the same state?

What do you call someone who asks many questions?

Dreadful Dastardly Diseases, or Always Atrocious Ailments

Is it acceptable for a professor to tell male students to not think that they are smarter than female students?



Cannot solely remove M value of Shapefiles














0















I have a couple of Shapefiles which are of geometry type ZM (like PolygonZM, MultiLineStringZM, etc.), however my database (a PostGIS database) is of geometry type Z (like PolygonZ, MultiPointZ, etc.). When I import my shapefile into database, it will of course report an error. However, when I convert these Shapefiles, I find that M values cannot be removed without removing Z value.

Here are my efforts:

1. In ArcMap, use Feature Class to Feature Class in ArcToolbox, click "Environment" and disable M value there. However, output Shapefiles still have M values.

2. Using Export in QGIS, and choose PolygonZ or other geometry types with Z only in SHPT field. Again, output Shapefiles still have M values.

3. Use ogr2ogr. Here is the command line:



ogr2ogr -nlt polygonz new.shp old.shp


Again, output Shapefiles still have M values.

However, if I discard Z values as well:



ogr2ogr -nlt polygon new.shp old.shp


Output Shapefiles will have neither Z nor M values.

But when I try to add Z again, like:



ogr2ogr -nlt polygonz new1.shp new.shp


Both Z and M will be added, thus returning to PolygonZM.

Since these shapefiles have no actual Z values at all, I can safely discard Z values along with M values if I only need to deal with these files themselves. However, in my database, geometry columns are storing Z values, and they cannot be discarded. Can anyone tell me why can't I just discard M values and preserve Z values for these Shapefiles?









share



























    0















    I have a couple of Shapefiles which are of geometry type ZM (like PolygonZM, MultiLineStringZM, etc.), however my database (a PostGIS database) is of geometry type Z (like PolygonZ, MultiPointZ, etc.). When I import my shapefile into database, it will of course report an error. However, when I convert these Shapefiles, I find that M values cannot be removed without removing Z value.

    Here are my efforts:

    1. In ArcMap, use Feature Class to Feature Class in ArcToolbox, click "Environment" and disable M value there. However, output Shapefiles still have M values.

    2. Using Export in QGIS, and choose PolygonZ or other geometry types with Z only in SHPT field. Again, output Shapefiles still have M values.

    3. Use ogr2ogr. Here is the command line:



    ogr2ogr -nlt polygonz new.shp old.shp


    Again, output Shapefiles still have M values.

    However, if I discard Z values as well:



    ogr2ogr -nlt polygon new.shp old.shp


    Output Shapefiles will have neither Z nor M values.

    But when I try to add Z again, like:



    ogr2ogr -nlt polygonz new1.shp new.shp


    Both Z and M will be added, thus returning to PolygonZM.

    Since these shapefiles have no actual Z values at all, I can safely discard Z values along with M values if I only need to deal with these files themselves. However, in my database, geometry columns are storing Z values, and they cannot be discarded. Can anyone tell me why can't I just discard M values and preserve Z values for these Shapefiles?









    share

























      0












      0








      0








      I have a couple of Shapefiles which are of geometry type ZM (like PolygonZM, MultiLineStringZM, etc.), however my database (a PostGIS database) is of geometry type Z (like PolygonZ, MultiPointZ, etc.). When I import my shapefile into database, it will of course report an error. However, when I convert these Shapefiles, I find that M values cannot be removed without removing Z value.

      Here are my efforts:

      1. In ArcMap, use Feature Class to Feature Class in ArcToolbox, click "Environment" and disable M value there. However, output Shapefiles still have M values.

      2. Using Export in QGIS, and choose PolygonZ or other geometry types with Z only in SHPT field. Again, output Shapefiles still have M values.

      3. Use ogr2ogr. Here is the command line:



      ogr2ogr -nlt polygonz new.shp old.shp


      Again, output Shapefiles still have M values.

      However, if I discard Z values as well:



      ogr2ogr -nlt polygon new.shp old.shp


      Output Shapefiles will have neither Z nor M values.

      But when I try to add Z again, like:



      ogr2ogr -nlt polygonz new1.shp new.shp


      Both Z and M will be added, thus returning to PolygonZM.

      Since these shapefiles have no actual Z values at all, I can safely discard Z values along with M values if I only need to deal with these files themselves. However, in my database, geometry columns are storing Z values, and they cannot be discarded. Can anyone tell me why can't I just discard M values and preserve Z values for these Shapefiles?









      share














      I have a couple of Shapefiles which are of geometry type ZM (like PolygonZM, MultiLineStringZM, etc.), however my database (a PostGIS database) is of geometry type Z (like PolygonZ, MultiPointZ, etc.). When I import my shapefile into database, it will of course report an error. However, when I convert these Shapefiles, I find that M values cannot be removed without removing Z value.

      Here are my efforts:

      1. In ArcMap, use Feature Class to Feature Class in ArcToolbox, click "Environment" and disable M value there. However, output Shapefiles still have M values.

      2. Using Export in QGIS, and choose PolygonZ or other geometry types with Z only in SHPT field. Again, output Shapefiles still have M values.

      3. Use ogr2ogr. Here is the command line:



      ogr2ogr -nlt polygonz new.shp old.shp


      Again, output Shapefiles still have M values.

      However, if I discard Z values as well:



      ogr2ogr -nlt polygon new.shp old.shp


      Output Shapefiles will have neither Z nor M values.

      But when I try to add Z again, like:



      ogr2ogr -nlt polygonz new1.shp new.shp


      Both Z and M will be added, thus returning to PolygonZM.

      Since these shapefiles have no actual Z values at all, I can safely discard Z values along with M values if I only need to deal with these files themselves. However, in my database, geometry columns are storing Z values, and they cannot be discarded. Can anyone tell me why can't I just discard M values and preserve Z values for these Shapefiles?







      arcgis-desktop shapefile ogr2ogr z-value m-values





      share












      share










      share



      share










      asked 1 min ago









      Aurus HuangAurus Huang

      1388




      1388






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "79"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f317726%2fcannot-solely-remove-m-value-of-shapefiles%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f317726%2fcannot-solely-remove-m-value-of-shapefiles%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Щит и меч (фильм) Содержание Названия серий | Сюжет |...

          Венесуэла на летних Олимпийских играх 2000 Содержание Состав...

          Meter-Bus Содержание Параметры шины | Стандартизация |...