Re: [Qgis-user] Road Labels

2020-10-22 Thread Mike Flannigan


Thank you Thayer and Richard.

The Openrouteservice.org GUI map did not work for
my Firefox.


Graphhopper is nearly perfect for what I want, and
I really appreciate you bringing it to my attention.
It's going to save me quite a bit of time.
This is the link I am using:
https://graphhopper.com/maps/

The GPX export of the track is exactly what I need.
The GUI is great.  I rarely have more than a dozen
intermediary points along the track, so I'll probably
just create the URL I need to get the output I need.
Or maybe I will dive into the API, but I hate these
API keys that always seem to be turned off, and I'm
supposed to beg for another one.

QuickOSM appears to have a lot of promise too.
It's on my list to investigate.


Thanks again.


Mike



On 10/22/20 8:07 AM, qgis-user-requ...@lists.osgeo.org wrote:

  Hi Mike,
I am glad this helped you.
I am going to punt on this since a similar question about how to do routes in 
QGIS was asked recently, and I think it received some answers, you should be 
able to find it on the QGIS-user Nabble archive.
That said, my initial thought is that instead of using Google you might want to 
do your routing on websites or API's that are based directly on OSM data, for 
example Graphhopper or Openrouteservice.org that will allow you to export 
routes as GPX. You can then use Douglas Peuker to simplify. If you are looking 
for a more automated way of doing this you may want to dig into the API's for 
those sites.
-Thayer


From: Richard Duivenvoorde 

Totally unaware of the exact contents of this thread... but I know there 
is a plugin: QuickOSM in our repo:


https://plugins.qgis.org/plugins/QuickOSM/

and I could 'just copy/run' this query in the email and it is loaded in 
QGIS?


Regards,

Richard Duivenvoorde

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Road Labels

2020-10-22 Thread Thayer Young
 Hi Mike,
I am glad this helped you.
I am going to punt on this since a similar question about how to do routes in 
QGIS was asked recently, and I think it received some answers, you should be 
able to find it on the QGIS-user Nabble archive. 
That said, my initial thought is that instead of using Google you might want to 
do your routing on websites or API's that are based directly on OSM data, for 
example Graphhopper or Openrouteservice.org that will allow you to export 
routes as GPX. You can then use Douglas Peuker to simplify. If you are looking 
for a more automated way of doing this you may want to dig into the API's for 
those sites. 
-Thayer

On Thursday, October 22, 2020, 08:08:09 AM EDT, Mike Flannigan 
 wrote:  
 
 
Thanks for this procedure Thayer.
I use Overpass Turbo to plot tracks along roads.  It is somewhat
of a complicated process, but it works.  Perhaps I should be
using QGIS to do this instead.

But since I currently reply on the Overpass Turbo website, I am
looking for an alternate website that does the same thing.  I want
to prepare for the day when Overpass Turbo disappears (or moves).

So this email is a 2 part question.

1) Are there any other websites that do what the Overpass Turbo website 
does?

2) Do you have any suggestions on a better way to get a track plot along
roads, when you feed the program just a few vertexes along the road route?

My convoluted procedure to get tracks along roads is shown below.


Mike



THE New Procedure for Tracks is:

Create a text file with DD lat/longs that looks like this:
38.891953, -94.714428
39.961945, -95.788242
42.263043, -96.481528
42.874940, -97.140297
43.095141, -98.332987

This is generally created from taking each point from Google Maps.


Then run googmaptrack.pl to create a google maps URL like this:
https://www.google.com/maps/dir/38.891953,-94.714428/39.961945,-95.788242/42.263043,-96.481528/42.874940,-97.140297/43.095141,-98.332987


Paste that URL into a browser and make sure it is the correct route.
If not, add more intermediary points to correct the route.


Then run trackosrm.pl to create a bunch of terminal commands that
curl an OSRM URL like this:
curl 
'http://router.project-osrm.org/route/v1/driving/-104.062500,46.498392;-94.714428,38.891953?alternatives=false=nodes'
 
 >/home/mike/Documents/copy5/procout01.txt

Paste the whole string of terminal commands into a terminal to create
all the procoutXX.txt files.


Then use trackosrm2.pl to process those procoutXX.txt files
to extract all of the node numbers to nodes.txt.  It will
create an output that looks like this:

[out:json];
(
   node(77927832);
   node(77927830);
   node(77927828);
   node(77927826);
);
(._;>;);
out;

YOU NEED TO ADD THOSE FIRST 2 LINES AND LAST 3 LINES.


Then paste all those nodes and to this website:
http://overpass-turbo.eu/

Hit the Run button at the upper left.

Then hit the "Data" tab at the upper right and copy and paste the data 
supplied
into a file like latlong.txt.

Use garminfile.pl to extract the lat/longs to TopoUSA format.


Unfortunately, curl does not keep the items in order.  So we need
to change the trackosrm.pl 'out' file above that looks like this:
curl 
'http://router.project-osrm.org/route/v1/driving/-118.799440,37.663330;-118.592720,37.671850?alternatives=false=nodes'
 
 >/home/mike/Documents/copy5/procout01.txt
curl 
'http://router.project-osrm.org/route/v1/driving/-118.592720,37.671850;-116.855740,38.125510?alternatives=false=nodes'
 
 >/home/mike/Documents/copy5/procout02.txt

and change it to this:

firefox 
'http://router.project-osrm.org/route/v1/driving/-118.799440,37.663330;-118.592720,37.671850?alternatives=false=nodes'
firefox 
'http://router.project-osrm.org/route/v1/driving/-118.592720,37.671850;-116.855740,38.125510?alternatives=false=nodes'

by using this:
find /home/mike/Documents/copy3 -maxdepth 1 -type f -iname 
"track2_out.txt" -exec grep -il -Z "driving" {} \; | xargs -0 perl 
-i.bak -pnwe 's/curl\s(.*) >.*/firefox $1/g'


Then copy each firefox command into the terminal and copy the web page 
output
into an 'order.txt' file, remove the beginning and ending lines, so we only
have the node lines.  Then do a search and replace - search for 
"^\d+\s+" and
replace with nothing.

So order.txt has nothing but node numbers (in order) in it.

Then use trackorder.pl to reorder all the procout.txt files created above.


Then use trackreduce.pl to reduce the number of points with the Douglas 
- Peucker algorithm.


Then use geojson.pl to create a geojson file to use in QGIS to see what 
the track looks like.




On 10/20/20 5:37 PM, qgis-user-requ...@lists.osgeo.org wrote:
>  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) 

Re: [Qgis-user] Road Labels

2020-10-22 Thread Richard Duivenvoorde
On 10/22/20 2:08 PM, Mike Flannigan wrote:

> 1) Are there any other websites that do what the Overpass Turbo website does?

Totally unaware of the exact contents of this thread... but I know there is a 
plugin: QuickOSM in our repo:

https://plugins.qgis.org/plugins/QuickOSM/

and I could 'just copy/run' this query in the email and it is loaded in QGIS?

Regards,

Richard Duivenvoorde
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Road Labels

2020-10-22 Thread Mike Flannigan


Thanks for this procedure Thayer.
I use Overpass Turbo to plot tracks along roads.  It is somewhat
of a complicated process, but it works.  Perhaps I should be
using QGIS to do this instead.

But since I currently reply on the Overpass Turbo website, I am
looking for an alternate website that does the same thing.  I want
to prepare for the day when Overpass Turbo disappears (or moves).

So this email is a 2 part question.

1) Are there any other websites that do what the Overpass Turbo website 
does?


2) Do you have any suggestions on a better way to get a track plot along
roads, when you feed the program just a few vertexes along the road route?

My convoluted procedure to get tracks along roads is shown below.


Mike



THE New Procedure for Tracks is:

Create a text file with DD lat/longs that looks like this:
38.891953, -94.714428
39.961945, -95.788242
42.263043, -96.481528
42.874940, -97.140297
43.095141, -98.332987

This is generally created from taking each point from Google Maps.


Then run googmaptrack.pl to create a google maps URL like this:
https://www.google.com/maps/dir/38.891953,-94.714428/39.961945,-95.788242/42.263043,-96.481528/42.874940,-97.140297/43.095141,-98.332987


Paste that URL into a browser and make sure it is the correct route.
If not, add more intermediary points to correct the route.


Then run trackosrm.pl to create a bunch of terminal commands that
curl an OSRM URL like this:
curl 
'http://router.project-osrm.org/route/v1/driving/-104.062500,46.498392;-94.714428,38.891953?alternatives=false=nodes' 
>/home/mike/Documents/copy5/procout01.txt


Paste the whole string of terminal commands into a terminal to create
all the procoutXX.txt files.


Then use trackosrm2.pl to process those procoutXX.txt files
to extract all of the node numbers to nodes.txt.  It will
create an output that looks like this:

[out:json];
(
  node(77927832);
  node(77927830);
  node(77927828);
  node(77927826);
);
(._;>;);
out;

YOU NEED TO ADD THOSE FIRST 2 LINES AND LAST 3 LINES.


Then paste all those nodes and to this website:
http://overpass-turbo.eu/

Hit the Run button at the upper left.

Then hit the "Data" tab at the upper right and copy and paste the data 
supplied

into a file like latlong.txt.

Use garminfile.pl to extract the lat/longs to TopoUSA format.


Unfortunately, curl does not keep the items in order.  So we need
to change the trackosrm.pl 'out' file above that looks like this:
curl 
'http://router.project-osrm.org/route/v1/driving/-118.799440,37.663330;-118.592720,37.671850?alternatives=false=nodes' 
>/home/mike/Documents/copy5/procout01.txt
curl 
'http://router.project-osrm.org/route/v1/driving/-118.592720,37.671850;-116.855740,38.125510?alternatives=false=nodes' 
>/home/mike/Documents/copy5/procout02.txt


and change it to this:

firefox 
'http://router.project-osrm.org/route/v1/driving/-118.799440,37.663330;-118.592720,37.671850?alternatives=false=nodes'
firefox 
'http://router.project-osrm.org/route/v1/driving/-118.592720,37.671850;-116.855740,38.125510?alternatives=false=nodes'


by using this:
find /home/mike/Documents/copy3 -maxdepth 1 -type f -iname 
"track2_out.txt" -exec grep -il -Z "driving" {} \; | xargs -0 perl 
-i.bak -pnwe 's/curl\s(.*) >.*/firefox $1/g'



Then copy each firefox command into the terminal and copy the web page 
output

into an 'order.txt' file, remove the beginning and ending lines, so we only
have the node lines.  Then do a search and replace - search for 
"^\d+\s+" and

replace with nothing.

So order.txt has nothing but node numbers (in order) in it.

Then use trackorder.pl to reorder all the procout.txt files created above.


Then use trackreduce.pl to reduce the number of points with the Douglas 
- Peucker algorithm.



Then use geojson.pl to create a geojson file to use in QGIS to see what 
the track looks like.





On 10/20/20 5:37 PM, qgis-user-requ...@lists.osgeo.org wrote:

  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) 

Re: [Qgis-user] Road Labels

2020-10-20 Thread Thayer Young
 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 
To: qgis-user@lists.osgeo.org
Subject: [Qgis-user] Road Labels
Message-ID:
    
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}={y}={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 

Re: [Qgis-user] Road Labels

2020-10-20 Thread Randal Hale
One thing you could do is take the roads you downloaded for Michigan and 
clip them against the county boundary. You should be able to get the 
county boundary from the Michican open data site or the census. If you 
add both the roads and county boundary to your QGIS session I would


1. select your county

2. Open the processing toolbox

3. search for clip

4. Be sure to clip the roads with the selected county

5. Save out your new roads layer to a shapefile (or geopackage) and work 
with the smaller dataset.


Yell if you have any problems - good luck!

Randy


On 10/20/20 9:26 AM, Wanda Norman wrote:


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}={y}={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


___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


--
Randal Hale
rjh...@northrivergeographic.com
(p) 423.653.3611
http://www.northrivergeographic.com

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Road Labels

2020-10-20 Thread Kurt Menke
Hi Wanda,
Another good source of roads for the US is the Census TIGER program. You
can download these for individual counties, which would be smaller, more
manageable files.
https://www.census.gov/geographies/mapping-files/time-series/geo/tiger-line-file.html

Kurt
-- 

**

Kurt Menke
Bird’s Eye View
QGIS Certified Trainer
3016 Santa Clara Ave SE
Albuquerque, NM 87106

www.BirdsEyeViewGIS.com 

Author:
https://locatepress.com/hyd
*https://locatepress.com/dq3  *
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Road Labels

2020-10-20 Thread Charles Dixon-Paver
Sounds like you should be able to just export the roads you need from the
OpenStreetMap data you already have to resolve your issues.

If you have the OpenStreetMap state roads open in QGIS, zoom into your area
of interest. Right click the layer in the layer menu and select
Export>>Save Features As.

In the export menu there is an "Extent" section. Ensure this is enabled and
use the "Map Canvas Extent" button to calculate the extent of the current
view.

This should export just the roads that intersect your current view to a new
file, which can be in a format of your choice (gpkg, shp, kml etc).

Hopefully that will result in a dataset that you can manipulate without
causing a crash and you can get more comfortable interacting with QGIS.

There are other tools and workflows available, but this is the easiest I
can think of for a novice user. Someone else might have a better suggestion
though.

Regards


On Tue, 20 Oct 2020 at 15:20, Wanda Norman 
wrote:

> 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}={y}={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
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user