Linear reference system plugin for QGIS.
blazek / lrs Goto Github PK
View Code? Open in Web Editor NEWLRS (linear reference system) plugin for QGIS
License: GNU General Public License v2.0
LRS (linear reference system) plugin for QGIS
License: GNU General Public License v2.0
Linear reference system plugin for QGIS.
v1.02 QGIS 3.2
EACH time I use the plugin, QGis crashes after a while, generally during the M value typing :
Crash ID: 5ea53509406f55839b3d760e88388eb6fee0a3b8
Stack Trace
QMetaObject::cast :
QgsHighlight::paint qgshighlight.cpp:400
sipQgsHighlight::paint sip_guipart8.cpp:92134
QGraphicsScene::dragMoveEvent :
QGraphicsScene::drawItems :
QGraphicsScene::drawItems :
QGraphicsView::paintEvent :
QWidget::event :
QFrame::event :
QGraphicsView::viewportEvent :
QCoreApplicationPrivate::sendThroughObjectEventFilters :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify qgsapplication.cpp:471
QCoreApplication::notifyInternal2 :
QWidgetPrivate::drawWidget :
QWidgetPrivate::paintSiblingsRecursive :
QWidgetPrivate::drawWidget :
QWidgetPrivate::paintSiblingsRecursive :
QWidgetPrivate::drawWidget :
QWidgetPrivate::paintSiblingsRecursive :
QWidgetPrivate::drawWidget :
QWidgetPrivate::paintSiblingsRecursive :
QWidgetPrivate::paintSiblingsRecursive :
QWidgetPrivate::drawWidget :
QApplication::windowIcon :
QWidget::event :
QgisApp::event qgisapp.cpp:2201
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify qgsapplication.cpp:471
QCoreApplication::notifyInternal2 :
QCoreApplicationPrivate::sendPostedEvents :
QGraphicsScene::~QGraphicsScene :
QObject::event :
QGraphicsScene::event :
QApplicationPrivate::notify_helper :
QApplication::notify :
QgsApplication::notify qgsapplication.cpp:471
QCoreApplication::notifyInternal2 :
QCoreApplicationPrivate::sendPostedEvents :
qt_plugin_query_metadata :
QEventDispatcherWin32::processEvents :
UserCallWinProcCheckWow :
DispatchMessageWorker :
QEventDispatcherWin32::processEvents :
qt_plugin_query_metadata :
QEventLoop::exec :
QCoreApplication::exec :
main main.cpp:1637
BaseThreadInitThunk :
RtlUserThreadStart :
QGIS Info
QGIS Version: 3.18.0-Z�rich
QGIS code revision: bdef9fb328
Compiled against Qt: 5.11.2
Running against Qt: 5.11.2
Compiled against GDAL: 3.1.4
Running against GDAL: 3.1.4
System Info
CPU Type: x86_64
Kernel Type: winnt
Kernel Version: 10.0.19042
When using the "Event" function to reference tabular data to a route, it doesn't work when the start measure has the value "0". In the error field of the event layer is stated "segment not available", although the segment is definitely available.
This was working in 0.37.
Now in 1.02 in QGIS 3.2 I edit the source layer and the LRS and event layer do not update, even when edits are saved.
This is one of the main reasons I need LRS - I'm editing a race route and need to see km markers updating live as I edit.
If the project is in a different CRS to the LRS layer, calibrating fails
v1.02 in QGIS 3.2
Hi,
The measure tool of LRS plugin doesn't work with PostGIS point layer. This is my table definition:
CREATE TABLE errepideak_lrs.lon_lat
(
gid serial NOT NULL,
geom geometry(Point,25830),
lon numeric,
lat numeric,
CONSTRAINT lon_lat_pkey_2 PRIMARY KEY (gid)
)
WITH (
OIDS=FALSE
);
ALTER TABLE errepideak_lrs.lon_lat
OWNER TO postgres;
-- Index: errepideak_lrs.sidx_lon_lat_geom
-- DROP INDEX errepideak_lrs.sidx_lon_lat_geom;
CREATE INDEX sidx_lon_lat_geom
ON errepideak_lrs.lon_lat
USING gist
(geom);
-- Trigger: errepide_intz on errepideak_lrs.lon_lat
-- DROP TRIGGER errepide_intz ON errepideak_lrs.lon_lat;
CREATE TRIGGER errepide_intz
BEFORE INSERT OR UPDATE
ON errepideak_lrs.lon_lat
FOR EACH ROW
EXECUTE PROCEDURE errepide_intz();
The error is:
Traceback (most recent call last):
File "C:/Users/mikel/.qgis2/python/plugins\lrs\lrsdockwidget.py", line 984, in calculateMeasures
outputFeature[field.name()] = feature[field.name()]
KeyError: 'gid'
Thank you!
LRS Plugin 1.0.0. / QGIS 3 after qgis/QGIS#5359 - QGIS API has changed.
Waiting for stable API / release.
Hi Radim,
When install LRS on Qgis 3.2.0-Bonn bc43194 but also with the previous revision I have this issue:
TypeError: unable to convert a QVariant of type 10 to a QMetaType of type 2
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/qgis/utils.py", line 346, in startPlugin
plugins[packageName].initGui()
File "/home/geo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/lrs/lrsplugin.py", line 65, in initGui
self.dockWidget = LrsDockWidget(self.iface.mainWindow(), self.iface)
File "/home/geo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/lrs/ui/lrsdockwidget.py", line 278, in init
self.resetExportOptions()
File "/home/geo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/lrs/ui/lrsdockwidget.py", line 1064, in resetExportOptions
for connection in ExportPostgis.getPostgisConnections():
File "/home/geo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/lrs/lrs/postgis.py", line 136, in getPostgisConnections
connection = ExportPostgis.getPostgisConnection(connectionName)
File "/home/geo/.local/share/QGIS/QGIS3/profiles/default/python/plugins/lrs/lrs/postgis.py", line 117, in getPostgisConnection
sslmode = settings.value("sslmode", QgsDataSourceUri.SslPrefer, type=int)
TypeError: unable to convert a QVariant of type 10 to a QMetaType of type 2
Thanks
Clicking 'OK' on the Calibration tab throws an uncaught TypeError if the project projection does not match the projection of the line and points layers. It would be fantastic if the plugin could detect this situation and let the user know all projections need to match, rather than throwing a rather cryptic exception. Stack trace is below. I would be interested in helping with this if needed.
2018-10-16T10:17:44 WARNING Traceback (most recent call last):
File "C:/Users/mike.bannister/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\lrs\ui\lrsdockwidget.py", line 606, in generateLrs
extrapolate=extrapolate, measureUnit=measureUnit)
File "C:/Users/mike.bannister/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\lrs\lrs\lrscalib.py", line 132, in init
self.lineTransform = QgsCoordinateTransform(lineLayer.crs(), self.crs)
TypeError: QgsCoordinateTransform(): arguments did not match any overloaded call:
overload 1: too many arguments
overload 2: not enough arguments
overload 3: not enough arguments
overload 4: not enough arguments
overload 5: argument 1 has unexpected type 'QgsCoordinateReferenceSystem'
Edited for grammar.
On Xubuntu 16.04, QGIS 2.16 after Calibration, when progress bar reaches 93% QGIS crashes with segfault.
dmesg output:
[ 1170.809232] qgis.bin[3915]: segfault at 31 ip 00007f3573c4dbab sp 00007fffd40a6f00 error 4 in libqgis_core.so.2.16.0[7f3573404000+9dd000]
[ 1377.082829] qgis.bin[5060]: segfault at 8 ip 00007ff6027e5265 sp 00007ffc4f30ef90 error 4 in libQtCore.so.4.8.7[7ff602719000+2e7000]
On Windows 10, QGIS 2.15, 2.16 with same dataset every thing is OK.
When generating features via the "Events" tab (using LRS 1.0.2 on QGIS 3.2.1), fields of type Integer64 in the events layer are quietly converted to regular integer fields in the output layer. This particularly affects the feature-ID field of GeoPackage layers, which is defined as type Integer64 by default.
This can create problems down the line, as when attempting to merge the generated layer with other layers containing similar data. In this case the operation will fail with an error message like
ObjectID field in layer [generated layer] has different data type than in other layers (integer instead of Integer64)
The issue appears to lie with the fixFields
method in utils.py, which attempts to map events-layer field types onto the subset supported by the memory data provider. It clearly maps the "LongLong" (i.e. 64-bit integers) type to plain integer, yet the memory provider does in fact support 64-bit integers (as type "int8").
I have a use case where I need to be able to click anywhere along a route and see the distance from the start. i.e. it would be really useful to add an interactive element to the Measures tab.
When an existing routing table is exported to postgres, it will be dropped. In case of depending views dropping of the route table is not possible. Truncation instead of dropping the table would be much better.
Hi,
there are four Python-Bugs of the same type when using the Plugin under QGis 3.28.1-Firenze.
TypeError: setValue(self, int): argument 1 has unexpected type 'float'
Its allways the case where
progressBar.setValue(percent)
is called, workaround would be, to use
progressBar.setValue(int(percent))
instead.
Files:
LRS version 1.0.0 from official QGIS repository
We have successfully used this wonderful plugin in the recent past. However, something has changed (see notes below) with QGIS/OSGEO4W and now we are no longer able to make the process work. We have a sample dataset (see link below) that worked in the past and now errors out on the calculate measures function. the process halts and errors at 24%.
sample data set here
http://projects.region3dfg.org/temporary/lrs/
on installing the plugin i get..
2016-08-23T17:02:05 1 warning:C:/Users/jack/.qgis2/python/plugins\lrs\lrsplugin.py:44: DeprecationWarning: QgsMapCanvas.mapRenderer() is deprecated
self.mapRenderer = iface.mapCanvas().mapRenderer()
File "C:/Users/jack/.qgis2/python/plugins\lrs__init__.py", line 53, in classFactory
return LrsPlugin(iface)
on loading the plugin i also get
traceback: File "", line 1, in
File "C:/OSGeo4W/apps/qgis/./python\qgis\utils.py", line 333, in startPlugin
plugins[packageName] = package.classFactory(iface)
On running the Calibrate and the calculate measures functions i get the following and the process locks up as described above.
Python Errors:
2016-08-23T14:05:28 1 Traceback (most recent call last):
File "C:/Users/*/.qgis2/python/plugins\lrs\lrsdockwidget.py", line 973, in calculateMeasures
outputFeature[field.name()] = feature[field.name()]
KeyError: 'ageofdgpsd'
Python Warning:
2016-08-23T17:05:39 1 warning:C:/Users/jack/.qgis2/python/plugins\lrs\lrsplugin.py:44: DeprecationWarning: QgsMapCanvas.mapRenderer() is deprecated
self.mapRenderer = iface.mapCanvas().mapRenderer()
traceback: File "", line 1, in
File "C:/OSGeo4W/apps/qgis/./python\qgis\utils.py", line 333, in startPlugin
plugins[packageName] = package.classFactory(iface)
File "C:/Users/jack/.qgis2/python/plugins\lrs__init__.py", line 53, in classFactory
return LrsPlugin(iface)
2016-08-23T17:07:49 1 warning:C:/Users/jack/.qgis2/python/plugins\lrs\lrs.py:301: DeprecationWarning: QgsDistanceArea.measure() is deprecated
length = self.distanceArea.measure( feature.geometry() )
traceback: File "C:/Users/jack/.qgis2/python/plugins\lrs\lrsdockwidget.py", line 487, in generateLrs
self.lrs.calibrate()
File "C:/Users/jack/.qgis2/python/plugins\lrs\lrs.py", line 238, in calibrate
self.registerLines()
operational environment
LRS Plugin Installed version: 0.3.6 (in C:\Users*.qgis2\python\plugins\lrs)
tested on...
useing OSGEO4W package installer
QGIS version 2.16.1-Nødebo
QGIS code revision 8545b3b
Compiled against Qt 4.8.6
Running against Qt 4.8.6
Compiled against GDAL/OGR 2.1.0
Running against GDAL/OGR 2.1.1
Compiled against GEOS 3.5.0-CAPI-1.9.0
Running against GEOS 3.5.0-CAPI-1.9.0 r4084
PostgreSQL Client Version 8.3.10
SpatiaLite Version 4.3.0
QWT Version 6.0.2
PROJ.4 Version 492
QScintilla2 Version 2.8.4
Windows 7 Enterprise 64 bit Service Pack 1
and
Windows 10 32bit
Previous success:
QGIS 2.10 with LRS 0.3.6 worked Prior to August 12, 2016.
Starting August 12, 2016 QGIS would crash after successfully completing LRS Events.
When saving the created Events layer QGIS would not save all records. Problems with exporting fields with lengths in excess of 254 characters. This field (LRS Errors)was all null.
QGIS would also crash when trying to render a new View after successfully running the LRS Events routine.
8/15/2016 upgraded to QGIS 2.16 and LRS worked again. Previous errors went away.
8/17/2016 ran setup utility again and now LRS errors out in Measure routine described above. Confirmed on two different computers with same setup.
This can be fixed by changing two lines in lrsselectiondialog.py.
field = layer.pendingFields().field(fieldName)
should be :
field = layer.fields().field(fieldName)
values = sorted(values, key=lambda s: s.lower() if type(s) is not QPyNullVariant else '')
should be :
values = sorted(values, key=lambda s: s.lower() if type(s) is not None else '')
or :
values = sorted(values, key=lambda s: s.lower() if type(s) != NULL else '')
with :
import qgis.core
Not tested, see :
https://gis.stackexchange.com/questions/216018/importing-null-in-pyqgis
When trying to assign a route to a point in the Measures tab, the plugin actually takes the very first route that is close enough. It doesn't evaluate wether there is another route closer to the point in question.
This leads to strange behaviour when dealing with several routes close to each other. I'm using LRS in railway context, where distances between parallel tracks are low, same for turnout angles at switches.
Criterion is the order of route features in the layer, not the ascending route ID, as can be seen in the screenshot below (Route No. 0 is not the fist but the last feature in the layer, thus getting only a single point assigned that was leftover between 1 and 2).
A serious evaluation which route is the nearest would be a more heavy feature, but some relief could already be achieved when there would be the possibility to shrink the Max point distance to a couple of metres.
Trying to find out if this plugin is useful for me, I already get stopped at the start: There is nothing to select in the locate tab. The help does not help with that.
Using QGIS 3.20 on Linux Mint
Hi, there are four Python-Bugs of the same type when using the Plugin under QGis 3.28.1-Firenze.
TypeError: setValue(self, int): argument 1 has unexpected type 'float'
Its allways the case where
progressBar.setValue(percent)
is called, workaround would be, to use
progressBar.setValue(int(percent))
instead.
Calibration does not work for routes with id = 0. Route error in errors tab is "Not enough points".
Most probably there is some if route.id:
instead of if route.id is not None:
When creating events (via the "Events" tab of the plugin) from certain datasets, processing will fail with an error message like the following:
2018-07-28T20:13:28 WARNING Traceback (most recent call last):
File "C:/.../QGIS/QGIS3\profiles\default/python/plugins\lrs\ui\lrsdockwidget.py", line 996, in createEvents
events.create(layer, featuresSelect, routeFieldName, startFieldName, endFieldName, errorFieldName, outputName)
File "C:/.../QGIS/QGIS3\profiles\default/python/plugins\lrs\lrs\lrsevents.py", line 105, in create
geo = QgsGeometry.fromMultiPolylineXY(line)
TypeError: index 0 has type 'NoneType' but 'QgsPointXY' is expected
This occurs when the dataset specifies a linear event of a directionality opposite to that of the route it references; that is, a linear event that has a "start" measure greater than its "end" measure. It seems this violates an assumption made by the plugin.
Directionality does matter in certain applications. For instance, when modeling the movement of a vehicle through a road network, it normally is important to know not just what portion of a road segment the vehicle traversed but in which direction it moved. Consequently, it would be useful for the plugin to support the creation of events of either directionality.
Hi
Could You show me how the Points layer file for LRS calibration should look like?
I have shp with lines and line number, start km and end km as atributes.
This is an enhancement proposal.
For points that already had the route id assigned to a field, it would be a good option to assign the measurement to the route defined on that field.
Using LRS 1.0.2 with QGIS 3.2.1, after selecting a layer with measures and a route field, trying to select a route from the "Route" dropdown on the "Locate" tab fails with an error message like the following:
2018-07-28T06:09:48 WARNING Traceback (most recent call last):
File "C:/.../QGIS/QGIS3\profiles\default/python/plugins\lrs\ui\lrsdockwidget.py", line 858, in locateRouteChanged
self.resetLocateEvent()
File "C:/.../QGIS/QGIS3\profiles\default/python/plugins\lrs\ui\lrsdockwidget.py", line 875, in resetLocateEvent
transform = QgsCoordinateTransform(self.lrsLayer.crs, mapSettings.destinationCrs())
TypeError: QgsCoordinateTransform(): arguments did not match any overloaded call:
overload 1: too many arguments
overload 2: not enough arguments
overload 3: not enough arguments
overload 4: not enough arguments
overload 5: argument 1 has unexpected type 'QgsCoordinateReferenceSystem'
This appears to be related to API changes in QGIS 3.
Hello,
Everything works well with plugin exept export.
I got this message (sorry but in french...):
ERREUR: la fonction geometryfromtext(unknown, integer) n'existe pas
LINE 1: ... m_to, geom) values ( 'canalfrancais', 0.0, 69.2, GeometryFr...
^
HINT: Aucune fonction ne correspond au nom donné et aux types d'arguments.
Vous devez ajouter des conversions explicites de type.
If needed I can give data.
Thanks
sylvain
QGIS: 2.99.0-Master Master, 6c64c5a
LRS v 1.0.1
AttributeError: 'QgsVectorLayer' object has no attribute 'pendingFields'
Traceback (most recent call last):
File "/home/mechanik/.local/share/QGIS/QGIS3/profiles/default/python/plugins/lrs/ui/lrsfieldcombomanager.py", line 73, in layerChanged
self.resetFields()
File "/home/mechanik/.local/share/QGIS/QGIS3/profiles/default/python/plugins/lrs/ui/lrsfieldcombomanager.py", line 99, in resetFields
for idx, field in enumerate(layer.pendingFields()):
AttributeError: 'QgsVectorLayer' object has no attribute 'pendingFields'
Using LRS 1.0.2 with QGIS 3.2.1, trying to calculate measures (using the "Measures" tab of the plugin) fails with an error message like the following:
2018-07-30T14:52:26 WARNING Traceback (most recent call last):
File "C:/.../QGIS/QGIS3\profiles\default/python/plugins\lrs\ui\lrsdockwidget.py", line 1058, in calculateMeasures
measures.calculate(layer, routeFieldName, measureFieldName, threshold, outputName)
File "C:/.../QGIS/QGIS3\profiles\default/python/plugins\lrs\lrs\lrsmeasures.py", line 70, in calculate
transform = QgsCoordinateTransform(layer.crs(), self.lrs.crs)
TypeError: QgsCoordinateTransform(): arguments did not match any overloaded call:
overload 1: too many arguments
overload 2: not enough arguments
overload 3: not enough arguments
overload 4: not enough arguments
overload 5: argument 1 has unexpected type 'QgsCoordinateReferenceSystem'
This is similar to issue #28 and also relates to changes to the QGIS API in version 3.
Currently your plugin requires the user to calibrate a route system before it can be used. This means it can't be used to segment an existing route table. There is a plugin that is supposed to support such segmentation, but in my experience it doesn't work very well (well, I can't get it to work). It would be great if this capability could be added to your plugin.
Hi. I ran into this error when trying to use the LRS plugin. I am stumped on what the issue could be. Maybe something with my data structure.
An error has occurred while executing Python code:
TypeError: object of type 'NoneType' has no len()
Traceback (most recent call last):
File "/Users/-/.qgis2/python/plugins/lrs/lrsdockwidget.py", line 487, in generateLrs
self.lrs.calibrate()
File "/Users/-/.qgis2/python/plugins/lrs/lrs.py", line 241, in calibrate
route.calibrate(self.extrapolate)
File "/Users/-/.qgis2/python/plugins/lrs/route.py", line 98, in calibrate
self.buildParts()
File "/Users/-/.qgis2/python/plugins/lrs/route.py", line 226, in buildParts
for i in range(len(polys)):
TypeError: object of type 'NoneType' has no len()
Python version: 2.7.10 (default, Jul 15 2017, 17:16:57) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]
QGIS version: 2.18.7 Las Palmas, exported
Attempting to navigate the plugin's UI by keyboard is difficult as the tab order between widgets is unpredictable.
For example, when using the Tab key to navigate between widgets on the "Measures" tab, focus seems to move in the exact opposite order of what would be expected.
In some cases the features generated for events (via the plugin's "Events" tab) will display incorrectly, appearing to float off in a distant corner of the map rather than superimposed over their source features.
The issue is that the layer created to hold the generated features is assigned (in LrsEvents.create()
) the CRS configured as the default for the project, but the features it contains naturally use coordinates derived from the layer with measures. When the layer with measures uses a CRS different from the project's default, the generated features will appear in the wrong location on the map (until the new layer is reconfigured to use the correct CRS).
The best solution is probably to have the new layer inherit the CRS of the source (measure) layer rather than that of the project, since I think this is what would normally be expected. If the user wants the newly created layer to use a different CRS instead, it can easily be reprojected as a separate step.
Hi,
I wanted to experiment with this LRS plugin.
I'm running Qgis 2.18.16, and I installed LRS plugin 0.3.7.
when I run the plugin, everything is grayed out, except the fields in the "calibration" tab.
I can click in the "events" tab, but I can't select an event layer, route field or whatever.
I have no idea what's wrong :(
Hi,
I use LRS frequently and it does a better job than many proprietary asset management software packages.
At City of Mandurah we have four roads that are closed loops, i.e. the start and end are exactly the same point locations. This causes one of the points to be removed, which then generates the 'Not enough points' error. Could you consider making LRS keep duplicate points? I can send examples in Shapefile if required.
Thanks,
If the field on which is based the calibration ("line route field") is a string I get the following error message:
"Errore durante l'esecuzione di codice Python:
Traceback (most recent call last):
File "C:\Users\Antonio/.qgis2/python/plugins\lrs\lrsdockwidget.py", line 431, in openGenerateSelectionDialog
self.genSelectionDialog.load( layer, fieldName, select )
File "C:\Users\Antonio/.qgis2/python/plugins\lrs\selectiondialog.py", line 66, in load
values = sorted( values, key=str.lower )
TypeError: descriptor 'lower' requires a 'str' object but received a 'unicode'
Versione Python:
2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]
Versione di QGIS:
2.0.1-Dufour Dufour, d94c044
Percorso Python: ['C:\Users\Antonio/.qgis2/python/plugins\processing', 'C:/PROGRA1/QGISDU1/apps/qgis/./python', 'C:\Users\Antonio/.qgis2/python', 'C:\Users\Antonio/.qgis2/python/plugins', 'C:/PROGRA1/QGISDU1/apps/qgis/./python/plugins', 'C:\PROGRA1\QGISDU1\bin\python27.zip', 'C:\PROGRA1\QGISDU1\apps\Python27\DLLs', 'C:\PROGRA1\QGISDU1\apps\Python27\lib', 'C:\PROGRA1\QGISDU1\apps\Python27\lib\plat-win', 'C:\PROGRA1\QGISDU1\apps\Python27\lib\lib-tk', 'C:\PROGRA1\QGISDU1\bin', 'C:\PROGRA1\QGISDU1\apps\Python27', 'C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages', 'C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\PIL', 'C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\win32', 'C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\win32\lib', 'C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\Pythonwin', 'C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win-amd64.egg', 'C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\six-1.3.0-py2.7.egg', 'C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\wx-2.8-msw-unicode', 'C:\Users\Antonio.qgis2\python\plugins\mmqgis/forms', 'C:\PROGRA1\QGISDU1\apps\qgis\python\plugins\fTools\tools', 'E:/Scambio_VM/Strade/Catasto_Strade/LRS/PROVE_OK']"
This doesn't happen if the chosen field is numeric (integer or real).
I loaded a shape with the routes with linestring geometry, and a point shape, to make the segmentation, but when i did it lunch some errors. (in line 481 and others).
I need to know if you could help me.
Excuse me, thank you very much.
This images show part of the set of data afe_tablilla are points and afe_via_prin are linestrings. LineRouteFields are nom_linea and Measure field are km.
This is the error:
Ha ocurrido un error mientras se ejecutaba el código de Python:
Traceback (most recent call last):
File "/home/**/.qgis2/python/plugins/lrs/lrsdockwidget.py", line 481, in generateLrs
self.lrs.calibrate()
File "/home//.qgis2/python/plugins/lrs/lrs.py", line 241, in calibrate
route.calibrate(self.extrapolate)
File "/home//.qgis2/python/plugins/lrs/route.py", line 98, in calibrate
self.buildParts()
File "/home//.qgis2/python/plugins/lrs/route.py", line 351, in buildParts
self.parts.append( LrsRoutePart( polyline, self.routeId, origins, self.crs, self.measureUnit, self.distanceArea) )
File "/home//.qgis2/python/plugins/lrs/part.py", line 103, in init
self.setPolyline(polyline)
File "/home/*/.qgis2/python/plugins/lrs/part.py", line 117, in setPolyline
self.length = self.polylineGeo.length()
AttributeError: 'NoneType' object has no attribute 'length'
Versión de Python:
2.7.3 (default, Jan 2 2013, 14:09:21)
[GCC 4.7.2]
Versión de QGIS:
2.0.1-Dufour Dufour, exported
I think it'd be pretty incredible if LRS' products were added to the QGIS layers list in a nested group fashion.
For instance, all products fall under the top-level LRS grouping.
Under that would be Calibration, Measures, and Events.
Under Calibration:
Error Layers
Quality Layers
Under Measures:
LRS measure
Under Events:
LRS events
If these products are refreshed/re-created, they're kept in the groupings as above to keep the project neat.
Obviously I know one can do this manually, but I think this would be a nice improvement to ease of use.
With certain datasets it is impossible to generate events from measures calculated via the "Measures" tab of the plugin: Although both operations appear to succeed, the resulting events layer contains no visible features, and each of its rows contains "route not available" in its error field.
The issue is the plugin's insistence on converting the source (LRS) layer's route field value to a string (at lrsmeasures.py:95) when writing it to the newly created measures layer. If the source layer's route field is of a non-string type, this can change the format of the value so it cannot be matched again later.
For example, in the dataset I'm working with, the route-identifier field is of type double. A route ID of "10000" in the source layer will be output as the string "10000.0" in the generated measures layer. When trying to generate events from this new layer, the route ID will no longer be matched in the source.
The straightforward solution appears to be preserving the type of the route field between the input and the output. Note this is already done by the event-generation process.
I have a project where I am using EPSG:2264 for the project and the resultant layers, but generation of the LRS is done with EPSG:3857, placing my data in the Central African Republic. Setting the CRS of the generated LRS layer to EPSG:2264 will place it exactly where it belongs, indicating that the output CRS is just being assigned incorrectly.
Edit:
Checking the Errors layer will zoom to errors in the wrong location, ie. using the EPSG;3857 locations, not the correct EPSG:2264 locations after I have re-assigned the proper locations to the LRS layer. However, the highlighted box for points and lines are drawing in the correct EPSG:2264 locations.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.