Skip to content

Commit

Permalink
minor fix / update version
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariosmsk committed Oct 22, 2022
1 parent 269cd19 commit 28be056
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
28 changes: 17 additions & 11 deletions Epa2GIS.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,20 +239,26 @@ def epa2gis(inpname, epsg_crs):
ndIndexNew = ndCoordsID.index(ndID[i])
featJ = QgsFeature()
point = QgsPointXY(float(x[ndIndexNew]), float(y[ndIndexNew]))
featJ.initAttributes(3 + len(ndBaseTmp[0]) * 2)
featJ.setGeometry(QgsGeometry.fromPointXY(point))
featJ.setAttribute(0, ndID[i])
featJ.setAttribute(1, ndEle[i])
w = 2
for j in range(0, len(ndBaseTmp[0])):
featJ.setAttribute(w, ndBaseTmp[i][j])
featJ.setAttribute(w + 1, ndPatTmp[i][j])
w = w + 2
featJ.setAttribute(w, ndDes[i])
prJunction.addFeatures([featJ])

except:
# Remove support for multiple basedemands [temporary]
if ndBaseTmp:
featJ.initAttributes(3 + len(ndBaseTmp[0]) * 2)
featJ.setAttribute(0, ndID[i])
featJ.setAttribute(1, ndEle[i])
w = 2
for j in range(0, len(ndBaseTmp[0])):
featJ.setAttribute(w, ndBaseTmp[i][j])
featJ.setAttribute(w + 1, ndPatTmp[i][j])
w = w + 2
featJ.setAttribute(w, ndDes[i])
else:
featJ.setAttributes([ndID[i], ndEle[i], 0, '', ndDes[i]])

prJunction.addFeatures([featJ])
except Exception as e:
pass

if i < nlinkCount:
if len(stat) == i:
ch = 1
Expand Down
6 changes: 4 additions & 2 deletions metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ name=ImportEpanetInpFiles
qgisMinimumVersion=2.99
qgisMaximumVersion=3.99
description=IMPORT/EXPORT EPANET INP Files
version=1.6.3
version=1.6.4
author=Marios S. Kyriakou, KIOS Research and Innovation Center of Excellence (KIOS CoE)
email=mkiria01@ucy.ac.cy
about=This tool can be used to IMPORT EPANET INP File to shapefiles and adds them in the QGIS canvas. Also, the shapefiles stored into the _shapefiles_ folder. Can be used to EXPORT EPANET INP File.
Expand All @@ -21,7 +21,9 @@ about=This tool can be used to IMPORT EPANET INP File to shapefiles and adds the
# Optional items:

# Uncomment the following line and add your changelog:
changelog=2021-10-17 ImportEpanetInpFiles 1.6.3:
changelog=2022-10-22 ImportEpanetInpFiles 1.6.4:
Fix issue with junctions
2021-10-17 ImportEpanetInpFiles 1.6.3:
Fixed issue with description field
2020-11-06 ImportEpanetInpFiles 1.6.2:
Fixed issue with export vertices
Expand Down

0 comments on commit 28be056

Please sign in to comment.