Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4 from BergWerkGIS/intersection
Browse files Browse the repository at this point in the history
Merge dev branch Intersection
  • Loading branch information
Wilhelm Berg authored and Wilhelm Berg committed Mar 5, 2015
2 parents b51b651 + 4a180ba commit 432e43e
Show file tree
Hide file tree
Showing 118 changed files with 20,281 additions and 16,922 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
help/

*.nja
*.sublime-project
*.sublime-workspace

.idea/
51 changes: 24 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
#VoGIS-Profil-Tool
One plugin working with QGIS 1.8 and 2.0.

One plugin working with QGIS 1.8 and 2.x.

##Developed for

Amt der Vorarlberger Landesregierung

Landesamt für Vermessung und Geoinformation
Amt der Vorarlberger Landesregierung

Landesamt für Vermessung und Geoinformation

http://vorarlberg.at/vorarlberg/bauen_wohnen/bauen/vermessung_geoinformation/start.htm

http://vorarlberg.at/vorarlberg/bauen_wohnen/bauen/vermessung_geoinformation/start.htm

##Developed on

OSGeo-Live 7.0:

http://live.osgeo.org/en/index.html

#Build from source

Directory **VoGISProfilTool** contains new enhanced version.

Directory **Z_VoGISProfilTool** contains old version.

```
* git clone https://github.com/BergWerkGIS/VoGIS-Profil-Tool.git
* cd ./VoGISProfilTool
Expand All @@ -30,19 +21,19 @@ Directory **Z_VoGISProfilTool** contains old version.
* make deploy #(compile and deploy to ~/.qgis/pyhton/plugins/VoGISProfilTool)
* make zip #(create plugin zip-file for deployment in local folder)
```

#Download the ready-to-deploy PlugIn

Download via QGIS Plugin Manager or directly from GitHub:
https://github.com/BergWerkGIS/VoGIS-Profil-Tool/raw/master/VoGisProfilTool/VoGisProfilTool.zip

#Description
Create profiles from DHMs using vector geometries or a digitized line.
Interpolate vertices (equidistant or constant number of vertices per input geometry).
Display profile plots.

Create profiles from DHMs using vector geometries or a digitized line.

Interpolate vertices (equidistant or constant number of vertices per input geometry).

Display profile plots.

Export to:
* 2.5D point or 2.5D line Shapefile
Expand All @@ -53,4 +44,10 @@ Export to:
* graphic (png, jpg, pdf)

![Alt text](/screenshots/maindialog.png)
![Alt text](/screenshots/plotdialog.png)
![Alt text](/screenshots/plotdialog.png)

## Known issues

If you get an error message about missing shapely, just do

`sudo apt-get install python-shapely`.
Binary file added VoGisProfilTool.zip
Binary file not shown.
89 changes: 77 additions & 12 deletions VoGisProfilTool/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#/***************************************************************************
# VoGISProfilToolMain
#
#
# VoGIS ProfilTool
# -------------------
# begin : 2013-05-28
# copyright : (C) 2013 by BergWerk GIS
# email : wb@BergWerk-GIS.at
# ***************************************************************************/
#
#
#/***************************************************************************
# * *
# * This program is free software; you can redistribute it and/or modify *
Expand All @@ -20,7 +20,7 @@
# CONFIGURATION
PLUGIN_UPLOAD = $(CURDIR)/plugin_upload.py

# Makefile for a PyQGIS plugin
# Makefile for a PyQGIS plugin

# translation
SOURCES = vogisprofiltoolmain.py\
Expand All @@ -33,7 +33,7 @@ SOURCES = vogisprofiltoolmain.py\
util/createProfile.py\
bo/profile.py
TRANSLATIONS = i18n/vogisprofiltoolmain_en.ts
#TRANSLATIONS =
#TRANSLATIONS =

# global

Expand All @@ -42,9 +42,72 @@ PLUGINNAME = VoGisProfilTool
QGISPIDIR = .qgis2

PY_FILES = vogisprofiltoolmain.py vogisprofiltoolmaindialog.py vogisprofiltoolplot.py __init__.py
EXTRAS = icons/icon.png icons/home.png icons/pan.png icons/save.png icons/zoomlast.png icons/zoomnext.png icons/zoomrectangle.png icons/zoomselect.png icons/identify.png
BO_FILES = bo/__init__.py bo/line.py bo/lineCollection.py bo/mapdata.py bo/raster.py bo/rasterCollection.py bo/settings.py bo/profile.py bo/segment.py bo/vertex.py bo/zVal.py bo/node.py bo/linkedList.py bo/plotExtent.py
UTIL_FILES = util/__init__.py util/u.py util/createProfile.py util/exportShape.py util/ptmaptool.py util/exportDxf.py
EXTRAS = icons/home.png \
icons/icon.png \
icons/identify.png \
icons/measure.png \
icons/pan.png \
icons/save.png \
icons/zoomlast.png \
icons/zoomnext.png \
icons/zoomrectangle.png \
icons/zoomselect.png
BO_FILES = bo/__init__.py \
bo/chartpoint.py \
bo/intersection.py \
bo/line.py \
bo/lineCollection.py \
bo/polygon.py \
bo/polygonCollection.py \
bo/mapdata.py \
bo/raster.py \
bo/rasterCollection.py \
bo/settings.py \
bo/profile.py \
bo/segment.py \
bo/vertex.py \
bo/zVal.py \
bo/node.py \
bo/linkedList.py \
bo/plotExtent.py
UTIL_FILES = util/__init__.py \
util/u.py \
util/createProfile.py \
util/exportShape.py \
util/ptmaptool.py \
util/exportDxf.py \
util/exportXls.py
XLSX_FILES = util/xlsxwriter/app.py \
util/xlsxwriter/chart_area.py \
util/xlsxwriter/chart_bar.py \
util/xlsxwriter/chart_column.py \
util/xlsxwriter/chart_doughnut.py \
util/xlsxwriter/chart_line.py \
util/xlsxwriter/chart_pie.py \
util/xlsxwriter/chart.py \
util/xlsxwriter/chart_radar.py \
util/xlsxwriter/chart_scatter.py \
util/xlsxwriter/chartsheet.py \
util/xlsxwriter/chart_stock.py \
util/xlsxwriter/comments.py \
util/xlsxwriter/compat_collections.py \
util/xlsxwriter/compatibility.py \
util/xlsxwriter/contenttypes.py \
util/xlsxwriter/core.py \
util/xlsxwriter/drawing.py \
util/xlsxwriter/format.py \
util/xlsxwriter/__init__.py \
util/xlsxwriter/packager.py \
util/xlsxwriter/relationships.py \
util/xlsxwriter/sharedstrings.py \
util/xlsxwriter/styles.py \
util/xlsxwriter/table.py \
util/xlsxwriter/theme.py \
util/xlsxwriter/utility.py \
util/xlsxwriter/vml.py \
util/xlsxwriter/workbook.py \
util/xlsxwriter/worksheet.py \
util/xlsxwriter/xmlwriter.py
UI_FILES = ui/ui_vogisprofiltoolmain.py ui/ui_vogisprofiltoolplot.py
RESOURCE_FILES = resources_rc.py

Expand Down Expand Up @@ -72,13 +135,15 @@ deploy: compile doc transcompile
mkdir -p $(HOME)/$(QGISPIDIR)/python/plugins/$(PLUGINNAME)/util
mkdir -p $(HOME)/$(QGISPIDIR)/python/plugins/$(PLUGINNAME)/ui
mkdir -p $(HOME)/$(QGISPIDIR)/python/plugins/$(PLUGINNAME)/icons
mkdir -p $(HOME)/$(QGISPIDIR)/python/plugins/$(PLUGINNAME)/util/xlsxwriter

cp -vf metadata.txt $(HOME)/$(QGISPIDIR)/python/plugins/$(PLUGINNAME)
cp -vf $(PY_FILES) $(HOME)/$(QGISPIDIR)/python/plugins/$(PLUGINNAME)
cp -vf $(BO_FILES) $(HOME)/$(QGISPIDIR)/python/plugins/$(PLUGINNAME)/bo
cp -vf $(UTIL_FILES) $(HOME)/$(QGISPIDIR)/python/plugins/$(PLUGINNAME)/util
cp -vf $(UI_FILES) $(HOME)/$(QGISPIDIR)/python/plugins/$(PLUGINNAME)/ui
cp -vf __init__.py $(HOME)/$(QGISPIDIR)/python/plugins/$(PLUGINNAME)/ui
cp -vf $(XLSX_FILES) $(HOME)/$(QGISPIDIR)/python/plugins/$(PLUGINNAME)/util/xlsxwriter
cp -vf $(RESOURCE_FILES) $(HOME)/$(QGISPIDIR)/python/plugins/$(PLUGINNAME)
cp -vf $(EXTRAS) $(HOME)/$(QGISPIDIR)/python/plugins/$(PLUGINNAME)/icons
cp -vfr i18n $(HOME)/$(QGISPIDIR)/python/plugins/$(PLUGINNAME)
Expand All @@ -96,12 +161,12 @@ derase:

# The zip target deploys the plugin and creates a zip file with the deployed
# content. You can then upload the zip file on http://plugins.qgis.org
zip: deploy dclean
zip: deploy dclean
rm -f $(PLUGINNAME).zip
cd $(HOME)/$(QGISPIDIR)/python/plugins; zip -9r $(CURDIR)/$(PLUGINNAME).zip $(PLUGINNAME)
cd $(HOME)/$(QGISPIDIR)/python/plugins; zip -9r $(CURDIR)/../$(PLUGINNAME).zip $(PLUGINNAME)

# Create a zip package of the plugin named $(PLUGINNAME).zip.
# This requires use of git (your plugin development directory must be a
# Create a zip package of the plugin named $(PLUGINNAME).zip.
# This requires use of git (your plugin development directory must be a
# git repository).
# To use, pass a valid commit or tag as follows:
# make package VERSION=Version_0.3.2
Expand Down Expand Up @@ -131,5 +196,5 @@ clean:
rm $(UI_FILES) $(RESOURCE_FILES)

# build documentation with sphinx
doc:
doc:
cd help; make html
Binary file removed VoGisProfilTool/VoGisProfilTool.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion VoGisProfilTool/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def description():


def version():
return "1.8.7"
return "2.5.3"


def icon():
Expand Down
15 changes: 15 additions & 0 deletions VoGisProfilTool/bo/chartpoint.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class ChartPoint:

def __init__(self, xpixel=0, ypixel=0, xdata=0, ydata=0):
self.xpixel = xpixel
self.ypixel = ypixel
self.xdata = xdata
self.ydata = ydata


def toString(self):
return 'pixel:{0}/{1} data:{2}/{3}'.format(
self.xpixel,
self.ypixel,
self.xdata,
self.ydata)
25 changes: 25 additions & 0 deletions VoGisProfilTool/bo/intersection.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
class Intersection:

def __init__(self, from_x, from_y, from_z, from_dist, to_x, to_y, to_z, to_dist):

self.from_x = from_x
self.from_y = from_y
self.from_z = from_z
self.from_dist = from_dist
self.to_x = to_x
self.to_y = to_y
self.to_z = to_z
self.to_dist = to_dist


def toStr(self):
return u'{0}/{1} z:{2} dist:{3} -> {4}/{5} z:{6} dist:{7}'.format(
self.from_x,
self.from_y,
self.from_z,
self.from_dist,
self.to_x,
self.to_y,
self.to_z,
self.to_dist
)
1 change: 1 addition & 0 deletions VoGisProfilTool/bo/mapdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ class MapData:
def __init__(self):
self.rasters = None
self.lines = None
self.polygons = None
self.selectedLineLyr = None
self.customLine = None
9 changes: 9 additions & 0 deletions VoGisProfilTool/bo/polygon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class Polygon:
def __init__(self, id, name, polygon):
self.id = id
self.name = name
self.polygon = polygon
self.selected = False

def toStr(self):
return self.id + ": " + self.name
33 changes: 33 additions & 0 deletions VoGisProfilTool/bo/polygonCollection.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
class PolygonCollection(object):
"""docstring for LineCollection"""

def __init__(self):
self.__polygons = []


def addPolygon(self, polygon):
self.__polygons.append(polygon)


def getById(self, id):
if len(self.__polygons) < 1:
return None
for l in self.__polygons:
if l.id == id:
return l


def count(self):
return len(self.__polygons)


def polygons(self):
return self.__polygons


def selected_polygons(self):
sel_polys = []
for poly in self.__polygons:
if poly.selected is True:
sel_polys.append(poly)
return sel_polys
49 changes: 49 additions & 0 deletions VoGisProfilTool/bo/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,55 @@ def toString(self, hekto, attribs, delimiter, decimalDelimiter):

return txt

def toArray(self, hekto, attribs, decimalDelimiter):
""" Fuer die Weiterverarbeitung im Excel-Writer """
feld = []
oldSeg = None
for idxS in range(len(self.segments)):
s = self.segments[idxS]
if oldSeg is not None:
feld.append(oldSeg.toArray(hekto, attribs, decimalDelimiter))

feld.append(s.toArray(hekto, attribs, decimalDelimiter))
oldSeg = s

return feld

def writeArrayHeader(self, selectedRasters, hekto, attribs):
""" Kopfzeile fuer Excel """
#Profillaenge;Segmentlaenge;Rechtswert;Hochwert;
#"Laser - Hoehenmodell Oberflaeche 1m";"Laser Hoehenmodell Gelaende1m";
#Profilnummer;Segmentnummer;Punktnummer;Punktklasse;
#Hektometer
#ATTRIBUTE
hdr_prof_len = QApplication.translate('code', 'Profillaenge', None, QApplication.UnicodeUTF8)
hdr_seg_len = QApplication.translate('code', 'Segmentlaenge', None, QApplication.UnicodeUTF8)
hdr_xval = QApplication.translate('code', 'Rechtswert', None, QApplication.UnicodeUTF8)
hdr_yval = QApplication.translate('code', 'Hochwert', None, QApplication.UnicodeUTF8)
hdr_prof_nr = QApplication.translate('code', 'Profilnummer', None, QApplication.UnicodeUTF8)
hdr_seg_nr = QApplication.translate('code', 'Segmentnummer', None, QApplication.UnicodeUTF8)
hdr_pnt_nr = QApplication.translate('code', 'Punktnummer', None, QApplication.UnicodeUTF8)
hdr_pnt_class = QApplication.translate('code', 'Punktklasse', None, QApplication.UnicodeUTF8)

hdr = []
hdr.append(hdr_prof_len)
hdr.append(hdr_seg_len)
hdr.append(hdr_xval)
hdr.append(hdr_yval)
for r in selectedRasters:
hdr.append(r.name)
hdr.append(hdr_prof_nr)
hdr.append(hdr_seg_nr)
hdr.append(hdr_pnt_nr)
hdr.append(hdr_pnt_class)
if hekto is True:
hdr.append('Hektometer')
if attribs is True:
for fldName in self.segments[0].vertices[0].attribNames:
hdr.append(fldName)
return hdr


def toACadTxt(self, delimiter, decimalDelimiter):
acadTxt = ''
for s in self.segments:
Expand Down
Loading

0 comments on commit 432e43e

Please sign in to comment.