Skip to content
Permalink
Browse files

fix 'on the fly' transform problem

  • Loading branch information
Sergey Yakushevs
Sergey Yakushevs committed May 26, 2011
1 parent 3dad741 commit dd01e40a300e33befc7181db761af1ca6567b7d8
Showing with 14 additions and 10 deletions.
  1. +2 −2 src/analysis/network/qgsgraphbuilderintr.h
  2. +12 −8 src/analysis/network/qgslinevectorlayerdirector.cpp
@@ -72,9 +72,9 @@ class ANALYSIS_EXPORT QgsGraphBuilderInterface
}

//! get measurement tool
QgsDistanceArea& distanceArea()
QgsDistanceArea* distanceArea()
{
return mDa;
return &mDa;
}

//! add vertex
@@ -69,19 +69,23 @@ void QgsLineVectorLayerDirector::makeGraph( QgsGraphBuilderInterface *builder, c
int featureCount = ( int ) vl->featureCount() * 2;
int step = 0;

QgsCoordinateTransform ct( vl->crs(), builder->destinationCrs() );

QgsDistanceArea da;
da.setSourceCrs( builder->destinationCrs().srsid() );
da.setProjectionsEnabled( true );

QgsCoordinateTransform ct;
ct.setSourceCrs( vl->crs() );
if ( builder->coordinateTransformationEnabled() )
{
ct.setDestCRS( builder->destinationCrs() );
}else
{
ct.setDestCRS( vl->crs() );
}

tiedPoint = QVector< QgsPoint >( additionalPoints.size(), QgsPoint( 0.0, 0.0 ) );
TiePointInfo tmpInfo;
tmpInfo.mLength = std::numeric_limits<double>::infinity();

QVector< TiePointInfo > pointLengthMap( additionalPoints.size(), tmpInfo );
QVector< TiePointInfo >::iterator pointLengthIt;

// begin: tie points to the graph
QgsAttributeList la;
vl->select( la );
@@ -229,7 +233,7 @@ void QgsLineVectorLayerDirector::makeGraph( QgsGraphBuilderInterface *builder, c
pt2 = pointsIt->second;
if ( !isFirstPoint )
{
double distance = da.measureLine( pt1, pt2 );
double distance = builder->distanceArea()->measureLine( pt1, pt2 );
QVector< QVariant > prop;
QList< QgsEdgeProperter* >::const_iterator it;
for ( it = mProperterList.begin(); it != mProperterList.end(); ++it )

0 comments on commit dd01e40

Please sign in to comment.
You can’t perform that action at this time.