Got height is a difficualt things, GeoData Workbench/Geomatice Workbench/Trails Workbench gots errors.

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
freecadlzh
Posts: 138
Joined: Fri Mar 06, 2020 12:52 pm

Got height is a difficualt things, GeoData Workbench/Geomatice Workbench/Trails Workbench gots errors.

Post by freecadlzh »

To now I tested three workbench, got height data goes errors all, The resualt list below:

1.Geo data workbench gots errors:
1.png
1.png (162.03 KiB) Viewed 1189 times
2.Geomatics workbench gots errors:
2.png
2.png (230.7 KiB) Viewed 1189 times
3. Trails workbench gots errors:
3.png
3.png (188.74 KiB) Viewed 1189 times
In the three workbench, I used the defalt location, And got errors all.

Now I have no way to got the height , It is a difficault things to me.

But some videos in youtube, some teachers use freecad(geo data workbench, geomatics workbench) got the height is so easy, Why it is such difficault to me? Is there some still ?

Need suggestions , Thanks a lot.


PS: My place is in China, and computers can successfully access Google map and Youtube by climbing over the wall.
User avatar
freecadlzh
Posts: 138
Joined: Fri Mar 06, 2020 12:52 pm

Re: Got height is a difficualt things, GeoData Workbench/Geomatice Workbench/Trails Workbench gots errors.

Post by freecadlzh »

PS:
My about of freecad is :
OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of EME_Simulator_: 64-bit
Version: 0.19.22665 (Git)
Build type: Release
Branch: master
Hash: b0d7850406e046f3b7a8cd5da261e7d54df6bd99
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Chinese/China (zh_CN)

PS:
Some friend in forum suggests got a google acount ,and login, I did it, The resualt is :
4.png
4.png (386.57 KiB) Viewed 1178 times
After trying, even if I'm already logged in map.google.com However, the above error still exists, and the elevation data cannot be loaded.
User avatar
HakanSeven12
Veteran
Posts: 1481
Joined: Wed Feb 06, 2019 10:30 pm

Re: Got height is a difficualt things, GeoData Workbench/Geomatice Workbench/Trails Workbench gots errors.

Post by HakanSeven12 »

Google Maps height api is not supported anymore. bernd said he working on it.
bernd wrote: Fri Sep 18, 2020 1:23 pm thanks for the reminder ... https://forum.freecadweb.org/viewtopic. ... 09#p431609 for reference.
Is there any progress?
User avatar
freecadlzh
Posts: 138
Joined: Fri Mar 06, 2020 12:52 pm

Re: Got height is a difficualt things, GeoData Workbench/Geomatice Workbench/Trails Workbench gots errors.

Post by freecadlzh »

HakanSeven12 wrote: Thu Oct 22, 2020 7:35 am Google Maps height api is not supported anymore. bernd said he working on it.
bernd wrote: Fri Sep 18, 2020 1:23 pm thanks for the reminder ... https://forum.freecadweb.org/viewtopic. ... 09#p431609 for reference.
Is there any progress?
Sorry, perhaps I got a wrong idea.

Above I still think the data is got form map.google.com, but when I learn the source code, I find it is not true:

In import_heights.py sourcecode the line 28 code is :

Code: Select all

def getheight(b,l):
	source="https://api.open-elevation.com/api/v1/lookup?locations="+str(b)+','+str(l)
	FreeCAD.Console.PrintMessage("\n" + "lzh height source is:" + source + "\n")
	say(source)
	print (source)
when the prog runs, I printed the string var "source" and got the data:

Code: Select all

lzh height source is:https://api.open-elevation.com/api/v1/lookup?locations=50.3377879,11.210409616:27:38 
So I think the import_height.py got the height not from map.google.com, just got data from web https://api.open-elevation.com.

Then I tried the url "https://api.open-elevation.com/api/v1/l ... 9616:27:38 " in my browser then got the result:
502 Bad Gateway
nginx/1.13.5


Then I tried import_srtm.py source code line 117:

Code: Select all

def getdata(directory,dat):

	zipfilename=directory + "/{}.osm.zip".format(dat)
	source="http://geoweb.hft-stuttgart.de/SRTM/srtm_as_osm/{}.osm.zip".format(dat)
	FreeCAD.Console.PrintMessage("\n" + "lzh srtm source is:" + source + "\n")
	fn=directory+"/"+dat+".osm"
	if not os.path.exists(fn):
When prog runs, I printed the string var "source" and got the data:

Code: Select all

lzh srtm source is:http://geoweb.hft-stuttgart.de/SRTM/srtm_as_osm/Lat45Lon2Lat46Lon3.osm.zip
So I think the import_srtm.py got the SRTM data not from map.google.com, just got the data from web http://geoweb.hft-stuttgart.de.

Then I tried the url "http://geoweb.hft-stuttgart.de/SRTM/srt ... n3.osm.zip" in my browser, and got the error, can not got the file by my browser.

So, Is the url in sourcecode "import_heights.py" and "import_srtm.py" should be changed to map.google.com? How to change the code?

Need help, Thanks a lot.

PS: The source code above just from Trials workbench source code !
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Got height is a difficualt things, GeoData Workbench/Geomatice Workbench/Trails Workbench gots errors.

Post by bernd »

to make it simpler to wait ...

https://forum.freecadweb.org/viewtopic.php?f=24&t=49575

I have spent some time on this. I have something which works for me on Linux, but i did change a lot in import_osm and did tried a lot services to get the heights. If we would just merge all it would be impossible to track it. I started to make a PR.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Got height is a difficualt things, GeoData Workbench/Geomatice Workbench/Trails Workbench gots errors.

Post by bernd »

if you can not wait try the module attached ... You need to have trails installed, but the one with my PR from https://github.com/joelgraff/freecad.trails/pull/62

This geoosm modul only has one tool, the import osm, but it works with heights. See module get_elevation for a lot of remarks ...

Attached top of Brienzer Rothorn (Railwaystation) near Interlaken near Eiger, Mönch and Jungfrau :)

geoosm.tar.gz
(150.17 KiB) Downloaded 44 times

Screenshot_20201023_104228.png
Screenshot_20201023_104228.png (360.48 KiB) Viewed 1033 times
User avatar
freecadlzh
Posts: 138
Joined: Fri Mar 06, 2020 12:52 pm

Re: Got height is a difficualt things, GeoData Workbench/Geomatice Workbench/Trails Workbench gots errors.

Post by freecadlzh »

bernd wrote: Fri Oct 23, 2020 8:43 am if you can not wait try the module attached ... You need to have trails installed, but the one with my PR from https://github.com/joelgraff/freecad.trails/pull/62

This geoosm modul only has one tool, the import osm, but it works with heights. See module get_elevation for a lot of remarks ...

Attached top of Brienzer Rothorn (Railwaystation) near Interlaken near Eiger, Mönch and Jungfrau :)


geoosm.tar.gz



Screenshot_20201023_104228.png
Thanks for your help, and thanks for your efforts.

I download the file "geoosm.tar.gz", extract to my mod folder and run the prog, The geoosm workbench can runs, I set the location same to your sample and got the result below:
1.png
1.png (197.24 KiB) Viewed 962 times
As the pic shown above, I can find the map model loaded and the height loaded is "0" , seems not get the DEM data.

The report view printed list below:

Code: Select all

23:22:24  way ---- # 17/26 time per house: 0.13
23:22:24      baseheight: 0.0
23:22:24      get heights for 2
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24      Other
23:22:24  way ---- # 18/26 time per house: 0.12
23:22:24      baseheight: 0.0
23:22:24      get heights for 13
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24      Other
23:22:24  way ---- # 19/26 time per house: 0.12
23:22:24      baseheight: 0.0
23:22:24      get heights for 80
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24      Other
23:22:24  way ---- # 20/26 time per house: 0.12
23:22:24      baseheight: 0.0
23:22:24      get heights for 7
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24      Building
23:22:24      No height: None
23:22:24      height abs: 0.0
23:22:24  0.0
23:22:24      height rel: 0.0
23:22:24  way ---- # 21/26 time per house: 0.12
23:22:24      baseheight: 0.0
23:22:24      get heights for 28
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24      Building
23:22:24      No height: None
23:22:24      height abs: 0.0
23:22:24  0.0
23:22:24      height rel: 0.0
23:22:24  way ---- # 22/26 time per house: 0.12
23:22:24      baseheight: 0.0
23:22:24      get heights for 5
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24      Building
23:22:24      No height: None
23:22:24      height abs: 0.0
23:22:24  0.0
23:22:24      height rel: 0.0
23:22:24  way ---- # 23/26 time per house: 0.11
23:22:24      baseheight: 0.0
23:22:24      get heights for 7
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24      Building
23:22:24      No height: None
23:22:24      height abs: 0.0
23:22:24  0.0
23:22:24      height rel: 0.0
23:22:24  way ---- # 24/26 time per house: 0.11
23:22:24      baseheight: 0.0
23:22:24      get heights for 5
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24      Building
23:22:24      No height: None
23:22:24      height abs: 0.0
23:22:24  0.0
23:22:24      height rel: 0.0
23:22:24  way ---- # 25/26 time per house: 0.1
23:22:24      baseheight: 0.0
23:22:24      get heights for 31
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24  Module srtm4 not found
23:22:24      ---no height used for landuse ATM
23:22:24  ('running time ', 2, ' count ways ', 26)
PS: As my place is in china, so I did opened a “Wall climbing software” .

My questions are:

1. I think there is somthing wrong, Pleas give me some suggestion.

2. And, Will your newly released geosm be on your GitHub? If so, please provide the GitHub address.If you make any changes, do I have ne on GitHub?
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Got height is a difficualt things, GeoData Workbench/Geomatice Workbench/Trails Workbench gots errors.

Post by bernd »

It seams you are on windows. As I wrote before. It only works on Linux out of the box. If you are on Linux you need to indtall the missing module.

For more infirmations see the duzens of comments in get_elevation module.

This is exactly the reason we can not just merge it, because it does work only some cases out of the box.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Got height is a difficualt things, GeoData Workbench/Geomatice Workbench/Trails Workbench gots errors.

Post by bernd »

As soon as it is improved I will go for a PR to trails.

At the moment this is not on a github, as it only has been dome haack to get it working for my purpose. I may put it on github anyway ...
Post Reply