[Qgis-user] Road Labels

Thayer Young thayeray at yahoo.com
Tue Oct 20 13:26:31 PDT 2020


 Hi Wanda,
There are ways of filtering Open Street Map data before you download it, so the processing is done on the server not on your computer, so that should help you avoid crashes in QGIS. 
One way to do this is with Overpass Turbo (https://overpass-turbo.eu) to select all of the roads in the map view. 
Overpass Turbo 
0) Close applications that you do not need, and open a web browser.1) Go to the Overpass Turbo website and use the search and zoom controls to adjust the map to your area of interest. 2) Then copy and paste the sample query into the text area to the left side of the map window. 3) Then click on the "Run" button at the top left.4) After it runs for a while it will probably say "Large Amounts of Data"  and ask you if you want to continue, click "continue anyway".     Rockford indeed is small and does not have this problem, but Grand Rapids for example gives 30 MB of data, 60 MB may cause an error.5) Click on Export (third button from the left at the top). 6) Then on the top line of the dialog click "download" from "download/copy as GeoJSON"7) Name the file and download it to somewhere that you will be able to find again (the default is export.geojson).8) Click "done"9) Close the web browser
QGIS
10) In QGIS open the Data Source Manager and click on Vector (at the top click Layer then choose Data Source Manager from the menu)  a) Under Source click on the three dots to the right of Vector Datasets   b) browse to the export.geojson file and click Open.  c) at the bottom right of the Data Source Manager-Vector window click on "Add"  11) This will bring up a dialog asking you which of the geometry layers to add.  a) click on the one that says LineString at the right side under Geometry type. Then click OK.12) After a few seconds you should see the "export" layer appear in the Layers list and see the roads show up in the map.  a) close the Data Source Manager window.
Geojson layers are very slow in QGIS, so you should convert them to another format like ESRI Shapefile.
13) In the Layers panel right click on the "export" layer (the one with the line on the left side)  a) from the menu hover over Export then click on Save Features As14) At the top of the "Save Vector Layer As..." dialog:   a) change the format to "ESRI Shapefile"  b) click on the three dots to the right of File Name    i) name your file (e.g. grand_rapids.shp), choose a folder where to save it, and click "Save"  c) at the bottom click OK.  d) the grand_rapids layer will be added to the Layers panel, and the color of the roads on the map should change.15) Right click on the "export" layer.  a) click Remove Layer    i) click OK when asked: "Remove 1 Legend Entries?"16) Save the project.
Label the roads.
17) Double click on the "grand_rapids" layer in the Layers panel.18) At the left of the Layer Properties window click on Labels  a) at the top change No Labels to Single Labels    i) just below Single Lables set the Value to "name"    ii) at the bottom right click OK
Now when you zoom in and out the labels will appear on the roads.
-Thayer
Sample Overpass Turbo Query:
/*This has been generated by the overpass-turbo wizard.The original search was:“highway=* and motorvehicle!=no”*/[out:json][timeout:25];// gather results(  // query part for: “highway=* and motorvehicle!=no”  node["highway"]["motorvehicle"!="no"]({{bbox}});  way["highway"]["motorvehicle"!="no"]({{bbox}});  relation["highway"]["motorvehicle"!="no"]({{bbox}}););// print resultsout body;>;out skel qt;




Message: 2
Date: Tue, 20 Oct 2020 09:26:14 -0400
From: Wanda Norman <wanda.mnorman2015 at gmail.com>
To: qgis-user at lists.osgeo.org
Subject: [Qgis-user] Road Labels
Message-ID:
    <CAFN0wn2DxP9Pz+gMqVypto_T2w0qpFHT4j4mZ5x69Bak7eAwng at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hello Helpful Members;



I am a fairly new user (about 3-4 months now).  I have been using the
online tutorials, the training manual and anything I can understand.



BACKGROUND

I am a parking planner so I create maps of my study area, which is usually
an entire city, in various US states.  For example, right now I am working
on Rockford, Michigan, USA.  I know it is a small area, but it is one in
which we have already done the study and I am trying to recreate everything
we did for them (my GIS person no longer works with us, so I am learning).



WHAT I NEED TO DO

I need to be able to add a layer containing street names for my study
area.  This layer needs to have an attribute table I can manipulate to get
only the streets (labels) within my study area.  I do not want the point
bubbles (ex: Target, Leo's Coney Island, etc.) that point out restaurants
and places of interest that I seem unable to get rid of when I use google
roads (xyz: https://mt1.google.com/vt/lyrs=h&x={x}&y={y}&z={z} ).



WHAT I HAVE TRIED

I am unable to manipulate data in open street maps.  I have tried to
download the roads vector file from the State of Michigan.  However, this
file is so huge (as it contains every road in the state) it keeps crashing
every time I try to manipulate it.  I have been able to select just the
roads in the area I want using an expression, but it crashes when I try to
select one of the roads to remove it from the study area (stragglers I do
not want to show after using the select area tool).  I have also tried to
select all the records I do not need in an effort to delete them in the
hopes of making the file smaller.  Again, it crashes.



MY QUESTION

Can someone please give me a link to a tutorial that will show me where and
how to get just the road names for any US city (as I need them).  Or
provide me with directions to do what I need?  I have been trying to figure
this out for over 2 months now and just can’t seem to find what I need.



As my computer constantly crashed using QGIS after the new Windows updates,
we have installed new hardware in hopes to keep it from crashing.



Dell Computer

Currently have 16 gig memory (increased from 8)

2 gig AMD Radian R5 Video card (newly installed)

Core I3 processor

Using QGIS 3.10.9 (3.14 won’t load)



Sorry for the long email.  Please let me know if you require more info.



Thank you for your kind attention.


Wanda Norman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20201020/0b2c481d/attachment-0001.html>

------------------------------  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20201020/af5e328f/attachment.html>


More information about the Qgis-user mailing list