identify_derived_multi_geom.diff

Jeremy Palmer, 2010-05-11 03:21 PM

Download (1.76 KB)

View differences:

src/app/qgsmaptoolidentify.cpp (working copy)
295 295
      convertMeasurement( calc, dist, myDisplayUnits, false );
296 296
      QString str = calc.textUnit( dist, 3, myDisplayUnits, false );  // dist and myDisplayUnits are out params
297 297
      derivedAttributes.insert( tr( "Length" ), str );
298
      if ( f_it->geometry()->wkbType() == QGis::WKBLineString )
298
      if ( f_it->geometry()->wkbType() == QGis::WKBLineString || f_it->geometry()->wkbType() == QGis::WKBLineString25D )
299 299
      {
300 300
        // Add the start and end points in as derived attributes
301 301
        str = QLocale::system().toString( f_it->geometry()->asPolyline().first().x(), 'g', 10 );
......
319 319
    else if ( layer->geometryType() == QGis::Point )
320 320
    {
321 321
      // Include the x and y coordinates of the point as a derived attribute
322
      QString str;
323
      str = QLocale::system().toString( f_it->geometry()->asPoint().x(), 'g', 10 );
324
      derivedAttributes.insert( "X", str );
325
      str = QLocale::system().toString( f_it->geometry()->asPoint().y(), 'g', 10 );
326
      derivedAttributes.insert( "Y", str );
322
      if ( f_it->geometry()->wkbType() == QGis::WKBPoint || f_it->geometry()->wkbType() == QGis::WKBPoint25D)
323
      {
324
        QString str;
325
        str = QLocale::system().toString( f_it->geometry()->asPoint().x(), 'g', 10 );
326
        derivedAttributes.insert( "X", str );
327
        str = QLocale::system().toString( f_it->geometry()->asPoint().y(), 'g', 10 );
328
        derivedAttributes.insert( "Y", str );
329
      }
327 330
    }
328 331

  
329 332
    derivedAttributes.insert( tr( "feature id" ), fid < 0 ? tr( "new feature" ) : QString::number( fid ) );