Skip to content

Commit

Permalink
changed geometry type return of postgres provider
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@5421 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed May 5, 2006
1 parent 3298749 commit efddf4b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/gui/qgisapp.cpp
Expand Up @@ -78,6 +78,7 @@
#include "qgslegendlayerfile.h"
#include "qgslegendlayerfile.h"
#include "qgslegendlayer.h"
#include "qgslogger.h"
#include "qgsmapcanvas.h"
#include "qgsmapoverviewcanvas.h"
#include "qgsmaprender.h"
Expand Down Expand Up @@ -1613,6 +1614,7 @@ bool QgisApp::addLayer(QFileInfo const & vectorFile)
mMapCanvas->freeze(); // XXX why do we do this?

// create the layer
QgsDebugMsg("completeBaseName is: " + vectorFile.completeBaseName());

QgsVectorLayer *layer = new QgsVectorLayer(vectorFile.filePath(),
vectorFile.completeBaseName(),
Expand Down Expand Up @@ -1732,6 +1734,7 @@ bool QgisApp::addLayer(QStringList const &theLayerQStringList, const QString& en
QFileInfo fi(*it);
QString base = fi.completeBaseName();

QgsDebugMsg("completeBaseName: "+base);

// create the layer

Expand Down
30 changes: 24 additions & 6 deletions src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -2497,12 +2497,30 @@ bool QgsPostgresProvider::getGeometryDetails()
if (!srid.isEmpty() && !fType.isEmpty())
{
valid = true;
if (fType == "POINT" || fType == "MULTIPOINT")
geomType = QGis::WKBPoint;
else if (fType == "LINESTRING" || fType == "MULTILINESTRING")
geomType = QGis::WKBLineString;
else if (fType == "POLYGON" || fType == "MULTIPOLYGON")
geomType = QGis::WKBPolygon;
if (fType == "POINT")
{
geomType = QGis::WKBPoint;
}
else if(fType == "MULTIPOINT")
{
geomType = QGis::WKBMultiPoint;
}
else if(fType == "LINESTRING")
{
geomType = QGis::WKBLineString;
}
else if(fType == "MULTILINESTRING")
{
geomType = QGis::WKBMultiLineString;
}
else if (fType == "POLYGON")
{
geomType = QGis::WKBPolygon;
}
else if(fType == "MULTIPOLYGON")
{
geomType = QGis::WKBMultiPolygon;
}
else
{
showMessageBox(tr("Unknown geometry type"),
Expand Down

0 comments on commit efddf4b

Please sign in to comment.