@@ -373,26 +373,38 @@ public virtual IGeometryObject GetGeometry()
373373 return polygon . ToGeometry ( ) . NormalizePolygon ( ) ;
374374 }
375375
376- if ( measurementFrameSet . metadataWrap . xmlData . frameSet11 != null && measurementFrameSet . metadataWrap . xmlData . frameSet11 . footPrint != null &&
377- measurementFrameSet . metadataWrap . xmlData . frameSet11 . footPrint . Items1 [ 0 ] is ServiceModel . Ogc . Gml311 . CoordinatesType )
376+ if ( measurementFrameSet . metadataWrap . xmlData . frameSet11 != null && measurementFrameSet . metadataWrap . xmlData . frameSet11 . footPrint != null )
378377 {
379- ServiceModel . Ogc . Gml311 . CoordinatesType coordinates = ( ServiceModel . Ogc . Gml311 . CoordinatesType ) measurementFrameSet . metadataWrap . xmlData . frameSet11 . footPrint . Items1 [ 0 ] ;
380-
381- var polygon = new ServiceModel . Ogc . Gml321 . PolygonType ( ) ;
382- polygon . exterior = new ServiceModel . Ogc . Gml321 . AbstractRingPropertyType ( ) ;
383- var linearRing = new ServiceModel . Ogc . Gml321 . LinearRingType ( ) ;
384- var posList = new List < ServiceModel . Ogc . Gml321 . DirectPositionListType > ( ) ;
385-
386- posList . Add ( new ServiceModel . Ogc . Gml321 . DirectPositionListType ( ) { Text = coordinates . Value . Replace ( "," , " " ) } ) ;
387- if ( posList [ 0 ] . Text . Split ( ' ' ) [ 1 ] != posList [ 0 ] . Text . Split ( ' ' ) . Last ( ) )
378+ string coordinatesText = null ;
379+ if ( measurementFrameSet . metadataWrap . xmlData . frameSet11 . footPrint . Items1 [ 0 ] is ServiceModel . Ogc . Gml311 . CoordinatesType )
388380 {
389- posList [ 0 ] . Text += " " + posList [ 0 ] . Text . Split ( ' ' ) [ 0 ] + " " + posList [ 0 ] . Text . Split ( ' ' ) [ 1 ] ;
381+ var coordinates = ( ServiceModel . Ogc . Gml311 . CoordinatesType ) measurementFrameSet . metadataWrap . xmlData . frameSet11 . footPrint . Items1 [ 0 ] ;
382+ coordinatesText = coordinates . Value ;
383+ }
384+ else if ( measurementFrameSet . metadataWrap . xmlData . frameSet11 . footPrint . Items1 [ 0 ] is Terradue . ServiceModel . Ogc . Gml311 . DirectPositionListType )
385+ {
386+ var coordinates = ( Terradue . ServiceModel . Ogc . Gml311 . DirectPositionListType ) measurementFrameSet . metadataWrap . xmlData . frameSet11 . footPrint . Items1 [ 0 ] ;
387+ coordinatesText = coordinates . Text ;
390388 }
391- linearRing . Items = posList . ToArray ( ) ;
392- linearRing . ItemsElementName = new ServiceModel . Ogc . Gml321 . ItemsChoiceType6 [ 1 ] { ServiceModel . Ogc . Gml321 . ItemsChoiceType6 . posList } ;
393- polygon . exterior . Item = linearRing ;
394389
395- return polygon . ToGeometry ( ) . NormalizePolygon ( ) ;
390+ if ( coordinatesText != null )
391+ {
392+ var polygon = new ServiceModel . Ogc . Gml321 . PolygonType ( ) ;
393+ polygon . exterior = new ServiceModel . Ogc . Gml321 . AbstractRingPropertyType ( ) ;
394+ var linearRing = new ServiceModel . Ogc . Gml321 . LinearRingType ( ) ;
395+ var posList = new List < ServiceModel . Ogc . Gml321 . DirectPositionListType > ( ) ;
396+
397+ posList . Add ( new ServiceModel . Ogc . Gml321 . DirectPositionListType ( ) { Text = coordinatesText . Replace ( "," , " " ) } ) ;
398+ if ( posList [ 0 ] . Text . Split ( ' ' ) [ 1 ] != posList [ 0 ] . Text . Split ( ' ' ) . Last ( ) )
399+ {
400+ posList [ 0 ] . Text += " " + posList [ 0 ] . Text . Split ( ' ' ) [ 0 ] + " " + posList [ 0 ] . Text . Split ( ' ' ) [ 1 ] ;
401+ }
402+ linearRing . Items = posList . ToArray ( ) ;
403+ linearRing . ItemsElementName = new ServiceModel . Ogc . Gml321 . ItemsChoiceType6 [ 1 ] { ServiceModel . Ogc . Gml321 . ItemsChoiceType6 . posList } ;
404+ polygon . exterior . Item = linearRing ;
405+
406+ return polygon . ToGeometry ( ) . NormalizePolygon ( ) ;
407+ }
396408 }
397409
398410 return null ;
0 commit comments