GeoData Workbench

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
HakanSeven12
Veteran
Posts: 1481
Joined: Wed Feb 06, 2019 10:30 pm

Re: GeoData Workbench

Post by HakanSeven12 »

I'm not using geodata I'm using trails workbench. I implemented geodata to it and fixed bugs for python 3.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: GeoData Workbench

Post by bernd »

HakanSeven12 wrote: Sun May 17, 2020 8:13 pm I'm not using geodata I'm using trails workbench. I implemented geodata to it and fixed bugs for python 3.
you mean the Geomatic workbench from AddOn manager. Same problem as on GeoData

Code: Select all

I try to read data from cache file ... 
C:\Users\BHA\AppData\Roaming\FreeCAD\geodat3/50.340722-11.232647-0.25
no cache file, so I connect to  openstreetmap.org...
http://api.openstreetmap.org/api/0.6/map?bbox=11.229140688639552,50.338475818508535,11.236153311360448,50.342968181491464
Traceback (most recent call last):
  File "C:\Users\BHA\AppData\Roaming\FreeCAD\Mod\Geomatics\GeoDataWB\import_osm.py", line 128, in import_osm2
    f = open(fn, "r")
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\BHA\\AppData\\Roaming\\FreeCAD\\geodat3/50.340722-11.232647-0.25'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\BHA\AppData\Roaming\FreeCAD\Mod\Geomatics\GeoDataWB\import_osm.py", line 695, in downloadData
    rc = import_osm2(float(b), float(l), float(s)/10, self.root.ids['progb'], self.root.ids['status'], elevation)
  File "C:\Users\BHA\AppData\Roaming\FreeCAD\Mod\Geomatics\GeoDataWB\import_osm.py", line 141, in import_osm2
    import requests
ModuleNotFoundError: No module named 'requests'

Code: Select all

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.21068 (Git)
Build type: Release
Branch: master
Hash: 92fe9adebbff910c5a10d6230785a6b58935b677
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Switzerland (de_CH)
User avatar
HakanSeven12
Veteran
Posts: 1481
Joined: Wed Feb 06, 2019 10:30 pm

Re: GeoData Workbench

Post by HakanSeven12 »

bernd wrote: Tue May 19, 2020 5:55 pm you mean the Geomatic workbench from AddOn manager.
No. Geomatics and Trails merged. Here: https://github.com/HakanSeven12/freecad.trails
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: GeoData Workbench

Post by bernd »

Gave GeoData workbench a try on Linux. I had to install some Python packages namely gdal and opencv and OSM import runs like a charm (Python requests was installed on my linux already).

IMHO it seams the question could be reduced to:

Should we add Python requests to Windows version or is there some package in Windows version which could be used instead requests? Or ist it possible to install a Python package on Windows FreeCAD (especially the LibPack 7z dev packages.)
sgrogan wrote: ping
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: GeoData Workbench

Post by bernd »

the use of urllib instead of requests would be another option, as urllib is included in FreeCAD LibPack, but it seams this could be some crucial question.
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: GeoData Workbench

Post by microelly2 »

bernd wrote: Tue May 19, 2020 6:14 pm the use of urllib instead of requests would be another option, as urllib is included in FreeCAD LibPack, but it seams this could be some crucial question.
This should not be a problem.
Another idea is to download the whole osm database or a country and store it into a local database and implement the access to this database?
User avatar
HakanSeven12
Veteran
Posts: 1481
Joined: Wed Feb 06, 2019 10:30 pm

Re: GeoData Workbench

Post by HakanSeven12 »

bernd wrote: Tue May 19, 2020 6:14 pm the use of urllib instead of requests would be another option
That is exactly what I did. https://github.com/HakanSeven12/freecad ... sm.py#L141
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: GeoData Workbench

Post by bernd »

microelly2 wrote: Tue May 19, 2020 6:26 pm
bernd wrote: Tue May 19, 2020 6:14 pm the use of urllib instead of requests would be another option, as urllib is included in FreeCAD LibPack, but it seams this could be some crucial question.
This should not be a problem.
Another idea is to download the whole osm database or a country and store it into a local database and implement the access to this database?
as many users use windows version which makes it difficault to install python packages it would be cool.
The data base idea would be awesome for power users which really use osm download every day (Is there some?). But most useres will not use it ATM IMHO.

BTW the button to show the coordinates in a browser is cool. What would be very useful would be if a link from osm could be copied and just the size of the rectangle would be given. No trail and error with coordinates needed anymore. Furthermore I like the examples. Thus the upload is easy to test.
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: GeoData Workbench

Post by sgrogan »

bernd wrote: Tue May 19, 2020 6:06 pm IMHO it seams the question could be reduced to:

Should we add Python requests to Windows version or is there some package in Windows version which could be used instead requests? Or ist it possible to install a Python package on Windows FreeCAD (especially the LibPack 7z dev packages.)
requests is easy to add as it's pure python https://pypi.org/project/requests/#files
opencv is a little tougher but should be possible as there are wheels available https://pypi.org/project/opencv-python/#files
gdal is the most tricky as it needs to be built from source https://pypi.org/project/GDAL/#description
From the above it looks like some binaries are available but it might take some work to get it to work with FreeCAD's python on Win.

It looks like everything is available on Coonda, so that may even be easier.

Is only requests necessary or the other packages as well?
"fight the good fight"
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: GeoData Workbench

Post by bernd »

yes they are all needed, but it seams gdal is only needed for the some special import geodat import AST (gdal) It should be possible to run GeoData without it.

microelly2 should now any better
microelly2 wrote: ping
Post Reply