Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
name=OFDS Studio
description=QGIS plugin for OFDS (Open Fibre Data Standard)
about=A QGIS plugin for creating, editing and interacting with OFDS (Open Fibre Data Standard) data. OFDS is a data standard for describing terrestrial fibre optic networks, see https://ofds.info/en/ for more.
version=1.1.2
version=1.1.3
changelog=
1.1.3 - If the CRS is not supported, then set a supported one
1.1.2 - Remove flagged (but safe) file to pass automated security testing
1.1.1 - Mark test functions as safe in automated security testing
1.1 - Update for OFDS 0.4, first release on the plugin repository
Expand Down
14 changes: 9 additions & 5 deletions ofdsqgisplugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import shutil

from qgis.core import QgsProject
from qgis.core import QgsCoordinateReferenceSystem, QgsProject
from qgis.PyQt.QtGui import QIcon
from qgis.PyQt.QtWidgets import QAction, QFileDialog

Expand Down Expand Up @@ -123,10 +123,10 @@ def add_layers(self):
# The data standard says it should be OGC:CRS84
# https://standard.ofds.info/en/0.1-dev/reference/schema.html?highlight=wgs84#coordinatereferencesystem
if QgsProject.instance().crs().authid() not in ["OGC:CRS84", "EPSG:4326"]:
self.iface.messageBar().pushMessage(
"Can only use OFDS with projects in the OGC:CRS84 or EPSG:4326 coordinate reference system (CRS). Please change your coordinate reference system."
)
return
QgsProject.instance().setCrs(QgsCoordinateReferenceSystem("EPSG:4326"))
crs_switch = True
else:
crs_switch = False
# check already has layers
layers = find_layers()
if layers:
Expand All @@ -149,6 +149,10 @@ def add_layers(self):
)
# add layers
add_layers(filename, self, custom_ui=CUSTOM_UI_FEATURE_FLAG)
message = "OFDS layers addded."
if crs_switch:
message += " Automatically switching project CRS to EPSG:4326."
self.iface.messageBar().pushMessage(message)

def export_json(self):
# get data and check it
Expand Down
Loading