GIScience / orstools-qgis-plugin

Plugin for QGIS with a set of tools to use openrouteservice API´s, based on openstreetmap
https://plugins.qgis.org/plugins/ORStools/
MIT License
92 stars 31 forks source link

Routing output Lat/Long missing #48

Closed wmeinolf closed 5 years ago

wmeinolf commented 6 years ago

First of all thanks for the new version! After upgrade from v.0.3.4 to 2.1 the last 4 output fields (old version) are missing: FROM_LAT;FROM-LONG;TO_LAT and TO_LONG. I realized the 4 Lines of code in previous osm_tools_routing.py are missing in current directions.py.

Is this change intentionally and possibly related to the "new" behaviour in FROM_ID and TO_ID ?

FROM_ID und TO_ID are now obviously set to a location. However, the given locations dont seem to be correct, as they are not related to the "from map" clicked coordinates.

I'm currently still on QGIS 2.x

Is this change intentionally? Thanks.

nilsnolde commented 6 years ago

Right, I was in a frenzy when I refactored and threw out all IMHO unnecessary things. So, sorta intentional. I believe, TO_ID and FROM_ID were there before too. When using the 'Map Tool' function, they were and are pointing to reverse geocoded cities (or names) at the moment. This is OSM, so they won't always be provided unfortunately. In fact, almost never probably..

If you have examples where the ID's are obviously wrong, please provide an example. Looking at the code, it seems unlikely. But then it could be related to backend problems.

wmeinolf commented 6 years ago

Tks for the fast response. Let me give you some mor background. Iuse the tool to draft fiber routes between residential areas, where we may build FTTH. So it was extremely helpful to have the coordinates, whete the route start and ends. Yes, From_ID and TO_ID were there before but always NULL, so i "misused" the field once in QGIS to note the Town in FROM_ID. Now, I appreciate, if TO_ID and FROM_ID were set automatically, instead of editing it manually. Couls the reason be, that my QGIS layer, where I click the map, has the wrong CRS? I use the OSM layer generated form Openlayer s plugin. This layer has CRS EPSG:3857, WGS 84 / Pseudo Mercator (OTF, as the default project CRS is EPSG:25832, ERTD89 / UTM Zone 32N). With regards to the missing coordinates, would it be a big deal, to bring them back? I'm not really familiar to PYTHON, although I started my work life as sw designer decades ago. I tried to modify directiony.py by reinserting the 4 lines of code from osm_tools_routing.py , but the result was always, that the plugin did not load in QGIS anymore. I assume, the number of parms is limited somewhere. Finally I would like to suggest an improvement to the plugin. Where should I open this, here in the issues section, or in the pull requests? Thanks and br

wmeinolf commented 6 years ago

Sorry, I forgot the exsample. On the attached JPG you find 4 routes. I clicked them as follows: (1) and (2) From Vaihingen an der Enz to Mühlacker (3) from Großglattbach to Mühlacker and (4) from Ludwigsburg to Vaihingen an den Enz.

Here the From and To_IDs (1) and (2) Ludwigsburg Enzkreis (3) Enzkreis Enzkreis (4) Stuttgart Ludwigsburg

I usually took for FROM-ID and TO_ID the OSM param addr:city.

Let me know, if you need further details.
osm tool routing ample

nilsnolde commented 6 years ago

I'll get back to this soon, when I start refactoring (once again) to include the algos in Processing for model building etc.

We just started using Pelias directly as geocoding engine, which is a lot mightier in returning city names. I'll also bring back coordinates. ETA rather 3-4 weeks though.

wmeinolf commented 6 years ago

Great news, thanks a lot! Btw, as the Layername is always "Route_ORS", neither QGIS vector data management tools nor Addon MMQGIS is able to merge generated routes into one single layer. Therefore I changed the related line of code in directions.py to "layer_out = QgsVectorLayer("LineString?crs=EPSG:4326", ''.join(random.choice(string.asciiuppercase + string.digits) for in range(8)), "memory")". Now the routes have 8 characters unique names and can easily be merged, at least with MMQGIS addon Merge Layer.

wmeinolf commented 5 years ago

Hi Nils, please help me with some info on the "Refactor to accomodate for processing workflow milestone", to which you added my issue and which is obviously overdue. Do you expect any progress soon? Thanks a lot!

nilsnolde commented 5 years ago

If you mean soon as in this year: yes. But that's really all I can guarantee. I need a full week's time to properly set this up again. And don't hold your breath for a v2.x, I'll discontinue the support. Only v3.x will work going forward. Too much hassle.

wmeinolf commented 5 years ago

Thanks for the status update. I'll stay tuned ;-)

nilsnolde commented 5 years ago

done in master branch