MMQGIS Hub Distance Issue

217 views
Skip to first unread message

David Haines

unread,
Jul 30, 2015, 9:53:18 PM7/30/15
to Australian and New Zealand QGIS User Group
Hi all,

I am trying to generate distances from ABS meshblock centroids to the coast, using MMQGIS. 

Because I am doing this for a large number of meshblocks, I have taken 1 meshblock on an island as a test case. 

As shown in the attached picture, the distance line not only does not lead to the nearest part of the coastline line, it also doesn't touch the line at all.

The steps I have taken are as follows:
  • I took the meshblock polygons and created a centroid point layer
  • I took a Australian map polygon and converted it to a line layer
  • I took 1 island meshblock as a test case (saving the point and coast outlines for the island as seperate shapefiles)
  • In the MMQGIS plug-in 'Hub Distance' tool I entered the following:
    • Source points layer = meshblock centroid point layer
    • Destination Hubs layer = island coast line layer
    • Hub layer attribute = State name [NB: That this is the only attribute that was present and it has no meaning in terms of the task I am doing]
    • Output Shape Type = Line to Hub
    • Measurement Unit = Metres
    • Equally distributed points across hubs = UNTICKED
  • The output is shown in the attached picture - as I mentioned, the hub distance line doesn't go to the coast line and it has already past the closest point on the coast line.
Any help you can give me would really be appreciated.

Thanks
Dave

MMQGIS error.png

Andrew Harvey

unread,
Jul 30, 2015, 10:06:32 PM7/30/15
to australian-qg...@googlegroups.com
I'm not sure about MMQGIS, but should be fairly straightforward if you load the layers into PostGIS and run a query like:

SELECT
   mb.*,
   ST_Length(ST_ShortestLine(ST_Centroid(mb.geom), australian_coast.geom)) AS distance_to_coast
FROM
  mesh_blocks mb,
  australian_cost
;

Regards,
Andrew

--
You received this message because you are subscribed to the Google Groups "Australian and New Zealand QGIS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to australian-qgis-use...@googlegroups.com.
To post to this group, send email to australian-qg...@googlegroups.com.
Visit this group at http://groups.google.com/group/australian-qgis-user-group.
To view this discussion on the web, visit https://groups.google.com/d/msgid/australian-qgis-user-group/67ce46e9-dcf6-4883-9bee-2cf41dd47de3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Haines

unread,
Jul 30, 2015, 11:51:20 PM7/30/15
to Australian and New Zealand QGIS User Group, andrew....@gmail.com
Thanks Andrew, but I'm afraid I haven't managed to get to PostGIS so far in my GIS travels so your solution is probably a bit beyond me. 


To unsubscribe from this group and stop receiving emails from it, send an email to australian-qgis-user-group+unsub...@googlegroups.com.

David Haines

unread,
Jul 31, 2015, 12:48:57 AM7/31/15
to Australian and New Zealand QGIS User Group, andrew....@gmail.com, david.h...@gmail.com
Hi again,

So I found a round about way that works. If you convert the line to points (I used SAGA lines to points which is the only one that worked for some reason) then you can use mmqgis to do point to point distance lines.

Thanks Again Andrew. I really wish I knew POSTGIS, it's going on the list of things to learn (pretty long list)
Reply all
Reply to author
Forward
0 new messages