1

I have a simple KML file witch I get with ogr2ogr where all placemark are 2D polygon like this one :

<Placemark>
  <Style>
    <LineStyle>
       <color>ff0000ff</color>
    </LineStyle>
    <PolyStyle>
       <fill>0</fill>
    </PolyStyle>
  </Style>
  <ExtendedData>
    <SchemaData schemaUrl="#BATI">
      <SimpleData name="HAUTEUR">5</SimpleData>
    </SchemaData>
  </ExtendedData>
  <Polygon>
    <altitudeMode>relativeToGround</altitudeMode>
    <outerBoundaryIs>
      <LinearRing>
        <altitudeMode>relativeToGround</altitudeMode>
        <coordinates>
          5.210274804171726,45.193994541274471,0 5.210273193448314,45.193992448578285,0 5.210244307501982,45.194002928913058,0 5.210153551080012,45.193930862320109,0 5.209984563035429,45.194038696922476,0 5.210076592373608,45.194110738456011,0 5.210146416870383,45.194072424624984,0 5.210176223631215,45.194092352007594,0 5.210274804171726,45.193994541274471,0
        </coordinates>
      </LinearRing>
    </outerBoundaryIs>
  </Polygon>
</Placemark>

I would like to convert all of them to polygon with extrusion. The value of z coordinates is defined by the value of "HAUTEUR" extended data. Here it's 5 meters:

<Placemark>
  <Style>
    <LineStyle>
      <color>ff0000ff</color>
    </LineStyle>
    <PolyStyle>
      <fill>0</fill>
    </PolyStyle>
  </Style>
  <ExtendedData>
    <SchemaData schemaUrl="#BATI">
      <SimpleData name="HAUTEUR">5</SimpleData>
    </SchemaData>
  </ExtendedData>
  <Polygon>
    <extrude>1</extrude>
    <altitudeMode>relativeToGround</altitudeMode>
    <outerBoundaryIs>
      <LinearRing>
        <altitudeMode>relativeToGround</altitudeMode>
        <coordinates>
           5.210274804171726,45.19399454127447,5 5.210273193448314,45.19399244857829,5 5.210244307501982,45.19400292891305,5 5.210153551080012,45.19393086232011,5 5.209984563035429,45.19403869692248,55.210076592373608,45.194110738456,5 5.210146416870383,45.19407242462499,5 5.210176223631215,45.19409235200759,5 5.210274804171726,45.19399454127447,5 
         </coordinates>
       </LinearRing>
     </outerBoundaryIs>
   </Polygon>
</Placemark>

I thought that a XSL Stylesheet is the best and the easiest way to process the conversion but I can't figure how to start. Has someone ever managed it?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.