PyCon 2014

Procesando información geográfica con Python

Mele Sax-Barnett  · 




Extracto de la transcripción automática del vídeo realizada por YouTube.

so this would be last talk for the day it's going to be a talk called Python plus Geographic data equals two BFFs please give a hand for melee sex Ben Barnett there is the fabulous bitly link to my talk including everything that I'm not going to have

time to say in markdown format so there's that for your reference thank you for hanging out till the end of the day I'm really excited to share this with you so why do I think Python and geographic data are going to be best friends forever well I love

maps but making them can be a real pain and the reason is well cartographers don't just trace stuff anymore you have to deal with the data and that can be really really really awful it is usually not in the format that you need there's like a hundred

different formats at least several obvious errors everyone with some bad data has created their own null island at some point split up into 50 different files and is definitely in the wrong protection so um sometimes you even have no metadata so you don't

know what projection it's in what encoding it's in it can be pretty awful so you can point and click all day in your out-of-the-box GIS software or you can bring Python into the mix so a little bit about vector geo data before we get started it can

be made up of one or several files it will have a coordinate system or projection associated with it to show how the round earth ends up on a flat surface it can be made up of one or several layers of data each of which has one or more features and each feature

has to have geometries and that includes both a type so whether it's a point line polygon and of course its coordinates themselves and then each feature also has various other attributes and properties these vary widely depending on the data so now we're

going to talk about some of my favorite Python packages to use to deal with this problem fiona is the first one that I really like and what can be really awesome when you're making a map there's great Free data all over the place natural earth is a

great place to get um simplified world data countries nice nice Carta graphically lined up and a lot of interesting attributes but it's usually not in a format that I like so let's say we want to change it to geo JSON so after you download your data

you just create a really short script and with Fiona you can open it up it automatically figures out what it needs in the open part but then when you open up your output file you need to tell it okay which coordinate system am I going to use what's the

schema so that includes the geometry and the attributes and what do you want to turn it into so here we're saying we just want to use the same as the input for the coordinate system and the schema and but we want to change it to geo JSON and then for each

feature in that original file we go through it one by one and say okay as long as it's not Antarctica let's keep it um and you can also filter by bounding box so if you want the eastern hemisphere western hemisphere a much smaller bigger than that

you can do that really easily with Fiona as well yay data another great Python package is pipe Raj so say you um projections can be a problem that last one actually not super pretty especially at the top and the bottom of the of the poles there um if you're

tracing great circle routes if you are making a map of the poles you definitely need to use an appropriate projection pipe raj works really well with Fiona to do that so in this example we are going to go ahead and pull in the schema from the original file

[ ... ]

Nota: se han omitido las otras 1.701 palabras de la transcripción completa para cumplir con las normas de «uso razonable» de YouTube.