Saturday, 12 December 2015

qgis - Problems installing the Astun Technology Loader in Windows 7



I previously asked a question Using OS Mastermap SLDs in QGIS I got several answers suggesting that I use the Astun Technology Loader. There are details on how to do this https://github.com/AstunTechnology/Loader/wiki/Installation.


However this has proved very difficult in Windows 7


The first problem was the PATH environment in the OSGeo4w shell which is not the same as the standard 'cmd' shell. In the OSGeo4W shell having changed to the directory where distribute_setup.py is located the first problem is trying to run 'python distribute_setup.py'. It is necessary to either add C:\python33 to the PATH variable or directly reference it. This then runs OK.


From the same shell and directory and having located easy_install in C:\python33\scripts I have tried running 'easy_install lxml==2.3' this fails giving the errors ERROR: b"'xslt-config' is not recognised as an internal or external command make sure the development packages of libxm12 and libxslt are installed error: Unable to find vcvarsall.bat


There was no file called 'vcvarsall.bat' on my PC. From searches on the net I discovered it is part of Visual Studio 2008. Luckily I had a copy of Visual Studio 2008 which I have now installed. 'vcvarsall.bat' is now installed in the directory C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC. I have added this directory to the PATH variable in the OSGeo4W shell without any success.


I am now completely stuck - Any suggestions?



Answer



there are some examples on the Astun Loader wiki pager found here


https://github.com/AstunTechnology/Loader/wiki/Configuration-examples


Essentially you edit the .config file and change the



src_dir=/path/to/source/data/folder - to the path to the gzip files


out_dir=/path/to/output/data/folder - to an output directory you create


tmp_dir=/path/to/temp/folder - to a temp directory you create


So for example you could have


src_dir=/path/to/source/data/folder - C:/OS/GML


out_dir=/path/to/output/data/folder - C:/OS/Output


tmp_dir=/path/to/temp/folder - C:/OS/Temp


Then at the bottom make sure it is looking for the correct gfs file, these are stored in the gfs file.


gfs_file=../gfs/osmm_topo_postgres.gfs


if you only have a small number of GML files ignore the stuff in the postgres folder



I know you have had problems with the setup. My standard way is to


1) Install python 2.7


2) Add the install folder (eg C:\Python27) to your path environment variable


3) Downlad GDAL complete from here http://www.gisinternals.com/sdk/ - make sure you pick the correct 32bit or 64bit depending on your system


4) then add that path (eg C:\Program Files\GDAL) to your path environment variable


5) Then install LMXL LXML is a python module that reads XML and is therefore used to read our GML. Download the appropriate version from here


http://pypi.python.org/pypi/lxml/2.3


obviously get the one that matches the python version you have installed above.


Once all those things are done you should be able to load the data.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...