getting geometry area from GML feature in GDALArcGIS - Python - Extend XY Line to Z ValueHow to recode and...

What is the opposite of 'gravitas'?

Why are all the doors on Ferenginar (the Ferengi home world) far shorter than the average Ferengi?

Should my PhD thesis be submitted under my legal name?

A car is moving at 40 km/h. A fly at 100 km/h, starts from wall towards the car(20 km away)flies to car and back. How many trips can it make?

I2C signal and power over long range (10meter cable)

Perfect riffle shuffles

Freedom of speech and where it applies

Simulating a probability of 1 of 2^N with less than N random bits

word describing multiple paths to the same abstract outcome

Installing PowerShell on 32-bit Kali OS fails

Modern Day Chaucer

Are taller landing gear bad for aircraft, particulary large airliners?

Java - What do constructor type arguments mean when placed *before* the type?

Resetting two CD4017 counters simultaneously, only one resets

I'm in charge of equipment buying but no one's ever happy with what I choose. How to fix this?

Simple image editor tool to draw a simple box/rectangle in an existing image

Could solar power be utilized and substitute coal in the 19th century?

Can I rely on these GitHub repository files?

How did Monica know how to operate Carol's "designer"?

Fast sudoku solver

Can somebody explain Brexit in a few child-proof sentences?

Did US corporations pay demonstrators in the German demonstrations against article 13?

The most efficient algorithm to find all possible integer pairs which sum to a given integer

Can a malicious addon access internet history and such in chrome/firefox?



getting geometry area from GML feature in GDAL


ArcGIS - Python - Extend XY Line to Z ValueHow to recode and recalculate Field Values using ArcPy?What is Python equivalent of ModelBuilder's Iterate Feature Selection?How to get output value from Feature Compare (schema) and append to existing csv?Why do I get an error when I try and clip a shapefile to a shapefile using ogr2ogr?Using Selection Sets with PythonReturn raster that intersects another raster in gdalogr2ogr clip all shapefiles in a directoryHow to iterate over features in a filegdb - ogr PythonUsing ogr2ogr to convert multiple GML files to a postgis table













0















I am trying to run a clip between an extent and a shapefile, then iterate through the resulting features to determine the one with the largest overlap (aka the feature with the largest area after the clip). After running clip:



ogr2ogr -clipsrc 23.894 42.327 24.89 42.769 -f "GML" -select "name" /path/to/tempOut /path/to/input.shp


I can iterate through the features and get the "name" of each feature like this:



from xml.dom import minidom
xml = minidom.parse(tempOut)
features = xml.getElementsByTagName('gml:featureMember')

for feature in features:
name = str(feature.getElementsByTagName('ogr:name')[0].firstChild.data)


I have been messing around trying to get an object that I could use in:



ogr.CreateGeometryFromGML() 


To then hopefully obtain the area of each feature (so I can determine which one overlaps with the extent provided the most), but I can't figure it out. Surely I'm missing something simple?










share|improve this question



























    0















    I am trying to run a clip between an extent and a shapefile, then iterate through the resulting features to determine the one with the largest overlap (aka the feature with the largest area after the clip). After running clip:



    ogr2ogr -clipsrc 23.894 42.327 24.89 42.769 -f "GML" -select "name" /path/to/tempOut /path/to/input.shp


    I can iterate through the features and get the "name" of each feature like this:



    from xml.dom import minidom
    xml = minidom.parse(tempOut)
    features = xml.getElementsByTagName('gml:featureMember')

    for feature in features:
    name = str(feature.getElementsByTagName('ogr:name')[0].firstChild.data)


    I have been messing around trying to get an object that I could use in:



    ogr.CreateGeometryFromGML() 


    To then hopefully obtain the area of each feature (so I can determine which one overlaps with the extent provided the most), but I can't figure it out. Surely I'm missing something simple?










    share|improve this question

























      0












      0








      0








      I am trying to run a clip between an extent and a shapefile, then iterate through the resulting features to determine the one with the largest overlap (aka the feature with the largest area after the clip). After running clip:



      ogr2ogr -clipsrc 23.894 42.327 24.89 42.769 -f "GML" -select "name" /path/to/tempOut /path/to/input.shp


      I can iterate through the features and get the "name" of each feature like this:



      from xml.dom import minidom
      xml = minidom.parse(tempOut)
      features = xml.getElementsByTagName('gml:featureMember')

      for feature in features:
      name = str(feature.getElementsByTagName('ogr:name')[0].firstChild.data)


      I have been messing around trying to get an object that I could use in:



      ogr.CreateGeometryFromGML() 


      To then hopefully obtain the area of each feature (so I can determine which one overlaps with the extent provided the most), but I can't figure it out. Surely I'm missing something simple?










      share|improve this question














      I am trying to run a clip between an extent and a shapefile, then iterate through the resulting features to determine the one with the largest overlap (aka the feature with the largest area after the clip). After running clip:



      ogr2ogr -clipsrc 23.894 42.327 24.89 42.769 -f "GML" -select "name" /path/to/tempOut /path/to/input.shp


      I can iterate through the features and get the "name" of each feature like this:



      from xml.dom import minidom
      xml = minidom.parse(tempOut)
      features = xml.getElementsByTagName('gml:featureMember')

      for feature in features:
      name = str(feature.getElementsByTagName('ogr:name')[0].firstChild.data)


      I have been messing around trying to get an object that I could use in:



      ogr.CreateGeometryFromGML() 


      To then hopefully obtain the area of each feature (so I can determine which one overlaps with the extent provided the most), but I can't figure it out. Surely I'm missing something simple?







      python gdal ogr2ogr






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 35 mins ago









      user20408user20408

      696524




      696524






















          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%2f316655%2fgetting-geometry-area-from-gml-feature-in-gdal%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%2f316655%2fgetting-geometry-area-from-gml-feature-in-gdal%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

          (145452) 2005 RN43 Классификация | Примечания | Ссылки |...

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

          Энтрерриос (город) Содержание История | Географическое...