0

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?

  • I have found a solution to this by trial and error. Having spent hours on this - trying different things I tried uninstalling Python 3.3.2 and installed Ver. 2.7.6. This worked. All I have to do is work out how to configure the config file to load OS Mastermap data into PostGres. Any help or examples would be useful. – user23808 Nov 12 '13 at 18:29
0

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.

  • Having been at the OS PSMA members event in Birmingham today so I haven't had chance to do much on this. I have now run the SQL scripts in Postgres (with PostGIS extension) to create the 6 tables and indexes. I am curious about the output directory. Does the loader put the data directly into the database tables or does it create files in the output directory that then have to be imported? I will have a go at this but the examples on the Astun Loader site don't cover this – user23808 Nov 14 '13 at 18:29
  • @user23808 it depends. If you use the standard ogr2ogr command found in the loader.config file it will load directly into Postgis. This is slightly slower though. The alternative is to create SQL dump files and this uses the loader.config in the pgdump folder but I would not do it this way just yet – tjmgis Nov 14 '13 at 19:22
  • It didn't work but checking through your check list above it appears that GDAL is not installed as there is no C:\Program Files\GDAL. Looking at the gisinternals site I am confused what to use. It needs to be 64 bit and Visual Studio 2008 is installed. Is it release-1500-x64-gdal-1-10-1-mapserver-6-4-0 9/24/2013 2:24 PM 24708 kB? – user23808 Nov 14 '13 at 23:17
  • Tried again without installing GDAL. It appeared to work processed and loaded 4 files in about 10 mins. But found no data in tables. In loader.config schema is defined as osmm but where do you specify database name and login details? – user23808 Nov 14 '13 at 23:51
  • Ignore the last comment the loader created large sql files in the output directory. I realise now that I had edited the config file from the pgdump directory instead of the python directory. I think I can sort this out now – user23808 Nov 15 '13 at 8:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.