[ddj] police forces map

Páll Hilmarsson pallih at kaninka.net
Fri May 18 02:09:49 UTC 2012


You could combine each area into one kml file (and then all areas into one
country level file). In python something like this should work (run it in
each folder):

import os
import glob
filename = 'combined.kml'
start = '<?xml version="1.0" encoding="UTF-8"?>\n<kml xmlns="
http://earth.google.com/kml/2.1">\n<Document>\n'
end = '\n</Document>\n</kml>\n'

FILE = open(filename,"w")
FILE.writelines(start)
path = ''
for infile in glob.glob( os.path.join(path, '*.kml') ):
    f = open(infile)
    content = f.readlines()[3:-3]
    for x in content:
     FILE.write(str(x))
FILE.writelines(end)
FILE.close()

All the best,

pallih

On Thu, May 17, 2012 at 9:03 PM, David F. Flanders <
david.flanders at ands.org.au> wrote:

> You might want to check with the #geocrimedata project team at Leeds uni?
> /dff
> On May 18, 2012 3:44 AM, "JO" <distant.fading.star at gmail.com> wrote:
>
>> Hello,
>>
>> I'm trying to map some statistics about police forces in England &
>> Galles.
>>
>> I have a list consisting of all the police forces, for instance:
>>
>>  Avon and SomersetBedfordshire CambridgeshireCheshire City of London
>> Cleveland CumbriaDerbyshire Devon and Cornwall
>> ...
>>
>> Do you know where I can find klm data to map on Google Maps or
>> OpenStreetMaps those areas?
>>
>> Any suggestion would be welcome.
>> Cheers,
>>
>> Jack
>>
>> _______________________________________________
>> data-driven-journalism mailing list
>> data-driven-journalism at lists.okfn.org
>> http://lists.okfn.org/mailman/listinfo/data-driven-journalism
>>
>>
> _______________________________________________
> data-driven-journalism mailing list
> data-driven-journalism at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/data-driven-journalism
>
>


-- 
pallih at kaninka.net
http://gogn.in
http://twitter.com/pallih
http://is.linkedin.com/in/pallih

My email load: http://courteous.ly/KbEbzo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/data-driven-journalism/attachments/20120518/d19e9458/attachment-0001.html>


More information about the data-driven-journalism mailing list