cleanup line endings and some typos in fTools

git-svn-id: http://svn.osgeo.org/qgis/trunk@10080 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
jef 2009-02-01 15:44:02 +00:00
parent c8bfe07de1
commit 79febc8a97
25 changed files with 765 additions and 764 deletions

View File

@ -14,18 +14,18 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
def name():
return "fTools"
def description():
return "Tools for vector data analysis and management"
def version():
def name():
return "fTools"
def description():
return "Tools for vector data analysis and management"
def version():
return "0.5.3"
def qgisMinimumVersion():
return "1.0.0"
return "1.0.0"
def classFactory( iface ):
from fTools import fToolsPlugin
return fToolsPlugin( iface )
from fTools import fToolsPlugin
return fToolsPlugin( iface )

View File

@ -14,15 +14,15 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
import webbrowser, os
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
import webbrowser, os
from frmAbout import Ui_Dialog
import resources
import resources
currentPath = os.path.dirname(__file__)
class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface):
QDialog.__init__(self)

View File

@ -30,10 +30,10 @@
#
#---------------------------------------------------------------------
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import resources
from qgis.core import *
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import resources
from qgis.core import *
import resources
import os.path, sys
# Set up current path, so that we know where to look for mudules
@ -46,7 +46,7 @@ import doGeometry, doGeoprocessing, doVisual
import doIntersectLines, doJoinAttributes, doSelectByLocation, doVectorSplit, doMeanCoords
import doPointDistance, doPointsInPolygon, doRandom, doRandPoints, doRegPoints, doDefineProj
import doReProject, doSpatialJoin, doSubsetSelect, doSumLines, doVectorGrid, doAbout
class fToolsPlugin:
def __init__( self,iface ):
self.iface = iface
@ -184,7 +184,7 @@ class fToolsPlugin:
menuBar = self.iface.mainWindow().menuBar()
actions = menuBar.actions()
helpAction = actions[ len( actions ) - 1 ]
menuBar.insertMenu( helpAction, self.menu )
menuBar.insertMenu( helpAction, self.menu )
QObject.connect( self.distMatrix, SIGNAL("triggered()"), self.dodistMatrix )
QObject.connect( self.sumLines, SIGNAL("triggered()"), self.dosumLines )
@ -306,19 +306,19 @@ class fToolsPlugin:
def dosumLines(self):
d = doSumLines.Dialog(self.iface)
d.exec_()
def dopointsPoly( self ):
d = doPointsInPolygon.Dialog( self.iface )
d.exec_()
def dorandSel( self ):
d = doRandom.Dialog( self.iface )
d.exec_()
def dorandSub( self ):
d = doSubsetSelect.Dialog( self.iface )
d.exec_()
def dorandPoints( self ):
d = doRandPoints.Dialog( self.iface )
d.exec_()

View File

@ -3,291 +3,291 @@
<functions>
<analysis>
<ftools_function>
<name>Distance matrix</name>
<description>Measure distances between two point layers, and output results as a) Square distance matrix, b) Linear distance matrix, or c) Summary of distances. Can limit distances to the k nearest features.</description>
<name>Distance matrix</name>
<description>Measure distances between two point layers, and output results as a) Square distance matrix, b) Linear distance matrix, or c) Summary of distances. Can limit distances to the k nearest features.</description>
<image>icons/gis/matrix.png</image>
<category>Analysis Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Analysis Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Sum line lengths</name>
<description>Calculate the total sum of line lengths for each polygon of a polygon vector layer.</description>
<name>Sum line lengths</name>
<description>Calculate the total sum of line lengths for each polygon of a polygon vector layer.</description>
<image>icons/gis/sum_lines.png</image>
<category>Analysis Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Analysis Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Points in polygon</name>
<description>Count the number of points that occur in each polygon of an input polygon vector layer.</description>
<name>Points in polygon</name>
<description>Count the number of points that occur in each polygon of an input polygon vector layer.</description>
<image>icons/gis/sum_points.png</image>
<category>Analysis Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Analysis Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Basic statistics</name>
<description>Compute basic statistics (mean, std dev, N, sum, CV) on an input field.</description>
<name>Basic statistics</name>
<description>Compute basic statistics (mean, std dev, N, sum, CV) on an input field.</description>
<image>icons/gis/basic_statistics.png</image>
<category>Analysis Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Analysis Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>List unique values</name>
<description>List all unique values in an input vector layer field.</description>
<name>List unique values</name>
<description>List all unique values in an input vector layer field.</description>
<image>icons/gis/unique.png</image>
<category>Geometry Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Geometry Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Nearest neighbour analysis</name>
<description>Compute nearest neighbour statistics to assess the level of clustering in a point vector layer.</description>
<name>Nearest neighbour analysis</name>
<description>Compute nearest neighbour statistics to assess the level of clustering in a point vector layer.</description>
<image>icons/gis/neighbour.png</image>
<category>Analysis Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Analysis Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Mean coordinate(s)</name>
<description>Compute either the normal or weighted mean center of an entire vector layer, or multiple features based on a unique ID field.</description>
<name>Mean coordinate(s)</name>
<description>Compute either the normal or weighted mean center of an entire vector layer, or multiple features based on a unique ID field.</description>
<image>icons/gis/mean.png</image>
<category>Analysis Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Analysis Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Line intersection</name>
<description>Locate intersections between lines, and output results as a point shapefile. Useful for locating road or stream intersections, ignores line intersections with length > 0.</description>
<name>Line intersection</name>
<description>Locate intersections between lines, and output results as a point shapefile. Useful for locating road or stream intersections, ignores line intersections with length > 0.</description>
<image>icons/gis/intersections.png</image>
<category>Analysis Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Analysis Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
</analysis>
<sampling>
<ftools_function>
<name>Random selection</name>
<description>Randomly select n number of features, or n percentage of features from an input vector layer.</description>
<name>Random selection</name>
<description>Randomly select n number of features, or n percentage of features from an input vector layer.</description>
<image>icons/gis/random_selection.png</image>
<category>Sampling Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Sampling Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Random selection within subsets</name>
<description>Randomly select features wihtin subsets of a vector layer based on a unique ID field.</description>
<name>Random selection within subsets</name>
<description>Randomly select features wihtin subsets of a vector layer based on a unique ID field.</description>
<image>icons/gis/sub_selection.png</image>
<category>Sampling Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Sampling Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Random points</name>
<description>Generate pseudo-random points over a given input layer (raster or vector) and export them as a point shapefile.</description>
<name>Random points</name>
<description>Generate pseudo-random points over a given input layer (raster or vector) and export them as a point shapefile.</description>
<image>icons/gis/random_points.png</image>
<category>Sampling Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<category>Sampling Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Regular points</name>
<description>Generate a regular grid of points over a specified region and export them as a point shapefile.</description>
<name>Regular points</name>
<description>Generate a regular grid of points over a specified region and export them as a point shapefile.</description>
<image>icons/gis/regular_points.png</image>
<category>Sampling Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Sampling Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Vector grid</name>
<description>Generate a line or polygon vector grid based on user specified grid spacing.</description>
<name>Vector grid</name>
<description>Generate a line or polygon vector grid based on user specified grid spacing.</description>
<image>icons/gis/vector_grid.png</image>
<category>Sampling Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Sampling Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Select by location</name>
<description>Select features based on their location relative to another layer to form a new selection, or add or subtract from the current selection.</description>
<name>Select by location</name>
<description>Select features based on their location relative to another layer to form a new selection, or add or subtract from the current selection.</description>
<image>icons/gis/select_location.png</image>
<category>Sampling Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Sampling Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
</sampling>
<geoprocessing>
<ftools_function>
<name>Convex hulls</name>
<description>Create minimum convex hull(s) (polygons) for an entire input layer, or based on a unique ID field.</description>
<name>Convex hulls</name>
<description>Create minimum convex hull(s) (polygons) for an entire input layer, or based on a unique ID field.</description>
<image>icons/gis/convex_hull.png</image>
<category>Geoprocessing Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<category>Geoprocessing Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Buffer(s)</name>
<description>Create buffer(s) around features based on specified distance, or distance field.</description>
<name>Buffer(s)</name>
<description>Create buffer(s) around features based on specified distance, or distance field.</description>
<image>icons/gis/buffer.png</image>
<category>Geoprocessing Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Geoprocessing Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Intersect</name>
<description>Overlay vector layers such that output contains those areas where both layers intersect.</description>
<name>Intersect</name>
<description>Overlay vector layers such that output contains those areas where both layers intersect.</description>
<image>icons/gis/intersect.png</image>
<category>Geoprocessing Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Geoprocessing Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Union</name>
<description>Overlay vector layers such that output contains all intersecting and non-intersecting areas of input layers.</description>
<name>Union</name>
<description>Overlay vector layers such that output contains all intersecting and non-intersecting areas of input layers.</description>
<image>icons/gis/union.png</image>
<category>Geoprocessing Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Geoprocessing Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Symetrical difference</name>
<description>Overlay vector layers such that output contains those areas of the input and difference layers that do not intersect.</description>
<name>Symetrical difference</name>
<description>Overlay vector layers such that output contains those areas of the input and difference layers that do not intersect.</description>
<image>icons/gis/sym_difference.png</image>
<category>Geoprocessing Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Geoprocessing Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Clip</name>
<description>Overlay vector layers such that output contains those areas of the input layer that intersect the clip layer.</description>
<name>Clip</name>
<description>Overlay vector layers such that output contains those areas of the input layer that intersect the clip layer.</description>
<image>icons/gis/clip.png</image>
<category>Geoprocessing Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Geoprocessing Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Difference</name>
<description>Overlay vector layers such that output contains those areas of the input layer that do not intersect the clip layer.</description>
<name>Difference</name>
<description>Overlay vector layers such that output contains those areas of the input layer that do not intersect the clip layer.</description>
<image>icons/gis/difference.png</image>
<category>Geoprocessing Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Geoprocessing Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Dissolve</name>
<description>Merge features based on input field. All features with indentical input values are combined to form one single feature.</description>
<name>Dissolve</name>
<description>Merge features based on input field. All features with indentical input values are combined to form one single feature.</description>
<image>icons/gis/dissolve.png</image>
<category>Geoprocessing Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<category>Geoprocessing Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
</geoprocessing>
<geometry>
<ftools_function>
<name>Check geometry validity</name>
<description>Check polygon geometries for self-intersections, closed-holes and polygons, and correct node ordering.</description>
<name>Check geometry validity</name>
<description>Check polygon geometries for self-intersections, closed-holes and polygons, and correct node ordering.</description>
<image>icons/gis/check_geometry.png</image>
<category>Geometry Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Geometry Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Export/Add geometry values</name>
<description>Add vector layer geometry info to point (XCOORD, YCOORD), line (LENGTH), or polygon (AREA, PERIMETER) layer.</description>
<name>Export/Add geometry values</name>
<description>Add vector layer geometry info to point (XCOORD, YCOORD), line (LENGTH), or polygon (AREA, PERIMETER) layer.</description>
<image>icons/gis/export_geometry.png</image>
<category>Geometry Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Geometry Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Polygon centroids</name>
<description>Calculate the true centroids, or 'center of mass' for each polygon in an input polygon layer.</description>
<name>Polygon centroids</name>
<description>Calculate the true centroids, or 'center of mass' for each polygon in an input polygon layer.</description>
<image>icons/gis/centroids.png</image>
<category>Geometry Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Geometry Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Simplify geometries</name>
<description>Simplify (generalise) line or polygon vector layers using (a modified) Douglas-Peucker algorithm.</description>
<name>Simplify geometries</name>
<description>Simplify (generalise) line or polygon vector layers using (a modified) Douglas-Peucker algorithm.</description>
<image>icons/gis/simplify.png</image>
<category>Geometry Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Geometry Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Multipart to singleparts</name>
<description>Convert multipart features to multiple singlepart features. Creates simple polygons and lines.</description>
<name>Multipart to singleparts</name>
<description>Convert multipart features to multiple singlepart features. Creates simple polygons and lines.</description>
<image>icons/gis/multi_to_single.png</image>
<category>Geometry Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Geometry Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Singleparts to multipart</name>
<description>Merge multiple features to a single multipart feature based on a unique ID field.</description>
<name>Singleparts to multipart</name>
<description>Merge multiple features to a single multipart feature based on a unique ID field.</description>
<image>icons/gis/single_to_multi.png</image>
<category>Geometry Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Geometry Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Polygons to lines</name>
<description>Convert polygon features to line features. Multipart polygons are converted to multiple singlepart lines.</description>
<name>Polygons to lines</name>
<description>Convert polygon features to line features. Multipart polygons are converted to multiple singlepart lines.</description>
<image>icons/gis/to_lines.png</image>
<category>Geometry Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Geometry Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Extract nodes</name>
<description>Extract nodes from line and polygon vector layers and output them as points.</description>
<name>Extract nodes</name>
<description>Extract nodes from line and polygon vector layers and output them as points.</description>
<image>icons/gis/extract_nodes.png</image>
<category>Geometry Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Geometry Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
</geometry>
<management>
<ftools_function>
<name>Export to new projection</name>
<description>Based on input CRS, project features to new CRS and export as new shapefile.</description>
<name>Export to new projection</name>
<description>Based on input CRS, project features to new CRS and export as new shapefile.</description>
<image>icons/gis/export_projection.png</image>
<category>Data Management Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Data Management Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Define current projection</name>
<description>Specify the CRS for shapefiles whose CRS has not been defined.</description>
<name>Define current projection</name>
<description>Specify the CRS for shapefiles whose CRS has not been defined.</description>
<image>icons/gis/define_projection.png</image>
<category>Data Management Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<category>Data Management Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Join attributes</name>
<name>Join attributes</name>
<description>Join additional attributes to vector layer attribute table and output results to a new shapefile. Additional attributes can be from a vector layer or stand-alone dbf table.</description>
<image>icons/gis/join_attributes.png</image>
<category>Data Management Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<category>Data Management Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Join attributes by location</name>
<description>Join additional attributes to vector layer based on spatial relationship. Attributes from one vector layer are appended to the attribute table of another layer and exported as a shapefile </description>
<name>Join attributes by location</name>
<description>Join additional attributes to vector layer based on spatial relationship. Attributes from one vector layer are appended to the attribute table of another layer and exported as a shapefile </description>
<image>icons/gis/join_location.png</image>
<category>Data Management Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Data Management Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
<ftools_function>
<name>Vector split</name>
<description>Split input vector layer into multiple separate vector layers based on input field.</description>
<name>Vector split</name>
<description>Split input vector layer into multiple separate vector layers based on input field.</description>
<image>icons/gis/split_layer.png</image>
<category>Geoprocessing Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
<category>Geoprocessing Tools</category>
<long_description>Inputs, parameters, and additional information to be added</long_description>
</ftools_function>
</management>
</functions>

View File

@ -1,18 +1,18 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/functions">
<html>
<head>
<title>fTools - Help</title>
<script language="JavaScript">
function show_hide(id, show)
{
if (el = document.getElementById(id))
{
if (null==show) show = el.style.display=='none';
el.style.display = (show ? '' : 'none');
}
<html>
<head>
<title>fTools - Help</title>
<script language="JavaScript">
function show_hide(id, show)
{
if (el = document.getElementById(id))
{
if (null==show) show = el.style.display=='none';
el.style.display = (show ? '' : 'none');
}
}
function hide(id)
@ -21,158 +21,158 @@
{
el.style.display = 'none'
}
}
}
</script>
<style>
#function {
float:center;
background-color: white;
clear:both;
display:block;
padding:0 0 0.5em;
margin:1em;
}
#head {
background-color: white;
border-bottom-width:0;
color: black;
display:block;
font-size:150%;
font-weight:bold;
margin:0;
padding:0.3em 1em;
}
#description{
display: block;
#function {
float:center;
background-color: white;
clear:both;
display:block;
padding:0 0 0.5em;
margin:1em;
}
#head {
background-color: white;
border-bottom-width:0;
color: black;
display:block;
font-size:150%;
font-weight:bold;
margin:0;
padding:0.3em 1em;
}
#description{
display: block;
float:left;
width: auto;
margin:0;
text-align: left;
padding:0.2em 0.5em 0.4em;
color: black;
font-size:100%;
font-weight:normal;
}
#category, #image, #long_description{
font-size: 80%;
padding: 0em 0em 0em 1em;
width: auto;
margin:0;
text-align: left;
padding:0.2em 0.5em 0.4em;
color: black;
font-size:100%;
font-weight:normal;
}
</style>
<style type="text/css">
#analysis, #sampling, #geoprocessing, #management, #table, #home{
background-color: white;
text-align: left;
font-size: 9pt;
#category, #image, #long_description{
font-size: 80%;
padding: 0em 0em 0em 1em;
}
</style>
<style type="text/css">
#analysis, #sampling, #geoprocessing, #management, #table, #home{
background-color: white;
text-align: left;
font-size: 9pt;
}
#leftcontainer {
float: left;
position: relative;
float: left;
position: relative;
width: 300px;
height: auto;
margin-left: auto;
margin-right: auto;
text-align: left;
overflow: hidden;
padding-left: 0px;
height: auto;
margin-left: auto;
margin-right: auto;
text-align: left;
overflow: hidden;
padding-left: 0px;
padding-top: 0px;
background-color: white;
}
#pagecontainer {
position: relative;
#pagecontainer {
position: relative;
width: auto;
height: auto;
margin-left: auto;
margin-right: auto;
text-align: left;
overflow: hidden;
padding-left: 0px;
height: auto;
margin-left: auto;
margin-right: auto;
text-align: left;
overflow: hidden;
padding-left: 0px;
padding-top: 0px;
background-color: white;
}
#navcontainer {
float: left;
position: relative;
#navcontainer {
float: left;
position: relative;
width: auto;
height: 190px;
margin-left: auto;
margin-right: auto;
text-align: left;
overflow: hidden;
padding-left: 0px;
height: 190px;
margin-left: auto;
margin-right: auto;
text-align: left;
overflow: hidden;
padding-left: 0px;
padding-top: 0px;
background-color: white;
}
#logocontainer {
float: left;
position: relative;
float: left;
position: relative;
width: auto;
height: 190px;
margin-left: auto;
margin-right: auto;
text-align: left;
overflow: hidden;
padding-left: 15px;
height: 190px;
margin-left: auto;
margin-right: auto;
text-align: left;
overflow: hidden;
padding-left: 15px;
padding-top: 0px;
background-color: white;
}
#contentcontainer {
position: relative;
float: left;
width: 500px;
height: auto;
margin-left: auto;
margin-right: auto;
color: #222222;
text-align: left;
font-size: 9pt;
overflow: auto;
background-color: white;
padding-left: 10px;
padding-right: 10px;
#contentcontainer {
position: relative;
float: left;
width: 500px;
height: auto;
margin-left: auto;
margin-right: auto;
color: #222222;
text-align: left;
font-size: 9pt;
overflow: auto;
background-color: white;
padding-left: 10px;
padding-right: 10px;
}
p.navbuttons a {
color: #222222;
text-decoration: none;
background-color: none;
display: block;
padding: 3px 0px 3px 1.5px;
width: 100%;
border-top: none;
border-right: none;
border-bottom: none;
border-left: none;
background-repeat: no-repeat;
font-size: 12pt;
}
p.navbuttons a:hover, p.navbuttons a:active {
background-color: gray;
background-repeat: no-repeat;
p.navbuttons a {
color: #222222;
text-decoration: none;
background-color: none;
display: block;
padding: 3px 0px 3px 1.5px;
width: 100%;
border-top: none;
border-right: none;
border-bottom: none;
border-left: none;
background-repeat: no-repeat;
font-size: 12pt;
}
p.navbuttons a:hover, p.navbuttons a:active {
background-color: gray;
background-repeat: no-repeat;
color: white;
</style>
</head>
</style>
</head>
<body>
<div id="pagecontainer">
<div id="leftcontainer">
<div id="logocontainer">
<img src="icons/ftoolslogo.png" align="left"/>
</div>
<div id="navcontainer">
</div>
<div id="navcontainer">
<p class="navbuttons">
<a href="javascript:show_hide('home', 'show'); javascript:hide('analysis'); javascript:hide('sampling');
javascript:hide('geoprocessing'); javascript:hide('table'); javascript:hide('new');
javascript:hide('management')">Home</a>
javascript:hide('management')">Home</a>
<a href="javascript:hide('home'); javascript:show_hide('analysis', 'show'); javascript:hide('sampling');
javascript:hide('geoprocessing'); javascript:hide('table'); javascript:hide('new');
javascript:hide('management')">Analysis Tools</a>
@ -190,10 +190,10 @@ p.navbuttons a:hover, p.navbuttons a:active {
javascript:show_hide('management', 'show')">Data Management Tools</a>
<a href="javascript:show_hide('new', 'show'); javascript:hide('analysis'); javascript:hide('sampling');
javascript:hide('geoprocessing'); javascript:hide('table');
javascript:hide('management'); javascript:hide('home')">What's New</a>
</p>
javascript:hide('management'); javascript:hide('home')">What's New</a>
</p>
</div>
</div>
</div>
<div id="contentcontainer">
<div id="home" style="display:show" class="content-box">
<h1>fTools help</h1>
@ -213,119 +213,119 @@ p.navbuttons a:hover, p.navbuttons a:active {
to report a bug, make suggestions for improving fTools, or have a question about
the tools, please email me: carson.farmer@gmail.com</p>
<p>I hope you enjoy,</p><p>Carson Farmer</p>
</div>
</div>
<div id="analysis" style="display:none" class="content-box">
<h1>Analysis Tools</h1>
<xsl:for-each select="/functions/analysis/ftools_function" >
<div id="function">
<h1>Analysis Tools</h1>
<xsl:for-each select="/functions/analysis/ftools_function" >
<div id="function">
<div id="head">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="image" />
</xsl:attribute>
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="image" />
</xsl:attribute>
</xsl:element>
:
<xsl:value-of select="name" />
</div>
<div id="description">
<xsl:value-of select="name" />
</div>
<div id="description">
<xsl:value-of select="description" />
</div>
<div id="long_description">
<xsl:value-of select="long_description" />
</div>
</div>
</div>
</div>
</xsl:for-each>
</div>
<div id="sampling" style="display:none" class="content-box">
<h1>Sampling Tools</h1>
<xsl:for-each select="/functions/sampling/ftools_function">
<div id="function">
<h1>Sampling Tools</h1>
<xsl:for-each select="/functions/sampling/ftools_function">
<div id="function">
<div id="head">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="image" />
</xsl:attribute>
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="image" />
</xsl:attribute>
</xsl:element>
:
<xsl:value-of select="name" />
</div>
<div id="description">
<xsl:value-of select="name" />
</div>
<div id="description">
<xsl:value-of select="description" />
</div>
<div id="long_description">
<xsl:value-of select="long_description" />
</div>
</div>
</div>
</div>
</xsl:for-each>
</div>
<div id="geoprocessing" style="display:none" class="content-box">
<h1>Geoprocessing Tools</h1>
<xsl:for-each select="/functions/geoprocessing/ftools_function">
<div id="function">
<h1>Geoprocessing Tools</h1>
<xsl:for-each select="/functions/geoprocessing/ftools_function">
<div id="function">
<div id="head">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="image" />
</xsl:attribute>
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="image" />
</xsl:attribute>
</xsl:element>
:
<xsl:value-of select="name" />
</div>
<div id="description">
<xsl:value-of select="name" />
</div>
<div id="description">
<xsl:value-of select="description" />
</div>
<div id="long_description">
<xsl:value-of select="long_description" />
</div>
</div>
</div>
</div>
</xsl:for-each>
</div>
<div id="table" style="display:none" class="content-box">
<h1>Geometry Tools</h1>
<xsl:for-each select="/functions/geometry/ftools_function">
<div id="function">
<h1>Geometry Tools</h1>
<xsl:for-each select="/functions/geometry/ftools_function">
<div id="function">
<div id="head">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="image" />
</xsl:attribute>
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="image" />
</xsl:attribute>
</xsl:element>
:
<xsl:value-of select="name" />
</div>
<div id="description">
<xsl:value-of select="name" />
</div>
<div id="description">
<xsl:value-of select="description" />
</div>
<div id="long_description">
<xsl:value-of select="long_description" />
</div>
</div>
</div>
</div>
</xsl:for-each>
</div>
<div id="management" style="display:none" class="content-box">
<h1>Management Tools</h1>
<xsl:for-each select="/functions/management/ftools_function">
<div id="function">
<h1>Management Tools</h1>
<xsl:for-each select="/functions/management/ftools_function">
<div id="function">
<div id="head">
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="image" />
</xsl:attribute>
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="image" />
</xsl:attribute>
</xsl:element>
:
<xsl:value-of select="name" />
</div>
<div id="description">
<xsl:value-of select="name" />
</div>
<div id="description">
<xsl:value-of select="description" />
</div>
<div id="long_description">
<xsl:value-of select="long_description" />
</div>
</div>
</div>
</div>
</xsl:for-each>
</div>
<div id="new" style="display:none" class="content-box">
<h1>What's New</h1>
<h1>What's New</h1>
<ul>
<li>Inputs and outputs allowed to contain non-ascii characters</li>
<li>User able to specify encoding style for all outputs</li>
@ -356,10 +356,10 @@ p.navbuttons a:hover, p.navbuttons a:active {
</li>
<li>As well as several new bug fixes, corrections, and improvements</li>
</ul>
</div>
</div>
</div>
</div>
</body>
</div>
</body>
</html>
</xsl:template>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,11 +1,11 @@
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from qgis.gui import *
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from qgis.gui import *
from frmReProject import Ui_Dialog
class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface):
QDialog.__init__(self)

View File

@ -400,53 +400,53 @@ class geometryThread( QThread ):
nFeat = vprovider.featureCount()
nElement = 0
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0 )
self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
while vprovider.nextFeature( inFeat ):
geom = inFeat.geometry()
area = QgsDistanceArea()
A = area.measure( geom )
multi_geom = QgsGeometry()
bounding = inFeat.geometry().boundingBox()
xmin = bounding.xMinimum()
ymin = bounding.yMinimum()
xmax = bounding.xMaximum()
ymax = bounding.yMaximum()
if geom.type() == 2:
cx = 0
cy = 0
area2 = 0
if geom.isMultipart():
multi_geom = geom.asMultiPolygon()
for k in multi_geom:
for h in k:
for i in range(0, len(h) - 1):
j = (i + 1) % len(h)
factor = ((h[i].x()) * (h[j].y()) - (h[j].x()) * (h[i].y()))
cx = cx + ((h[i].x()) + (h[j].x())) * factor
cy = cy + ((h[i].y()) + (h[j].y())) * factor
else:
multi_geom = geom.asPolygon()
for k in multi_geom:
for i in range(0, len(k) - 1):
j = (i + 1) % len(k)
factor = (k[i].x()) * (k[j].y()) - (k[j].x()) * (k[i].y())
cx = cx + ((k[i].x()) + (k[j].x())) * factor
cy = cy + ((k[i].y()) + (k[j].y())) * factor
A = A * 6
factor = 1/A
cx = cx * factor
cy = cy * factor
if cx < xmin:
cx = cx * -1
if cy < ymin:
cy = cy * -1
if cx > xmax:
cx = cx * -1
if cy > ymax:
cy = cy * -1
outfeat.setGeometry( QgsGeometry.fromPoint( QgsPoint( cx, cy ) ) )
atMap = inFeat.attributeMap()
outfeat.setAttributeMap( atMap )
self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )
while vprovider.nextFeature( inFeat ):
geom = inFeat.geometry()
area = QgsDistanceArea()
A = area.measure( geom )
multi_geom = QgsGeometry()
bounding = inFeat.geometry().boundingBox()
xmin = bounding.xMinimum()
ymin = bounding.yMinimum()
xmax = bounding.xMaximum()
ymax = bounding.yMaximum()
if geom.type() == 2:
cx = 0
cy = 0
area2 = 0
if geom.isMultipart():
multi_geom = geom.asMultiPolygon()
for k in multi_geom:
for h in k:
for i in range(0, len(h) - 1):
j = (i + 1) % len(h)
factor = ((h[i].x()) * (h[j].y()) - (h[j].x()) * (h[i].y()))
cx = cx + ((h[i].x()) + (h[j].x())) * factor
cy = cy + ((h[i].y()) + (h[j].y())) * factor
else:
multi_geom = geom.asPolygon()
for k in multi_geom:
for i in range(0, len(k) - 1):
j = (i + 1) % len(k)
factor = (k[i].x()) * (k[j].y()) - (k[j].x()) * (k[i].y())
cx = cx + ((k[i].x()) + (k[j].x())) * factor
cy = cy + ((k[i].y()) + (k[j].y())) * factor
A = A * 6
factor = 1/A
cx = cx * factor
cy = cy * factor
if cx < xmin:
cx = cx * -1
if cy < ymin:
cy = cy * -1
if cx > xmax:
cx = cx * -1
if cy > ymax:
cy = cy * -1
outfeat.setGeometry( QgsGeometry.fromPoint( QgsPoint( cx, cy ) ) )
atMap = inFeat.attributeMap()
outfeat.setAttributeMap( atMap )
writer.addFeature( outfeat )
nElement += 1
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), nElement )

View File

@ -30,12 +30,12 @@
#
#---------------------------------------------------------------------
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import ftools_utils
from qgis.core import *
from frmIntersectLines import Ui_Dialog
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import ftools_utils
from qgis.core import *
from frmIntersectLines import Ui_Dialog
class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface):

View File

@ -31,13 +31,13 @@
#
#---------------------------------------------------------------------
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
import struct, itertools, datetime, decimal, ftools_utils
from frmJoinAttributes import Ui_Dialog
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
import struct, itertools, datetime, decimal, ftools_utils
from frmJoinAttributes import Ui_Dialog
class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface):
@ -300,7 +300,7 @@ class Dialog(QDialog, Ui_Dialog):
allAttrs = fProvider.attributeIndexes()
fProvider.select(allAttrs)
myFields = fProvider.fields()
return myFields
return myFields
def dbfreader(self, f):
"""Returns an iterator over records in a Xbase DBF file.

View File

@ -1,25 +1,26 @@
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import ftools_utils
from qgis.core import *
from math import *
from frmMeanCoords import Ui_Dialog
class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface, function):
QDialog.__init__(self)
self.iface = iface self.function = function
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import ftools_utils
from qgis.core import *
from math import *
from frmMeanCoords import Ui_Dialog
class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface, function):
QDialog.__init__(self)
self.iface = iface
self.function = function
self.setupUi(self)
self.updateUi()
self.updateUi()
QObject.connect(self.toolOut, SIGNAL("clicked()"), self.outFile)
QObject.connect(self.inShape, SIGNAL("currentIndexChanged(QString)"), self.update)
# populate layer list
self.progressBar.setValue(0)
mapCanvas = self.iface.mapCanvas()
for i in range(mapCanvas.layerCount()):
layer = mapCanvas.layer(i)
if layer.type() == layer.VectorLayer:
QObject.connect(self.inShape, SIGNAL("currentIndexChanged(QString)"), self.update)
# populate layer list
self.progressBar.setValue(0)
mapCanvas = self.iface.mapCanvas()
for i in range(mapCanvas.layerCount()):
layer = mapCanvas.layer(i)
if layer.type() == layer.VectorLayer:
self.inShape.addItem(layer.name())
def updateUi(self):
@ -30,7 +31,7 @@ class Dialog(QDialog, Ui_Dialog):
elif self.function == 2:
self.setWindowTitle("Standard distance")
self.resize(381, 100)
def update(self, inputLayer):
self.weightField.clear()
self.uniqueField.clear()
@ -42,28 +43,28 @@ class Dialog(QDialog, Ui_Dialog):
if changedField[i].type() == QVariant.Int or changedField[i].type() == QVariant.Double:
self.weightField.addItem(unicode(changedField[i].name()))
self.uniqueField.addItem(unicode(changedField[i].name()))
def accept(self):
if self.inShape.currentText() == "":
QMessageBox.information(self, "Coordinate statistics", "No input vector layer specified")
elif self.outShape.text() == "":
QMessageBox.information(self, "Coordinate statistics", "Please specify output shapefile")
else:
inName = self.inShape.currentText()
outPath = self.outShape.text()
if outPath.contains("\\"):
outName = outPath.right((outPath.length() - outPath.lastIndexOf("\\")) - 1)
else:
outName = outPath.right((outPath.length() - outPath.lastIndexOf("/")) - 1)
if outName.endsWith(".shp"):
outName = outName.left(outName.length() - 4)
self.compute(inName, outPath, self.weightField.currentText(), self.sizeValue.value(), self.uniqueField.currentText())
self.progressBar.setValue(100)
self.outShape.clear()
addToTOC = QMessageBox.question(self, "Coordinate statistics", "Created output point Shapefile:\n" + outPath
+ "\n\nWould you like to add the new layer to the TOC?", QMessageBox.Yes, QMessageBox.No, QMessageBox.NoButton)
if addToTOC == QMessageBox.Yes:
def accept(self):
if self.inShape.currentText() == "":
QMessageBox.information(self, "Coordinate statistics", "No input vector layer specified")
elif self.outShape.text() == "":
QMessageBox.information(self, "Coordinate statistics", "Please specify output shapefile")
else:
inName = self.inShape.currentText()
outPath = self.outShape.text()
if outPath.contains("\\"):
outName = outPath.right((outPath.length() - outPath.lastIndexOf("\\")) - 1)
else:
outName = outPath.right((outPath.length() - outPath.lastIndexOf("/")) - 1)
if outName.endsWith(".shp"):
outName = outName.left(outName.length() - 4)
self.compute(inName, outPath, self.weightField.currentText(), self.sizeValue.value(), self.uniqueField.currentText())
self.progressBar.setValue(100)
self.outShape.clear()
addToTOC = QMessageBox.question(self, "Coordinate statistics", "Created output point Shapefile:\n" + outPath
+ "\n\nWould you like to add the new layer to the TOC?", QMessageBox.Yes, QMessageBox.No, QMessageBox.NoButton)
if addToTOC == QMessageBox.Yes:
self.vlayer = QgsVectorLayer(outPath, unicode(outName), "ogr")
if self.vlayer.geometryType() == QGis.Point:
render = QgsSingleSymbolRenderer(QGis.Point)
@ -74,25 +75,25 @@ class Dialog(QDialog, Ui_Dialog):
symbol.setPointSize(5)
render.addSymbol(symbol)
self.vlayer.setRenderer(render)
QgsMapLayerRegistry.instance().addMapLayer(self.vlayer)
self.progressBar.setValue(0)
QgsMapLayerRegistry.instance().addMapLayer(self.vlayer)
self.progressBar.setValue(0)
def outFile(self):
self.outShape.clear()
( self.shapefileName, self.encoding ) = ftools_utils.saveDialog( self )
if self.shapefileName is None or self.encoding is None:
return
self.outShape.setText( QString( self.shapefileName ) )
def compute(self, inName, outName, weightField="", times=1, uniqueField=""):
vlayer = self.getVectorLayerByName(inName)
self.outShape.setText( QString( self.shapefileName ) )
def compute(self, inName, outName, weightField="", times=1, uniqueField=""):
vlayer = self.getVectorLayerByName(inName)
provider = vlayer.dataProvider()
weightIndex = provider.fieldNameIndex(weightField)
uniqueIndex = provider.fieldNameIndex(uniqueField)
feat = QgsFeature()
allAttrs = provider.attributeIndexes()
provider.select(allAttrs)
sRs = provider.crs()
uniqueIndex = provider.fieldNameIndex(uniqueField)
feat = QgsFeature()
allAttrs = provider.attributeIndexes()
provider.select(allAttrs)
sRs = provider.crs()
check = QFile(self.shapefileName)
if check.exists():
if not QgsVectorFileWriter.deleteShapeFile(self.shapefileName):
@ -108,7 +109,7 @@ class Dialog(QDialog, Ui_Dialog):
writer = QgsVectorFileWriter(self.shapefileName, self.encoding, fieldList, QGis.WKBPolygon, sRs)
else:
fieldList = { 0 : QgsField("MEAN_X", QVariant.Double), 1 : QgsField("MEAN_Y", QVariant.Double), 2 : QgsField("UID", QVariant.String) }
writer = QgsVectorFileWriter(self.shapefileName, self.encoding, fieldList, QGis.WKBPoint, sRs)
writer = QgsVectorFileWriter(self.shapefileName, self.encoding, fieldList, QGis.WKBPoint, sRs)
outfeat = QgsFeature()
points = []
weights = []
@ -117,7 +118,7 @@ class Dialog(QDialog, Ui_Dialog):
self.progressBar.setValue(0)
self.progressBar.setRange(0, nFeat)
for j in uniqueValues:
provider.rewind()
provider.rewind()
while provider.nextFeature(feat):
nElement += 1
self.progressBar.setValue(nElement)
@ -131,7 +132,7 @@ class Dialog(QDialog, Ui_Dialog):
if weightIndex == -1:
weight = 1.00
else:
weight = float(feat.attributeMap()[weightIndex].toDouble()[0])
weight = float(feat.attributeMap()[weightIndex].toDouble()[0])
geom = QgsGeometry(feat.geometry())
geom = self.extract(geom)
for i in geom:
@ -168,36 +169,36 @@ class Dialog(QDialog, Ui_Dialog):
outfeat.setGeometry(QgsGeometry.fromPoint(meanPoint).buffer(sd * times, 10))
outfeat.addAttribute(0, QVariant(sd))
outfeat.addAttribute(1, QVariant(j))
else:
else:
outfeat.setGeometry(QgsGeometry.fromPoint(meanPoint))
outfeat.addAttribute(0, QVariant(cx))
outfeat.addAttribute(1, QVariant(cy))
outfeat.addAttribute(2, QVariant(j))
outfeat.addAttribute(2, QVariant(j))
writer.addFeature(outfeat)
if single:
break
del writer
# Gets vector layer by layername in canvas
def getVectorLayerByName(self, myName):
mc = self.iface.mapCanvas()
nLayers = mc.layerCount()
for l in range(nLayers):
break
del writer
# Gets vector layer by layername in canvas
def getVectorLayerByName(self, myName):
mc = self.iface.mapCanvas()
nLayers = mc.layerCount()
for l in range(nLayers):
layer = mc.layer(l)
if layer.name() == unicode(myName):
vlayer = QgsVectorLayer(unicode(layer.source()), unicode(myName), unicode(layer.dataProvider().name()))
if vlayer.isValid():
return vlayer
# Retreive the field map of a vector Layer
def getFieldList(self, vlayer):
fProvider = vlayer.dataProvider()
feat = QgsFeature()
allAttrs = fProvider.attributeIndexes()
# fetch all attributes for each feature
fProvider.select(allAttrs)
# retrieve all fields
myFields = fProvider.fields()
vlayer = QgsVectorLayer(unicode(layer.source()), unicode(myName), unicode(layer.dataProvider().name()))
if vlayer.isValid():
return vlayer
# Retrieve the field map of a vector Layer
def getFieldList(self, vlayer):
fProvider = vlayer.dataProvider()
feat = QgsFeature()
allAttrs = fProvider.attributeIndexes()
# fetch all attributes for each feature
fProvider.select(allAttrs)
# retrieve all fields
myFields = fProvider.fields()
return myFields
def extract(self, geom):
@ -237,4 +238,4 @@ class Dialog(QDialog, Ui_Dialog):
if not f.attributeMap()[index].toString() in check:
values.append( f.attributeMap()[index] )
check.append( f.attributeMap()[index].toString() )
return values
return values

View File

@ -32,13 +32,13 @@
#
#---------------------------------------------------------------------
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from frmPointDistance import Ui_Dialog
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from frmPointDistance import Ui_Dialog
import csv
from math import *
from math import *
class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface):
QDialog.__init__(self)

View File

@ -30,12 +30,12 @@
#
#---------------------------------------------------------------------
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import ftools_utils
from qgis.core import *
from frmPointsInPolygon import Ui_Dialog
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import ftools_utils
from qgis.core import *
from frmPointsInPolygon import Ui_Dialog
class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface):

View File

@ -29,32 +29,32 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
#---------------------------------------------------------------------
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from random import *
import math, ftools_utils
from frmRandPoints import Ui_Dialog
class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface):
QDialog.__init__(self)
self.iface = iface
self.setupUi(self)
QObject.connect(self.toolOut, SIGNAL("clicked()"), self.outFile)
QObject.connect(self.inShape, SIGNAL("currentIndexChanged(QString)"), self.update)
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from random import *
import math, ftools_utils
from frmRandPoints import Ui_Dialog
class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface):
QDialog.__init__(self)
self.iface = iface
self.setupUi(self)
QObject.connect(self.toolOut, SIGNAL("clicked()"), self.outFile)
QObject.connect(self.inShape, SIGNAL("currentIndexChanged(QString)"), self.update)
self.progressBar.setValue(0)
self.setWindowTitle("Random points")
mapCanvas = self.iface.mapCanvas()
for i in range(mapCanvas.layerCount()):
self.setWindowTitle("Random points")
mapCanvas = self.iface.mapCanvas()
for i in range(mapCanvas.layerCount()):
layer = mapCanvas.layer(i)
if (layer.type() == layer.VectorLayer and layer.geometryType() == QGis.Polygon) or layer.type() == layer.RasterLayer:
self.inShape.addItem(layer.name())
# If input layer is changed, update field list
def update(self, inputLayer):
def update(self, inputLayer):
self.cmbField.clear()
changedLayer = self.getMapLayerByName(inputLayer)
if changedLayer.type() == changedLayer.VectorLayer:
@ -76,12 +76,12 @@ class Dialog(QDialog, Ui_Dialog):
self.cmbField.setEnabled(False)
self.label_4.setEnabled(False)
# when 'OK' button is pressed, gather required inputs, and initiate random points generation
def accept(self):
if self.inShape.currentText() == "":
QMessageBox.information(self, "Random Points", "No input layer specified")
elif self.outShape.text() == "":
QMessageBox.information(self, "Random Points", "Please specify output shapefile")
# when 'OK' button is pressed, gather required inputs, and initiate random points generation
def accept(self):
if self.inShape.currentText() == "":
QMessageBox.information(self, "Random Points", "No input layer specified")
elif self.outShape.text() == "":
QMessageBox.information(self, "Random Points", "Please specify output shapefile")
else:
inName = self.inShape.currentText()
self.progressBar.setValue(1)
@ -129,15 +129,15 @@ class Dialog(QDialog, Ui_Dialog):
self.vlayer = QgsVectorLayer(outPath, unicode(outName), "ogr")
QgsMapLayerRegistry.instance().addMapLayer(self.vlayer)
self.progressBar.setValue(0)
def outFile(self):
self.outShape.clear()
( self.shapefileName, self.encoding ) = ftools_utils.saveDialog( self )
if self.shapefileName is None or self.encoding is None:
return
self.outShape.setText( QString( self.shapefileName ) )
# combine all polygons in layer to create single polygon (slow for complex polygons)
# combine all polygons in layer to create single polygon (slow for complex polygons)
def createSinglePolygon(self, vlayer, progressBar):
provider = vlayer.dataProvider()
allAttrs = provider.attributeIndexes()
@ -157,8 +157,8 @@ class Dialog(QDialog, Ui_Dialog):
count = count + add
progressBar.setValue(count)
return geom
# Generate list of random points
# Generate list of random points
def simpleRandom(self, n, bound, xmin, xmax, ymin, ymax):
seed()
points = []
@ -169,12 +169,12 @@ class Dialog(QDialog, Ui_Dialog):
points.append(pGeom)
i = i + 1
return points
# Get vector layer by name from TOC
def getVectorLayerByName(self, myName):
mc = self.iface.mapCanvas()
nLayers = mc.layerCount()
for l in range(nLayers):
# Get vector layer by name from TOC
def getVectorLayerByName(self, myName):
mc = self.iface.mapCanvas()
nLayers = mc.layerCount()
for l in range(nLayers):
layer = mc.layer(l)
if layer.name() == unicode(myName):
vlayer = QgsVectorLayer(unicode(layer.source()), unicode(myName), unicode(layer.dataProvider().name()))
@ -182,8 +182,8 @@ class Dialog(QDialog, Ui_Dialog):
return vlayer
else:
QMessageBox.information(self, "Generate Centroids", "Vector layer is not valid")
# Get map layer by name from TOC
# Get map layer by name from TOC
def getMapLayerByName(self, myName):
mc = self.iface.mapCanvas()
nLayers = mc.layerCount()
@ -191,8 +191,8 @@ class Dialog(QDialog, Ui_Dialog):
layer = mc.layer(l)
if layer.name() == unicode(myName):
if layer.isValid():
return layer
# Retreive the field map of a vector Layer
return layer
# Retrieve the field map of a vector Layer
def getFieldList(self, vlayer):
fProvider = vlayer.dataProvider()
feat = QgsFeature()
@ -200,8 +200,8 @@ class Dialog(QDialog, Ui_Dialog):
fProvider.select(allAttrs)
myFields = fProvider.fields()
return myFields
def randomize(self, inLayer, outPath, minimum, design, value, progressBar):
outFeat = QgsFeature()
if design == "unstratified":
@ -230,8 +230,8 @@ class Dialog(QDialog, Ui_Dialog):
count = count + add
progressBar.setValue(count)
del writer
#
#
def loopThruPolygons(self, inLayer, numRand, design, progressBar):
sProvider = inLayer.dataProvider()
sAllAttrs = sProvider.attributeIndexes()
@ -258,4 +258,4 @@ class Dialog(QDialog, Ui_Dialog):
sPoints.extend(self.simpleRandom(value, sGeom, sExt.xMinimum(), sExt.xMaximum(), sExt.yMinimum(), sExt.yMaximum()))
count = count + add
progressBar.setValue(count)
return sPoints
return sPoints

View File

@ -1,64 +1,64 @@
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from frmRandom import Ui_Dialog
import random
class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface):
QDialog.__init__(self)
self.iface = iface
# Set up the user interface from Designer.
self.setupUi(self)
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from frmRandom import Ui_Dialog
import random
class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface):
QDialog.__init__(self)
self.iface = iface
# Set up the user interface from Designer.
self.setupUi(self)
QObject.connect(self.inShape, SIGNAL("currentIndexChanged(QString)"), self.changed)
self.setWindowTitle("Random selection")
# populate layer list
self.progressBar.setValue(0)
mapCanvas = self.iface.mapCanvas()
for i in range(mapCanvas.layerCount()):
layer = mapCanvas.layer(i)
if layer.type() == layer.VectorLayer:
self.inShape.addItem(layer.name())
def changed(self, inputLayer):
changedLayer = self.getVectorLayerByName(inputLayer)
changedProvider = changedLayer.dataProvider()
upperVal = changedProvider.featureCount()
self.spnNumber.setMaximum(upperVal)
def accept(self):
if self.inShape.currentText() == "":
QMessageBox.information(self, "Random Selection Tool", "No input shapefile specified")
else:
self.progressBar.setValue(10)
inName = self.inShape.currentText()
self.progressBar.setValue(20)
layer = self.getVectorLayerByName(inName)
self.progressBar.setValue(30)
if self.rdoNumber.isChecked():
value = self.spnNumber.value()
self.progressBar.setValue(60)
else:
value = self.spnPercent.value()
self.progressBar.setValue(50)
value = int(round((value / 100.0000), 4) * layer.featureCount())
self.progressBar.setValue(60)
selran = random.sample(xrange(0, layer.featureCount()), value)
self.progressBar.setValue(70)
self.progressBar.setValue(80)
self.progressBar.setValue(90)
self.progressBar.setValue(100)
layer.setSelectedFeatures(selran)
self.progressBar.setValue(0)
#Gets vector layer by layername in canvas
#Return: QgsVectorLayer
def getVectorLayerByName(self, myName):
mc = self.iface.mapCanvas()
nLayers = mc.layerCount()
for l in range(nLayers):
layer = mc.layer(l)
if layer.name() == unicode(myName):
if layer.isValid():
return layer
self.setWindowTitle("Random selection")
# populate layer list
self.progressBar.setValue(0)
mapCanvas = self.iface.mapCanvas()
for i in range(mapCanvas.layerCount()):
layer = mapCanvas.layer(i)
if layer.type() == layer.VectorLayer:
self.inShape.addItem(layer.name())
def changed(self, inputLayer):
changedLayer = self.getVectorLayerByName(inputLayer)
changedProvider = changedLayer.dataProvider()
upperVal = changedProvider.featureCount()
self.spnNumber.setMaximum(upperVal)
def accept(self):
if self.inShape.currentText() == "":
QMessageBox.information(self, "Random Selection Tool", "No input shapefile specified")
else:
self.progressBar.setValue(10)
inName = self.inShape.currentText()
self.progressBar.setValue(20)
layer = self.getVectorLayerByName(inName)
self.progressBar.setValue(30)
if self.rdoNumber.isChecked():
value = self.spnNumber.value()
self.progressBar.setValue(60)
else:
value = self.spnPercent.value()
self.progressBar.setValue(50)
value = int(round((value / 100.0000), 4) * layer.featureCount())
self.progressBar.setValue(60)
selran = random.sample(xrange(0, layer.featureCount()), value)
self.progressBar.setValue(70)
self.progressBar.setValue(80)
self.progressBar.setValue(90)
self.progressBar.setValue(100)
layer.setSelectedFeatures(selran)
self.progressBar.setValue(0)
#Gets vector layer by layername in canvas
#Return: QgsVectorLayer
def getVectorLayerByName(self, myName):
mc = self.iface.mapCanvas()
nLayers = mc.layerCount()
for l in range(nLayers):
layer = mc.layer(l)
if layer.name() == unicode(myName):
if layer.isValid():
return layer

View File

@ -1,12 +1,12 @@
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import ftools_utils
from qgis.core import *
from qgis.gui import *
from frmReProject import Ui_Dialog
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import ftools_utils
from qgis.core import *
from qgis.gui import *
from frmReProject import Ui_Dialog
import types
class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface):
QDialog.__init__(self)
@ -69,7 +69,7 @@ class Dialog(QDialog, Ui_Dialog):
format = QString( "<h2>%1</h2>%2 <br/> %3" )
header = QString( "Choose output CRS:" )
sentence1 = QString( "Please select the projection system to be used by the output layer." )
sentence2 = QString( "Ouput layer will be projected from it's current CRS to the output CRS." )
sentence2 = QString( "Output layer will be projected from it's current CRS to the output CRS." )
self.projSelect = QgsGenericProjectionSelector(self, Qt.Widget)
self.projSelect.setMessage( format.arg( header ).arg( sentence1 ).arg( sentence2 ))
if self.projSelect.exec_():
@ -124,7 +124,7 @@ class Dialog(QDialog, Ui_Dialog):
else:
QMessageBox.information(self, "Export to new projection", "Identical output spatial reference system chosen")
return False
# Gets vector layer by layername in canvas
def getVectorLayerByName(self, myName):
mc = self.iface.mapCanvas()
@ -134,9 +134,9 @@ class Dialog(QDialog, Ui_Dialog):
if unicode(layer.name()) == unicode(myName):
vlayer = QgsVectorLayer(unicode(layer.source()), unicode(myName), unicode(layer.dataProvider().name()))
if vlayer.isValid():
return vlayer
#Retreive the field map of a vector Layer
return vlayer
#Retrieve the field map of a vector Layer
#Return: QgsFieldMap
def getFieldList(self, vlayer):
fProvider = vlayer.dataProvider()
@ -144,9 +144,9 @@ class Dialog(QDialog, Ui_Dialog):
allAttrs = fProvider.attributeIndexes()
fProvider.select(allAttrs)
myFields = fProvider.fields()
return myFields
#Converts all geometries to points, and reprojects using specified QgsCoordinateTransformation
return myFields
#Converts all geometries to points, and reprojects using specified QgsCoordinateTransformation
#Output: Reprojected shapefile with attributes...
def pointReproject(self, vlayer, xform, writer, progressBar):
provider = vlayer.dataProvider()
@ -175,7 +175,7 @@ class Dialog(QDialog, Ui_Dialog):
outfeat.setGeometry(QgsGeometry.fromMultiPolyline([mappedTransform(xform, item) for item in multi_geom]))
else:
multi_geom = geom.asPolyline() #multi_geom is a line
outfeat.setGeometry(QgsGeometry.fromPolyline([xform.transform(item) for item in multi_geom]))
outfeat.setGeometry(QgsGeometry.fromPolyline([xform.transform(item) for item in multi_geom]))
elif geom.type() == 2: # it's a polygon
if geom.isMultipart():
multi_geom = geom.asMultiPolygon() #multi_geom is a multipolygon
@ -195,4 +195,4 @@ class Dialog(QDialog, Ui_Dialog):
def mappedTransform(xform, inList):
return [xform.transform(elem) for elem in inList]

View File

@ -29,25 +29,25 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
#---------------------------------------------------------------------
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import ftools_utils
from qgis.core import *
from random import *
from math import *
from frmRegPoints import Ui_Dialog
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import ftools_utils
from qgis.core import *
from random import *
from math import *
from frmRegPoints import Ui_Dialog
class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface):
QDialog.__init__(self)
self.iface = iface
self.setupUi(self)
def __init__(self, iface):
QDialog.__init__(self)
self.iface = iface
self.setupUi(self)
QObject.connect(self.toolOut, SIGNAL("clicked()"), self.outFile)
self.setWindowTitle("Regular points")
self.progressBar.setValue(0)
mapCanvas = self.iface.mapCanvas()
for i in range(mapCanvas.layerCount()):
self.setWindowTitle("Regular points")
self.progressBar.setValue(0)
mapCanvas = self.iface.mapCanvas()
for i in range(mapCanvas.layerCount()):
layer = mapCanvas.layer(i)
self.inShape.addItem(layer.name())
@ -85,15 +85,15 @@ class Dialog(QDialog, Ui_Dialog):
self.vlayer = QgsVectorLayer(outPath, unicode(outName), "ogr")
QgsMapLayerRegistry.instance().addMapLayer(self.vlayer)
self.progressBar.setValue(0)
def outFile(self):
self.outShape.clear()
( self.shapefileName, self.encoding ) = ftools_utils.saveDialog( self )
if self.shapefileName is None or self.encoding is None:
return
self.outShape.setText( QString( self.shapefileName ) )
# Generate list of random points
# Generate list of random points
def simpleRandom(self, n, bound, xmin, xmax, ymin, ymax):
seed()
points = []
@ -104,12 +104,12 @@ class Dialog(QDialog, Ui_Dialog):
points.append(pGeom)
i = i + 1
return points
# Get vector layer by name from TOC
def getVectorLayerByName(self, myName):
mc = self.iface.mapCanvas()
nLayers = mc.layerCount()
for l in range(nLayers):
# Get vector layer by name from TOC
def getVectorLayerByName(self, myName):
mc = self.iface.mapCanvas()
nLayers = mc.layerCount()
for l in range(nLayers):
layer = mc.layer(l)
if layer.name() == unicode(myName):
vlayer = QgsVectorLayer(unicode(layer.source()), unicode(myName), unicode(layer.dataProvider().name()))
@ -117,8 +117,8 @@ class Dialog(QDialog, Ui_Dialog):
return vlayer
else:
QMessageBox.information(self, "Generate Regular Points", "Vector layer is not valid")
# Get map layer by name from TOC
# Get map layer by name from TOC
def getMapLayerByName(self, myName):
mc = self.iface.mapCanvas()
nLayers = mc.layerCount()
@ -127,8 +127,8 @@ class Dialog(QDialog, Ui_Dialog):
if layer.name() == unicode(myName):
if layer.isValid():
return layer
def regularize(self, bound, outPath, offset, value, gridType, inset, progressBar):
area = bound.width() * bound.height()
if offset:
@ -167,5 +167,5 @@ class Dialog(QDialog, Ui_Dialog):
count = count + add
progressBar.setValue(count)
y = y - pointSpacing
del writer
del writer

View File

@ -1,9 +1,9 @@
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from frmPointsInPolygon import Ui_Dialog
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from frmPointsInPolygon import Ui_Dialog
class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface):
@ -71,13 +71,13 @@ class Dialog(QDialog, Ui_Dialog):
selectedSet = list(set(inputLayer.selectedFeaturesIds()).difference(selectedSet))
inputLayer.setSelectedFeatures(selectedSet)
#Gets vector layer by layername in canvas
#Return: QgsVectorLayer
def getVectorLayerByName(self, myName):
mc = self.iface.mapCanvas()
nLayers = mc.layerCount()
for l in range(nLayers):
layer = mc.layer(l)
if layer.name() == unicode(myName):
if layer.isValid():
#Gets vector layer by layername in canvas
#Return: QgsVectorLayer
def getVectorLayerByName(self, myName):
mc = self.iface.mapCanvas()
nLayers = mc.layerCount()
for l in range(nLayers):
layer = mc.layer(l)
if layer.name() == unicode(myName):
if layer.isValid():
return layer

View File

@ -32,12 +32,12 @@
#
#---------------------------------------------------------------------
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import ftools_utils
from qgis.core import *
from frmSpatialJoin import Ui_Dialog
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import ftools_utils
from qgis.core import *
from frmSpatialJoin import Ui_Dialog
class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface):

View File

@ -29,12 +29,12 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
#--------------------------------------------------------------------
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import random
from qgis.core import *
from frmSubsetSelect import Ui_Dialog
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import random
from qgis.core import *
from frmSubsetSelect import Ui_Dialog
class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface):
@ -127,7 +127,7 @@ class Dialog(QDialog, Ui_Dialog):
selran.extend(mlayer.selectedFeaturesIds())
mlayer.setSelectedFeatures(selran)
else:
mlayer.setSelectedFeatures(range(0, mlayer.featureCount()))
mlayer.setSelectedFeatures(range(0, mlayer.featureCount()))
def getVectorLayerByName(self, myName):
mc = self.iface.mapCanvas()

View File

@ -30,12 +30,12 @@
#
#---------------------------------------------------------------------
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import ftools_utils
from qgis.core import *
from frmSumLines import Ui_Dialog
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import ftools_utils
from qgis.core import *
from frmSumLines import Ui_Dialog
class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface):

View File

@ -28,13 +28,13 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
#---------------------------------------------------------------------
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import ftools_utils
from qgis.core import *
from frmVectorGrid import Ui_Dialog
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import ftools_utils
from qgis.core import *
from frmVectorGrid import Ui_Dialog
class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface):
QDialog.__init__(self)
@ -76,11 +76,11 @@ class Dialog(QDialog, Ui_Dialog):
self.xMax.setText( unicode( boundBox.xMaximum() ) )
self.yMax.setText( unicode( boundBox.yMaximum() ) )
def accept(self):
def accept(self):
if self.xMin.text() == "" or self.xMax.text() == "" or self.yMin.text() == "" or self.yMax.text() == "":
QMessageBox.information(self, "Vector grid", "Please specify valid extent coordinates")
QMessageBox.information(self, "Vector grid", "Please specify valid extent coordinates")
elif self.outShape.text() == "":
QMessageBox.information(self, "Vector grid", "Please specify output shapefile")
QMessageBox.information(self, "Vector grid", "Please specify output shapefile")
else:
try:
boundBox = QgsRectangle(

View File

@ -26,14 +26,14 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
#---------------------------------------------------------------------
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
#import os, sys, string, math
from frmVectorSplit import Ui_Dialog
#---------------------------------------------------------------------
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
#import os, sys, string, math
from frmVectorSplit import Ui_Dialog
class Dialog(QDialog, Ui_Dialog):
def __init__(self, iface):
QDialog.__init__(self)

View File

@ -257,31 +257,31 @@ class visualThread( QThread ):
polygons = geom.asMultiPolygon()
for polygon in polygons:
if not self.isHoleNested( polygon ):
lstErrors.append( self.tr( "Feature " ) + unicode( feat.id() ) + self.tr( " contains an unested hole" ) )
lstErrors.append( self.tr( "Feature %1 contains an unnested hole" ).arg( unicode( feat.id() ) ) )
count += 1
if not self.isPolygonClosed( polygon ):
lstErrors.append( self.tr( "Feature " ) + unicode( feat.id() ) + self.tr( " is not closed" ) )
lstErrors.append( self.tr( "Feature %1 is not closed" ).arg( unicode( feat.id() ) ) )
count += 1
if self.isSelfIntersecting( polygon ):
lstErrors.append( self.tr( "Feature " ) + unicode( feat.id() ) + self.tr( " is self intersecting" ) )
lstErrors.append( self.tr( "Feature %1 is self intersecting" ).arg( unicode( feat.id() ) ) )
count += 1
if not self.isCorrectOrientation( polygon ):
lstErrors.append( self.tr( "Feature " ) + unicode( feat.id() ) + self.tr( " has incorrect node ordering" ) )
lstErrors.append( self.tr( "Feature %1 has incorrect node ordering" ).arg( unicode( feat.id() ) ) )
count += 1
else:
geom = geom.asPolygon()
if not self.isHoleNested( geom ):
lstErrors.append( self.tr( "Feature " ) + unicode( feat.id() ) + self.tr( " contains an unested hole" ) )
lstErrors.append( self.tr( "Feature %1 contains an unnested hole" ).arg( unicode( feat.id() ) ) )
count += 1
if not self.isPolygonClosed( geom ):
lstErrors.append( self.tr( "Feature " ) + unicode( feat.id() ) + self.tr( " is not closed" ) )
lstErrors.append( self.tr( "Feature %1 is not closed" ).arg( unicode( feat.id() ) ) )
count += 1
if self.isSelfIntersecting( geom ):
lstErrors.append( self.tr( "Feature " ) + unicode( feat.id() ) + self.tr( " is self intersecting" ) )
lstErrors.append( self.tr( "Feature %1 is self intersecting" ).arg( unicode( feat.id() ) ) )
count += 1
if not self.isCorrectOrientation( geom ):
lstErrors.append( self.tr( "Feature " ) + unicode( feat.id() ) + self.tr( " has incorrect node ordering" ) )
lstErrors.append( self.tr( "Feature %1 has incorrect node ordering" ).arg( unicode( feat.id() ) ) )
count += 1
return ( lstErrors, count )

View File

@ -125,7 +125,7 @@ class Ui_Dialog(object):
Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Projection Management Tool", None, QtGui.QApplication.UnicodeUTF8))
self.label_3.setText(QtGui.QApplication.translate("Dialog", "Input vector layer", None, QtGui.QApplication.UnicodeUTF8))
self.label_4.setText(QtGui.QApplication.translate("Dialog", "Input spatial reference system", None, QtGui.QApplication.UnicodeUTF8))
self.groupBox.setTitle(QtGui.QApplication.translate("Dialog", "Ouput spatial reference system", None, QtGui.QApplication.UnicodeUTF8))
self.groupBox.setTitle(QtGui.QApplication.translate("Dialog", "Output spatial reference system", None, QtGui.QApplication.UnicodeUTF8))
self.rdoProjection.setText(QtGui.QApplication.translate("Dialog", "Use predefined spatial reference system", None, QtGui.QApplication.UnicodeUTF8))
self.btnProjection.setText(QtGui.QApplication.translate("Dialog", "Choose", None, QtGui.QApplication.UnicodeUTF8))
self.radioButton_2.setText(QtGui.QApplication.translate("Dialog", "Import spatial reference system from existing layer", None, QtGui.QApplication.UnicodeUTF8))

View File

@ -46,7 +46,7 @@
<item row="4" column="0" colspan="2" >
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<string>Ouput spatial reference system</string>
<string>Output spatial reference system</string>
</property>
<layout class="QGridLayout" >
<item row="0" column="0" >