KML to shapefile Problems (ogr2ogr)

Hi,everyone.
I want to use ogr2ogr command line to convert KML files to shapefile files,however,I can’t get correct shp file when I type the ogr2ogr convert command.

I have succeeded in converting the continent.shp file inside ArcGIS inside ArcGIS to correct kml file by means of ogr2ogr. Besides, the conversion between acquired kml file in last step to shapefile is also no problem.

I guess maybe my KML file which will be processed is not the strict standard format,Oh,the kml file is in Sentinel-1 image preview folder. So I paste the kml file contents.

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gml="http://www.opengis.net/gml" xmlns:xfdu="urn:ccsds:schema:xfdu:1" xmlns:safe="http://www.esa.int/safe/sentinel-1.0" xmlns:s1="http://www.esa.int/safe/sentinel-1.0/sentinel-1" xmlns:s1sar="http://www.esa.int/safe/sentinel-1.0/sentinel-1/sar" xmlns:s1sarl1="http://www.esa.int/safe/sentinel-1.0/sentinel-1/sar/level-1" xmlns:s1sarl2="http://www.esa.int/safe/sentinel-1.0/sentinel-1/sar/level-2" xmlns:gx="http://www.google.com/kml/ext/2.2">
  <Document>
    <name>Sentinel-1 Map Overlay</name>
    <Folder>
      <name>Sentinel-1 Scene Overlay</name>
      <GroundOverlay>
        <name>Sentinel-1 Image Overlay</name>
        <Icon>
          <href>quick-look.png</href>
        </Icon>
        <gx:LatLonQuad>
          <coordinates>-113.892487,68.977577 -124.235062,69.902451 -122.225281,73.452110 -109.974060,72.393707</coordinates>
        </gx:LatLonQuad>
      </GroundOverlay>
    </Folder>
  </Document>
</kml>

I don’t know the reason for the conversion failure.Could you give me some advice?
Thanks in advance.

gx:LatLonQuad is probably not standard (it relates to Google Earth ground overlays).
ogr2ogr conversion to other formats (e.g. GeoJSON, GML) produces an empty geometry.
Not many clues about this in various lists.

You could probably convert this to a normal polygon with a simple python parser using lxml.

Thanks for your reply.

I have gotten the solution in orther forum. Conversion fails because GDAL is trying to read the data as GML instead of KML. Conversion succeeds if it is run with the GDAL_SKIP configuration option For example,we can input the command statement as follow:
ogr2ogr -f “ESRI Shapefile” overlay.shp overlay.kml --config GDAL_SKIP GML --debug on

:smile::smile::smile:

The problem is due to the many namespace declarations which includes GML, but only gx namespace is really required. If you strip the redundant namespaces, ogr2ogr conversion works OK (without the need for the obscure GDAL SKIP)

<?xml version="1.0" encoding="UTF-8"?>
    <kml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gx="http://www.
    google.com/kml/ext/2.2">
      <Document>
        <name>Sentinel-1 Map Overlay</name>
        <Folder>
          <name>Sentinel-1 Scene Overlay</name>
          <GroundOverlay>
            <name>Sentinel-1 Image Overlay</name>
            <Icon>
              <href>quick-look.png</href>
            </Icon>
            <gx:LatLonQuad>
              <coordinates>-113.892487,68.977577 -124.235062,69.902451 -122.225281,7
    3.452110 -109.974060,72.393707</coordinates>
            </gx:LatLonQuad>
          </GroundOverlay>
        </Folder>
      </Document>
</kml>

Yeah, I have tested your solution just now.Your answer is also correct.
This two methods are the same and effective.

Thanks for your answer.