大数据与城市规划 (26).pdf
SPATIAL DESIGN NETWORK ANALYSIS sDNA in QGIS 1 Installing sDNA+as plugin for QGIS.2 1.1 Download&Install sDNA.2 1.2 Setting up sDNA in QGIS.3 1.3 Open the sDNA toolbox.5 2 sDNA in QGIS Processing HK Vehicle network.5 2.1 Load the Transport vector layer.5 2.2 Running sDNA prepare.5 2.3 Using sDNA Integral Analysis.6 2.4 Displaying sDNA Results.7 2.5 Save project.11 3 Exporting an image from QGIS.11 3.1 Use“Export as Image”.11 3.2 Use“Print Composer”to create high-resolution output.12 4 Adding Basemaps(Google,OpenStreetMap,Yahoo!,Bing).16 5 Appendix:How to use OSM data for sDNA analysing.17 5.1 Download OSM data extract from Mapzen/Geofabrik/BBBike.17 5.2 Clean OSM map for processing.18 5.3 Repeat 2.2 to 2.4 to process the map using sDNA.19 Alain Chiaradia,alainjfchku.hk;Dr.Lingzhu Zhang,zhanglzhku.hk.hk SPATIAL DESIGN NETWORK ANALYSIS 3D pedestrian network mapping&accessibility and flow analyses 1 Installing sDNA+as plugin for QGIS 1.1 Download&Install sDNA Get into sDNA official website,go to the download page http:/www.cardiff.ac.uk/sdna/Choose the latest version(v3_4_6)to download Run the downloaded file“sDNA_setup_win_v3_4_6.msi”,follow the installation instruction“Next”“Next”“Next”Tick box“I accept”“Install”“Finish”License sDNA you need to sign up to get a free sDNA license From sDNA website:http:/www.cardiff.ac.uk/sdna/From the Windows Start menu,find“sDNA License Manager”in the sDNA folder;Click and select“All Users”Alain Chiaradia,alainjfchku.hk;Dr.Lingzhu Zhang,zhanglzhku.hk.hk Follow the instructions show in“sDNA License Manager”window to authorize.1.2 Setting up sDNA in QGIS Open QGIS.“Plugins”tab”Manage and install plugins”,it may take a bit of time to fetch the list of plugin In“Plugins|Settings”window,under“Settings”,make sure you have checked the box Show also experimental plugins Alain Chiaradia,alainjfchku.hk;Dr.Lingzhu Zhang,zhanglzhku.hk.hk Back to“ALL”search“SDNA”“Install plugin”In”Processing”tab,Select“Options”Select“General”and check the“Keep dialog open after running an algorithm”Alain Chiaradia,alainjfchku.hk;Dr.Lingzhu Zhang,zhanglzhku.hk.hk Then go into“Providers”,sDNA should show up as activate and the location should be as shown below.1.3 Open the sDNA toolbox Find the“Processing”tab click Toolbox,a toolbox panel should show up on the right of the QGIS window.2 sDNA in QGIS Processing HK Vehicle network 2.1 Load the Transport vector layer click on the Add Vector Layer toolbar button,load“HKisland_Centreline.shp”2.2 Running sDNA prepare This is a stage to take care of error in the network.For more details see:http:/www.cardiff.ac.uk/sdna/wp Alain Chiaradia,alainjfchku.hk;Dr.Lingzhu Zhang,zhanglzhku.hk.hk content/downloads/documentation/manual/sDNA_manual_v3_4_5/network_preparation.html#principles In“Processing toolbox”on the right,in sDNA toolbox click“Preparation”and double-Click“Prepare Network”.In Input polyline features select the layer“HKisland_Centreline”(if only one it is automatically selected);change the Action set to“Repair”;tick“Split links”to join all the segments between junctions into one continuous segment.save the output file as“clipped _prepare.shp”,then click on“RUN”to prepare network.Close Prepare Network window 2.3 Using sDNA Integral Analysis Alain Chiaradia,alainjfchku.hk;Dr.Lingzhu Zhang,zhanglzhku.hk.hk Double click“Integral Analysis”In“Processing toolbox”on the right Select the prepared layer as input dataset;select“Angular”analysis metric;set the analysis radii:“800,2000,5000”;specify output dataset location,name the new layer as“Centreline_central_pre_ang”;click“Run”to compute.Once processing is finished,close the Integral Analysis and rename the output layer to“HKisland_Centreline_pre_ang”2.4 Displaying sDNA Results Right click on the layer Properties Alain Chiaradia,alainjfchku.hk;Dr.Lingzhu Zhang,zhanglzhku.hk.hk In Style,change the Single Symbol to“Graduated”;Column:select BtA 800(Betweenness Angular 800m);Change Color ramp to“RdYlBu”;Mode:Quantile(Equal Count);Classes:10;Tick Invert.In Advanced,select Symbols Levels,Tick Enable Symbols Level,and then from blue to red,number the layer 0 from 1 to 10.OK Alain Chiaradia,alainjfchku.hk;Dr.Lingzhu Zhang,zhanglzhku.hk.hk Apply to see what this give you and OK Set the line thickness through the Layer PropertiesStyleSymbol,set the line width Right click on the layer,and“Rename”the layer as“HKisland_Centreline_pre_BtA800”Alain Chiaradia,alainjfchku.hk;Dr.Lingzhu Zhang,zhanglzhku.hk.hk Copy the layer by Right clicking on the layer “Duplicate”;Rename the layer as“HKisland_Centreline_pre_BtA2000”Right click the“Centreline_central_pre_BtA2000”layer Properties Style and change Column to BtA2000.To make the change to happen toggle Mode between Equal Interval and back to Quantile.Then the legend change and you can Apply and Close.Do the same for layer 5000.SO you have 3 graphic+3 legends.Alain Chiaradia,alainjfchku.hk;Dr.Lingzhu Zhang,zhanglzhku.hk.hk 2.5 Save project Go to menu,Project Save choose the name for your project(e.g.,HKisland_vehicle)and the location to save it 3 Exporting an image from QGIS 3.1 Use“Export as Image”Project Save as Image.Save in the desired format(png,jpg,tiff)Alain Chiaradia,alainjfchku.hk;Dr.Lingzhu Zhang,zhanglzhku.hk.hk Save as Image simply saves the currently visible map.Its not possible to adjust the resolution of an output image 3.2 Use“Print Composer”to create high-resolution output Un-check the box next to layers to turn off some map layers for data that we do not need.Go to Project New Print Composer.You will be prompted to enter a title for the composer.You can leave it empty and click Ok.Alain Chiaradia,alainjfchku.hk;Dr.Lingzhu Zhang,zhanglzhku.hk.hk In the Print Composer window,click on Zoom full to display the full extent of the Layout.Then go to Layout Add Map.Once the Add Map button is active,hold the left mouse button and drag a rectangle where you want to insert the map.You will see that the rectangle window will be rendered with the map from the main QGIS canvas.Use Layout Move item content to pan the map in the window and center it in the composer.Alain Chiaradia,alainjfchku.hk;Dr.Lingzhu Zhang,zhanglzhku.hk.hk Add a Scalebar.Click on Layout Add Scalebar.Click on the layout where you want the scale bar to appear.In the Item Properties tab,choose the Style that fit your requirement.Alain Chiaradia,alainjfchku.hk;Dr.Lingzhu Zhang,zhanglzhku.hk.hk Layout Add Legend.I the Item properties tab,find Legend items panel.Use minus button to remove unwanted items.Select a layer from the same list,Click the Edit button;Re name the layer to“HKISLAND_BtA800”.Composer Export as image,Browse to locate the file.Set the output image resolution,and save Alain Chiaradia,alainjfchku.hk;Dr.Lingzhu Zhang,zhanglzhku.hk.hk 4 Adding Basemaps(Google,OpenStreetMap,Yahoo!,Bing)From the main menu click“Plugins”“Manage and Install Plugins”Search“openlayers”to filter plugins,select“OpenLayers Plugin”“install plugin”CLOSE the Plugins window after you see successfully installed dialog box.Click“Web”“OpenLayers Plugin”“OpenStreetMap”Alain Chiaradia,alainjfchku.hk;Dr.Lingzhu Zhang,zhanglzhku.hk.hk Click and drag the“Google Street”layer to beneath the sDNA analyzed layers.5 Appendix:How to use OSM data for sDNA analysing 5.1 Download OSM data extract from Mapzen/Geofabrik/BBBike http:/extract.bbbike.org/Click the search button Move the map to the desired position using the zoom function on your mouse,click“here”to create a bounding box when satisfied.Alain Chiaradia,alainjfchku.hk;Dr.Lingzhu Zhang,zhanglzhku.hk.hk If the bounding box does not cover the area required,you can cancel the selection by clicking on“select a different area”.Repeat the process of navigating till you are satisfies with the area the bounding box covers(data extracted will fall within the bounding box).When satisfied input your email address,hit“extract”After the arrival of the email with a link that directs to your data download.Save your OSM data extract in a folder.The OSM data comes in a zip folder,unzip the contents.5.2 Clean OSM map for processing Difference between Link&unlink intersections Break all of the“link”intersections at once(or you can use“Cleanup”in AutoCAD Map 3D to do the same)Select the road layer,then click“Edit”mode Show“Processing Toolbox”Alain Chiaradia,alainjfchku.hk;Dr.Lingzhu Zhang,zhanglzhku.hk.hk “Processing Toolbox”“QGIS geoalgorithms”“Vector overlay tools”“Split lines with lines”Double-click to open“Split lines with lines”dialog,set“Input layer”and“Split layer”,save the splitted file as“osm_HKisland_roads_split.shp”,click“Run”Import“osm_HKisland_roads_split.shp”into QGIS Use“Select Feature”to check that all of the intersections were broken.5.3 Repeat 2.2 to 2.4 to process the map using sDNA.