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
99 stars 31 forks source link

Visualising isochrones layers from result #26

Closed mobcdi closed 7 years ago

mobcdi commented 7 years ago

Hi Nils, Thanks for developing the tool. Is it possible for you to outline how to format the resulting .shp file which gives the distance to end up with distinct banding. I've tried adding in columns by concatenating the integer value with another field to create a label for the band but I'm not sure if its the best way and if it can then be used to intersect with other point layers

mobcdi commented 7 years ago

I think I have it worked out, In case its useful to others. I used the travel time option to get drive zones around locations at set intervals With the isochrone layer selected.

Create columns in the attribute table

Use concat() to create a string column to label the separate zones e.g. concat("ColA",' ',"AA_MINS",' mins drive')
Use to_int("AA_MINS") to create a new integer column by converting the time value from string to int (You need this later) Save the Attribute Table

Dissolve the layer

Under Layers click -> geoprocessing -> Dissolveand use itstring column you created above as the Unique ID field on which to dissolve

Creating the banding

Depending on how many points you had used as starting points for the isochrones you may be done. Change the properties of the layer to graduated and use the int column you created above. Select your chosen colour ramp. Then select how you want the features to blend (I went with lighten) and set the transparency (I went with 40%) but i'm no expert in styling layers

Bonus

if you have many layers or want to separate out them use the Layers -> Data Management -> Split Vector Layer to split by your preferred attribute to get multiple layer files from 1 isochrone.

nilsnolde commented 7 years ago

Hi,

I needed a few reads over this, but now I know what you were after:) You actually made me realize a glitch in the code. When using layers for isochrones, it puts 'string' as the 'AA_MINS' column type, while it should be 'int'. I´ll fix for the next version. So, you can build your graduated style directly on the AA_MINS column.

out of curiosity: why the dissolve? You actually don´t dissolve anything when you use feature unique ID´s, the output will be the exact same as the input.

mobcdi commented 7 years ago

i thought I needed the dissolve to create the shapes correctly but thats coming from a novice, glad I was able to find a bug, will I get notification in qgis when the update is available?

nilsnolde commented 7 years ago

I´m actually unsure about that. You´ll be able to upgrade manually in the plugin manager once it´s available. You can also check the 'Check for updates on startup' option: image

nilsnolde commented 7 years ago

The new version 0.3.1 fixed the issue of 'AA_MINS' and 'AA_METERS' having type 'int' instead of 'string'.