-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Contour lines #145
Comments
Hi, |
Well it is - kind of - possible. But needs extra steps.
Disclaimer:
|
Hello, PHYGHTMAP seems to be a better choice no ? A good exemple from https://oruxmaps.forumotion.com/t2216-contourlines-added-for-oruxmapsforge
I will try to test. Have a good day. |
@geekitus: that would be great, if it works. Because being also coded in python would make a better integration than with the srtm2osm executable. |
Hi @geekitus, |
Did some testing today, but I got stuck with PHYGHTMAP on windows with the latest matplotlib not having the _contour function anymore for a long time now it seems. So I got a phyton import error on _contour. I did a test with srtm2osm and got a osm file out of it to test further with. Maybe later this week. |
Just install matplotlib 3.4.3 via pip |
Thanks! It's starting without error (after pip install bs4 too) |
@vanyasvl I'm am at work right now but I ran into an error yesterday evening (late). Don't have the error message at hand but I'm hoping you know what I'm running into... |
Check |
Thanks, but here you seem to manually download the elevation tiles. I thought phyghtmap was supposed to do that for you? |
@vanyasvl Maybe I need to do something with --rewrite-indices, but how? I'm sure I'm doing something stupid, but what? |
phyghtmap has an issue with hsgt data downloading. Download files manually like I do in my script |
@vanyasvl Just got it to work (at least it downloads and does something) Turned out all I needed to do was a pip install lxml... |
Still running into some troubles, but also some success! |
@Ebe66 : I don't go into every details of the tread above. And even if I did: In some month I will not remember the solution any more. |
@limex I don't know if Treee111 wants to incorporate this, but sure I can make a list of the things I ran into (on windows). The method used was the phyghtmap way as described above near the top (or more precise the later version of it posted in the mentioned thread).
Basically it was running now and I could generate my tile maps. But...
Mind, I'm most certainly not a expert in this field but my current command line looks something like this: Hope it helps out someone. Edit: Have had feedback that the matplotlib _countour problem is also on macOS but fortunately the fix is also the same |
@Ebe66 helped me to get it working and integrated into @treee111 's code. Thanks again! I tested on macOS BigSur and it works fine so far. I use python3.10 via brew. Additionally to before I had to do: pip3 install bs4 Download and unpack matplotlib-3.4.3.tar.gz from https://pypi.org/project/matplotlib/3.4.3/#files Download and unpack http://katze.tfiu.de/projects/phyghtmap/phyghtmap_2.23.orig.tar.gz And here you find a working version (some things can be made better). In osm_maps_functions.py, line 551, insert your account data from https://ers.cr.usgs.gov. Here it would be cool to use arguments/parameters to not have the account data in source code. |
Hi you both - @Ebe66 and @masc4ii, That's done from my side for contour lines. Please make sure that shapely is installed via conda-forge as written in this link! |
@treee111 : Thank you for implementing! Now I found the time to test. I tried to create canary islands. The processing stops with this error:
When commenting this line, I get a very similar error in line 215. Something I missed to install? I use the macOS brew python 3.10. Installed shapely is 1.8.5. In my fork this line looks identical and no such error pops up. Edit: found it. "python" in code always has to be "python3" on my macOS. Changed -> works. Cool! Where do you save the user data needed for contour lines? |
Hi @masc4ii! Sorry for the late reply.. thanks a lot for testing! Nice, that you found that out by yourself! I assume you have your installation in your main/standard Python environment and not via Anaconda. That might be the reason for you to have I'd recommend using Anaconda and the setup I described in the docs, its very easy to setup and you have it isolated from the rest of your system. Anyway, I am glad that it worked also in your setup 👍 I'll save the userdata in |
implemented with #188 |
Well, trying srtm opens the python module hell for me. It needs ogr and osr. After changing the source to use "from osgeo import ogr" and the same for osr I get loads of other errors. Switching to view3 does give a complete picture. But the viewfinder site confuses me and sometime contradicts itself it seems. But if this part is still valid it might even be better to use the view3 data: |
nice finding! So can there be applied a general coding/config change to get better results over all? Or is it specific to certains regions/countries? |
Hard to say for me. That is what I mean by the contractionary information. The obvious choice would be to use srtm1 data (if someone can make it work) but the info on the viewfinder site on the one hand says that only the US is available but on the other hand at a different place the whole planet excluding north/south of 60". As long as srtm is not working the best option appears to be using view3. |
What do we have to change, to get this working? Looks great! |
@masc4ii Not sure if it's still needed (or in all cases) but I had to change my gdal.py in folder C:\Users\ebodd\AppData\Local\Programs\Python\Python39\Lib\site-packages\osgeo (in my case) at line 1984 to I also needed to install a newer version of gdal (that's why I'm not sure the above is still needed). The, best, choice of elevation data sources seems to be region dependent. |
@Ebe66 thank you. The gdal.py seems to be different on my system. The line looks not as I would expect it. When searching "from osgeo import" in this file I get many results - no idea which of those lines to change. So I did not change it for now. What version of gdal do you have installed? I have v3.6.2. Then I tried just to add the "srtm1" into the call in osm_maps_functions.py, but then I get maaaany errors. Edit: how bad... it is not just because of this change. Elevation line generating is completely broken for me now. It seems elevation data is not downloaded. zip file has 0Byte. |
I just shut down my computer but the lines where import ogr and osr which I changed to from osgeo import etc. |
Seems there was a problem with the elevation data server. Now it is working just fine. All I had to do was changing to this "--source=srtm1,view1,view3,srtm3" and I got the srtm1 data. My gdal is (as written) 3.6.2. No more change needed here. Quality of view1 data often looks better than srtm1. Therefor this elevation "hole" is fixed. Thank you! |
… from 3.4 to 3.6 (#203) use srtm1 data for contour lines + upgrade GDAL from 3.4 to 3.6 see: #145 (comment)
Hi you both - thanks for digging into that and clarifiying! 👍 |
…om 3.4 to 3.6 (#203) use srtm1 data for contour lines + upgrade GDAL from 3.4 to 3.6 see: #145 (comment)
Hi @treee111 , your change looks like we use srtm1 always now. I am not sure if this is good. view1 offers better quality for contour lines in general, apart from the few missing/faulty areas. srtm1 here and there looks very rough compared to view1. Maybe the idea from @Ebe66 , having a checkbox in GUI (or option in commandline) could solve this. |
Thanks for the hint @masc4ii! Now I got it. I thought in the argument would be some kind of ordering what suits better but it isn't that clever ;-) Option is available via CLI and GUI. I just realized now that generating contour lines from GUI doesn't work for the first time, it crashed when we ask the user for credentials. But that's another topic ;-) |
Great! Thank you very much. What parameter do I have to set via CLI, if I like to create with srtm1? I just found the already known "-con" in the docs. |
Found it: "-con -srtm1" seems to be it. On my testruns I still get a problem. Tile 134/90 fails with I noticed that the elevationXXX.osm file is huuuge for this tile: for view1 it is 4.6GB, for srtm1 it is 76GB. merged.osm.pbf is around 1.1GB. I tried before the wmc command (16GB because I think we need a lot of memory here): But this doesn't help. For neighbor tiles it works. For 134/91 the elevationXXX.osm is just 1.1GB and merged.osm.pbf is 92MB. Something seems to be very wrong for 134/90. @Ebe66 : for your maps this tile run through without errors? Edit: I had luck with view3. But this looks ugly. Will test more. |
Hi @masc4ii, you'r right, the CLI argument is Thanks for the hint & sorry for the late reply. Concerning the behaviour of 134/90 you did what I also mentioned in the FAQ, setting the RAM higher. 76GB for elevation data does not really look OK in comparison of the others. I don't think Mount Everest is there which would be a valid reason ;-) you guys are awesome 👍 |
I found a solution. You can tell osmosis to use HD instead of RAM, using parameter "type=hd". Might be a little slower... but no more crash.
Resoluting .map file is 74MB. Without elevation it is "a little" smaller, 14MB. 🤣 |
- fixes #145 (comment) - use parameter "type=hd". Might be a little slower... but no more crash.
- fixes #145 (comment) - use parameter "type=hd". Might be a little slower... but no more crash.
…om 3.4 to 3.6 (treee111#203) use srtm1 data for contour lines + upgrade GDAL from 3.4 to 3.6 see: treee111#145 (comment)
- fixes #145 (comment) - use parameter "type=hd". Might be a little slower... but no more crash.
- fixes #145 (comment) - use parameter "type=hd". Might be a little slower... but no more crash.
- fixes #145 (comment) - use parameter "type=hd". Might be a little slower... but no more crash.
- fixes #145 (comment) - use parameter "type=hd". Might be a little slower... but no more crash.
Hello.
Is it possible to add contour lines (altitude lines) to map?
The text was updated successfully, but these errors were encountered: