Jump to content

OpenStreetMap to PostGIS in Windows using Python


Recommended Posts

Hey, 

My quest:
I would like to create my own postgis database using Openstreetmap.

My problem:
None of the OSM/map libraries for python seems to work on windows.

My setup:
- Windows 7
- Python 2.x / 3.x

Anyone here who know how to use any of the libs in windows?

Thanks in advance.

Link to comment
Share on other sites

Usually Python libs work in Windows, installing them is the problem. Mostly there is somewhat cryptic error saying it cannot find vcvarsall.bat or some other file. However, if you install the prerequisites from the precompiled wheels, you can install the library using pip.

For example, OSMpythonTools has a lot of prerequisites, such as lxml, pandas, matplotlib, ujson. Now just typing in "pip install osmpythontools" gives an error like this:

"

  Running setup.py install for ujson ... error
    Complete output from command C:\Python34\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Tanel\\AppData\\Local\\Temp\\pip-build-hrf5z5wi\\ujson\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Test\AppData\Local\Temp\pip-tva4s83x-record\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'ujson' extension
    error: Unable to find vcvarsall.bat


"

So the solution is to download the precompiled wheel from here: http://www.lfd.uci.edu/~gohlke/pythonlibs/

And install the wheel "pip install C:\tmp\ujson-1.35-cp34-cp34m-win_amd64.whl".

Then retry installing and if there is error with any packages, install corresponding wheels.

Edited by jorrarro
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.

Disable-Adblock.png

 

If you enjoy our contents, support us by Disable ads Blocker or add GIS-area to your ads blocker whitelist