In [1]:
import pandas as pd


class GeoDataCensal(object):
    """GeoData of the censo information. There is information of the codes,
    names, censo and geometry.

    """

    def __init__(self, data_censal, var_hierarchy):
        self._check_inputs(data_censal, var_hierarchy)
        self.data_censal = data_censal
        self.var_hierarchy = var_hierarchy
        self.levels = len(var_hierarchy['codes'])

    def _check_inputs(self, data_censal, var_hierarchy):
        assert('geometry' in var_hierarchy)
        assert('codes' in var_hierarchy)
        assert('names' in var_hierarchy)
        assert('censo' in var_hierarchy)
        assert(isinstance(var_hierarchy['geometry'], str))
        assert(isinstance(var_hierarchy['codes'], list))
        assert(isinstance(var_hierarchy['names'], list))
        assert(isinstance(var_hierarchy['censo'], list))
        assert(len(var_hierarchy['codes']) == len(var_hierarchy['names']))

    def _get_columns_level(self, level, outer=False):
        outer_cols = []
        if outer:
            outer_cols = self.outer_cols
        geo_cols = [self.var_hierarchy['geometry']]
        if level == 0:
            columns = outer_cols+geo_cols
        elif level > self.levels or level < 0:
            msg = "Not correct 'level' input."
            raise IndexError(msg)
        else:
            names_cols = self.var_hierarchy['names'][self.levels-level:]
            codes_cols = self.var_hierarchy['codes'][self.levels-level:]
            columns = list(set(outer_cols+names_cols+codes_cols+geo_cols))
        return columns

    def _filter4level(self, level, outer=False):
        return self.data_censal[self._get_columns_level(level, outer)]

    @classmethod
    def _data_reduction(cls, data_censo, var_hierarchy):
        return cls(data_censo, var_hierarchy)

    @property
    def inner_cols(self):
        inner_cols = [var_hierarchy['geometry']]
        inner_cols += var_hierarchy['codes']
        inner_cols += var_hierarchy['names']
        inner_cols += var_hierarchy['censo']
        inner_cols = list(set(inner_cols))
        return inner_cols

    @property
    def outer_cols(self):
        outer_cols = [col for col in self.data_censal
                      if col not in self.inner_cols]
        return outer_cols

    def _filter_censo_by_level(self, level, outer=False):
        data_censo = self._filter4level(level, outer)
        pivot_lvl_col = self.var_hierarchy['codes'][self.levels-level]
        data = data_censo.dissolve(by=pivot_lvl_col).reset_index(level=0)
        if self.var_hierarchy['censo']:
            data_censal = self.data_censal[[pivot_lvl_col]]
            vars_censo = self.var_hierarchy['censo']
            data_censal[vars_censo] = self.data_censal[vars_censo]
            data_cns = data_censal.dissolve(by=pivot_lvl_col,
                                            aggfunc="sum")
            data_cns = data_cns.reset_index(level=0)
            data = pd.merge(data, data_cns, on=pivot_lvl_col)
        return data

    def _filter_hierharchy_by_level(self, level):
        var_hierarchy = {}
        var_hierarchy['geometry'] = self.var_hierarchy['geometry']
        var_hierarchy['censo'] = self.var_hierarchy['censo']
        pivot_lvl = self.levels-level
        var_hierarchy['codes'] = self.var_hierarchy['codes'][pivot_lvl:]
        var_hierarchy['names'] = self.var_hierarchy['names'][pivot_lvl:]
        return var_hierarchy

    def filter_data_by_level(self, level, outer=False, raw=False):
        data_censo = self._filter_censo_by_level(level, outer)
        var_hierarchy = self._filter_hierharchy_by_level(level)
        if raw:
            return data_censo, var_hierarchy
        else:
            return self._data_reduction(data_censo, var_hierarchy)


class Votations(object):
    """Votations data. The data of the results of votes by party in columns.
    Each columns has a party and some codes. The result is the votes.

    """

    def __init__(self, votes, var_info, collapse_ways):
        self._check_inputs(votes, var_info, collapse_ways)
        self.collapses = collapse_ways
        self.var_info = var_info
        self.votes = votes

    def _check_inputs(self, votes, var_info, collapse_ways):
        assert('codes' in var_info)
        assert('parties' in var_info)
        assert(isinstance(var_info['parties'], list))
        assert(isinstance(var_info['codes'], list))
        assert(isinstance(collapse_ways, dict))
        for w, ps in collapse_ways.items():
            assert(all([p in var_info['parties'] for p in ps]))

    def get_results(self, code, collapse_way=None):
        if collapse_way is None:
            collapsing = dict(zip(self.var_info['parties'],
                                  self.var_info['parties']))
        else:
            collapsing = self.collapses[collapse_way]
        votes_collapse = self.votes[[code]]
        for group, parties in collapsing.items():
            votes_collapse[group] = self.votes[parties].sum(1)
        votes = votes_collapse.dissolve(by=code, aggfunc='sum')
        votes = votes.reset_index(level=0)
        return votes

In [2]:
import os
import numpy as np
import pandas as pd
import geopandas as gpd
import folium

import matplotlib
%matplotlib inline

In [3]:
from splitters import Splitters
from parsing_utils import parse_eleccions_2015_csv, collapse_votes, collapse_info_mesas, left_filter_function

In [4]:
file_geojson = '/home/tono/code/Eleccions2017Cat/data/trio_llobregat_2015.geojson'
data_censo = gpd.read_file(file_geojson)

In [5]:
votos_2015_file = '/home/tono/code/Eleccions2017Cat/data/A20151_ME/Columnes_A20151_ME_ca_ES.csv'
data_info2015, votos2015 = parse_eleccions_2015_csv(votos_2015_file)

In [6]:
votos2015 = collapse_votes(votos2015)
data_info2015 = collapse_info_mesas(data_info2015)

In [7]:
data_info2015.columns


Out[7]:
Index([u'CUSEC', u'Codi Prov�ncia', u'Nom Prov�ncia', u'Codi Vegueria',
       u'Nom Vegueria', u'Codi Comarca', u'Nom Comarca', u'Codi Municipi',
       u'Nom Municipi', u'Districte', u'Secci�', u'Cens electoral',
       u'Participaci� 13:00', u'Participaci� 18.00', u'Participaci� 20.00',
       u'Abstenci�', u'Vots nuls', u'Vots en blanc', u'Vots a candidatures',
       u'Vots v�lids'],
      dtype='object')

In [8]:
trio_cities = ["Cornell\xe0 de Llobregat", "Esplugues de Llobregat",
               "Hospitalet de Llobregat, l'"]
codes_trio = {'Cornella': '08073',
              'Esplugues': '08077',
              'Hospitalet': '08101'}
def cmun_filter(data, cumuns):
    return data.loc[data.CUSEC.apply(lambda x: x[:5] in cumuns)]
trio_data_info2015 = cmun_filter(data_info2015, codes_trio.values())
trio_votos2015 = cmun_filter(votos2015, codes_trio.values())

Check not concident keys


In [9]:
votos2015_trio_ll, codes_not_in_censo, codes_not_votos2015 =\
    left_filter_function(data_censo, trio_votos2015, filter_code='CUSEC')

codes_not_in_censo, codes_not_votos2015


parsing_utils.py:82: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
  to_filter_data[filter_code] = to_filter_data[filter_code].apply(to_str)
Out[9]:
(set(), set())

In [10]:
trio_data_info2015.loc[trio_data_info2015.CUSEC.apply(lambda x: x in ['0810103026', '0810103027']), :]


Out[10]:
CUSEC Codi Prov�ncia Nom Prov�ncia Codi Vegueria Nom Vegueria Codi Comarca Nom Comarca Codi Municipi Nom Municipi Districte Secci� Cens electoral Participaci� 13:00 Participaci� 18.00 Participaci� 20.00 Abstenci� Vots nuls Vots en blanc Vots a candidatures Vots v�lids
1752 0810103026 8 Barcelona 1 Barcelona 13 Barcelon�s 8101 Hospitalet de Llobregat, l' 3 26 663 220 426 543 120 1 2 540 542
1753 0810103027 8 Barcelona 1 Barcelona 13 Barcelon�s 8101 Hospitalet de Llobregat, l' 3 27 902 266 574 732 170 2 1 729 730

Manual checking data


In [75]:
lh_territories = data_info2015.iloc[:, 7].apply(lambda x: x in [trio_cities[2]])
codes_data_info = data_info2015.iloc[np.where(lh_territories)[0], [0, 2, 4, 6, 8, 9, 10, 20]]
data_filtered = codes_data_info.groupby(by='CUSEC').first()
postfilter = data_filtered['Districte'].apply(lambda x: x == 2)
len(data_filtered.iloc[np.where(postfilter)[0], :-1])


Out[75]:
37

In [123]:
lh_territories = data_censo['CUMUN'].apply(lambda x: x in [codes_trio['Hospitalet']])
geos_data = data_censo.loc[lh_territories, :]
postfilter = geos_data['CDIS'].apply(lambda x: x == '03')
geos_data.iloc[np.where(postfilter)[0], :-1]


Out[123]:
OBJECTID CUSEC CUMUN CSEC CDIS CMUN CPRO CCA CUDIS OBS ... CNUT1 CNUT2 CNUT3 CLAU2 NPRO NCA NMUN Shape_Leng Shape_area Shape_len
188 5468 0810103001 08101 001 03 101 08 09 0810103 ... 5 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 2123.890820 233567.718319 2123.890820
189 5469 0810103002 08101 002 03 101 08 09 0810103 ... 5 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 833.710360 35996.566769 833.710360
190 5470 0810103003 08101 003 03 101 08 09 0810103 ... 5 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 610.232224 21545.110651 610.232224
191 5471 0810103004 08101 004 03 101 08 09 0810103 ... 5 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 1802.861597 151432.401799 1802.861597
192 5472 0810103005 08101 005 03 101 08 09 0810103 ... 5 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 1024.749970 40664.451741 1024.749970
193 5473 0810103006 08101 006 03 101 08 09 0810103 ... 5 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 1035.388672 43244.099506 1035.388672
194 5474 0810103007 08101 007 03 101 08 09 0810103 ... 5 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 543.880699 18468.786956 543.880699
195 5475 0810103008 08101 008 03 101 08 09 0810103 ... 5 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 1115.305583 65292.507486 1115.305583
196 5476 0810103009 08101 009 03 101 08 09 0810103 ... 5 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 919.712402 39517.730602 919.712402
197 5477 0810103010 08101 010 03 101 08 09 0810103 ... 5 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 504.786206 15370.295343 504.786206
198 5478 0810103011 08101 011 03 101 08 09 0810103 ... 5 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 1033.521147 24979.467858 1033.521147
199 5479 0810103012 08101 012 03 101 08 09 0810103 ... 5 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 912.163598 48383.942635 912.163598
200 5480 0810103013 08101 013 03 101 08 09 0810103 ... 5 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 1326.576905 57562.768063 1326.576905
201 5481 0810103014 08101 014 03 101 08 09 0810103 ... 5 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 1061.157893 45949.590972 1061.157893
202 5482 0810103015 08101 015 03 101 08 09 0810103 ... 5 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 1046.208852 45640.896630 1046.208852
203 5483 0810103016 08101 016 03 101 08 09 0810103 ... 5 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 1356.737957 113246.660063 1356.737957
204 5484 0810103017 08101 017 03 101 08 09 0810103 ... 5 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 529.655587 15646.693621 529.655587
205 5485 0810103018 08101 018 03 101 08 09 0810103 ... 5 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 961.853242 43590.265904 961.853242
206 5486 0810103019 08101 019 03 101 08 09 0810103 ... 5 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 1017.705873 58164.603286 1017.705873
207 5487 0810103020 08101 020 03 101 08 09 0810103 ... 5 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 886.459972 42433.660350 886.459972
208 5488 0810103021 08101 021 03 101 08 09 0810103 ... 5 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 747.448059 28130.035120 747.448059
209 5489 0810103022 08101 022 03 101 08 09 0810103 ... 5 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 683.869802 18959.425685 683.869802
210 5490 0810103023 08101 023 03 101 08 09 0810103 ... 5 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 1228.279958 77602.416086 1228.279958
211 5491 0810103024 08101 024 03 101 08 09 0810103 ... 5 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 677.843717 16294.188666 677.843717
212 5492 0810103025 08101 025 03 101 08 09 0810103 ... 5 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 745.823732 33192.497465 745.823732

25 rows × 21 columns

Mapping


In [11]:
d = trio_votos2015.iloc[:, [5, 8]].sum(1)/trio_votos2015.iloc[:, 1:].sum(1)
proind = pd.DataFrame(d, columns=['ProInd'])
proind = pd.concat([trio_votos2015['CUSEC'], proind], axis=1)

In [12]:
def choropleth_map(center_loc, zoom_start, file_geojson, results, key_on, key_data):
    m = folium.Map(center_loc, tiles='cartodbpositron',
                   zoom_start=zoom_start)
    columns = [key_on, key_data]
    key_on_v = 'feature.properties.' + key_on
    m.choropleth(
        geo_data=file_geojson,
        data=results,
        columns=columns,
        key_on=key_on_v,
        fill_color='YlGn',
        highlight=True,
        )
    return m

choropleth_map([41.37, 2.1], 13, file_geojson, proind, 'CUSEC', 'ProInd')


Out[12]:

In [ ]:


In [13]:
import seaborn as sns
import matplotlib


def results_map(center_loc, zoom_start, geodata, results, key_on, key_data):
    m = folium.Map(center_loc, tiles='cartodbpositron',
                   zoom_start=zoom_start)

    n_splits = 10
    par_splits = {'n_splits': n_splits, 'limits': (0, 1),
                  'open_limits': False, 'reverse': False}
    splitter = Splitters('equispaced_splitters', par_splits,
                         ranges=list(range(n_splits)))
    colors = sns.color_palette('RdYlGn', n_splits)

    def color_map(x):
        return matplotlib.colors.rgb2hex(colors[splitter(x)])

    def create_function_style(features):
        style_function = lambda x: {'fillColor': color_map(features),
                                    'fillOpacity': 0.4,
                                    'color': 'black',
                                    'weight': 0.5,
                                    'opacity': 1}
        return style_function


    highlight_function = lambda x: {'weight': 1.5,
                                    'fillOpacity': 0.75}

    for i in range(len(data_censo)):
        geodata_i = geodata.iloc[[i], :]
        key_on_i = geodata_i[key_on].ravel()[0]
        idxs = np.where(results[key_on].apply(lambda x: x == key_on_i))[0]
        if not len(idxs):
            continue
        idx_key = idxs[0]
        style_function = create_function_style(results.iloc[idx_key, :][key_data])
        geo_cens = folium.folium.GeoJson(geodata_i,
                                         style_function=style_function,
                                         highlight_function=highlight_function,
                                         overlay=True,
                                         control=False)
        geo_cens.add_child(folium.features.Popup(key_on_i))
        geo_cens.add_to(m, geodata.iloc[i, :][key_on])
    return m

results_map([41.37, 2.1], 13, data_censo, proind, 'CUSEC', 'ProInd')


Out[13]:

In [ ]:


In [157]:
np.where(proind.CUSEC.apply(lambda x: x == data_censo.CUSEC.iloc[324]))[0]


Out[157]:
array([285])

In [162]:
geodata_i = data_censo.iloc[[0], :]
key_on_i = geodata_i['CUSEC']

In [7]:
data_censo


Out[7]:
OBJECTID CUSEC CUMUN CSEC CDIS CMUN CPRO CCA CUDIS OBS ... CNUT2 CNUT3 CLAU2 NPRO NCA NMUN Shape_Leng Shape_area Shape_len geometry
0 5155 0807301001 08073 001 01 073 08 09 0807301 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 1352.569111 9.218862e+04 1352.569111 POLYGON ((2.07086332857145 41.35740405853809, ...
1 5156 0807301002 08073 002 01 073 08 09 0807301 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 1009.427596 5.111587e+04 1009.427596 POLYGON ((2.070671819595459 41.35602864763179,...
2 5157 0807301003 08073 003 01 073 08 09 0807301 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 690.436732 2.965648e+04 690.436732 POLYGON ((2.077546728450129 41.35071454754457,...
3 5158 0807301004 08073 004 01 073 08 09 0807301 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 5437.460220 9.279912e+05 5437.460220 POLYGON ((2.049558400975442 41.34744746709448,...
4 5159 0807301005 08073 005 01 073 08 09 0807301 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 923.226121 3.932151e+04 923.226121 POLYGON ((2.076844113283871 41.35191659116927,...
5 5160 0807301006 08073 006 01 073 08 09 0807301 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 757.690417 3.313607e+04 757.690417 POLYGON ((2.072357123758789 41.35348683736885,...
6 5161 0807301007 08073 007 01 073 08 09 0807301 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 1142.524590 7.279121e+04 1142.524590 POLYGON ((2.071632524362656 41.35349974731189,...
7 5162 0807301008 08073 008 01 073 08 09 0807301 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 2242.279095 2.072551e+05 2242.279095 POLYGON ((2.067353723362825 41.35395055034011,...
8 5163 0807301009 08073 009 01 073 08 09 0807301 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 950.901553 3.603848e+04 950.901554 POLYGON ((2.073513537376484 41.35354297793097,...
9 5164 0807301010 08073 010 01 073 08 09 0807301 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 881.616266 3.625071e+04 881.616266 POLYGON ((2.076351447228844 41.35300580311168,...
10 5165 0807301011 08073 011 01 073 08 09 0807301 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 699.643701 2.406704e+04 699.643701 POLYGON ((2.075231238184402 41.3502418834029, ...
11 5166 0807301012 08073 012 01 073 08 09 0807301 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 1115.859081 4.642297e+04 1115.859081 POLYGON ((2.078138395536048 41.34948543969318,...
12 5167 0807301013 08073 013 01 073 08 09 0807301 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 1244.589282 5.720561e+04 1244.589282 POLYGON ((2.070673220012849 41.35183742555718,...
13 5168 0807301014 08073 014 01 073 08 09 0807301 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 775.204282 3.253570e+04 775.204282 POLYGON ((2.068555991335256 41.3545286687766, ...
14 5169 0807302001 08073 001 02 073 08 09 0807302 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 5163.632886 1.117997e+06 5163.632886 POLYGON ((2.093625220364088 41.3586287235924, ...
15 5170 0807302002 08073 002 02 073 08 09 0807302 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 6286.749505 1.421351e+06 6286.749505 POLYGON ((2.098414563671479 41.35412837797859,...
16 5171 0807303001 08073 001 03 073 08 09 0807303 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 1572.206630 1.258803e+05 1572.206630 POLYGON ((2.07611255018573 41.36475331743631, ...
17 5172 0807303002 08073 002 03 073 08 09 0807303 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 781.611223 2.035222e+04 781.611223 POLYGON ((2.074202166513067 41.36662283360337,...
18 5173 0807303003 08073 003 03 073 08 09 0807303 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 773.066845 2.691096e+04 773.066845 POLYGON ((2.073464007875069 41.36483626387965,...
19 5174 0807303004 08073 004 03 073 08 09 0807303 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 2901.574424 3.437739e+05 2901.574424 POLYGON ((2.061162516025689 41.36492135114345,...
20 5175 0807303005 08073 005 03 073 08 09 0807303 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 2633.454303 3.385337e+05 2633.454303 POLYGON ((2.070008926135653 41.36477759382425,...
21 5176 0807303006 08073 006 03 073 08 09 0807303 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 710.864416 3.145151e+04 710.864416 POLYGON ((2.07603263954863 41.36467196132006, ...
22 5177 0807303007 08073 007 03 073 08 09 0807303 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 928.307217 3.254974e+04 928.307217 POLYGON ((2.074968018258001 41.36358917264499,...
23 5178 0807303008 08073 008 03 073 08 09 0807303 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 3901.883428 4.817059e+05 3901.883428 POLYGON ((2.063546649405958 41.35903638480863,...
24 5179 0807303009 08073 009 03 073 08 09 0807303 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 978.800293 3.968426e+04 978.800293 POLYGON ((2.059556796436511 41.35907671405715,...
25 5180 0807304001 08073 001 04 073 08 09 0807304 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 901.157225 3.826915e+04 901.157225 POLYGON ((2.074017914747701 41.35884374941005,...
26 5181 0807304002 08073 002 04 073 08 09 0807304 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 715.013054 1.744408e+04 715.013054 POLYGON ((2.07694456943873 41.35708127848684, ...
27 5182 0807304003 08073 003 04 073 08 09 0807304 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 772.422503 3.520813e+04 772.422503 POLYGON ((2.073510737054216 41.36047889484263,...
28 5183 0807304004 08073 004 04 073 08 09 0807304 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 1452.359958 4.351384e+04 1452.359958 POLYGON ((2.080737635651198 41.35739498245629,...
29 5184 0807304005 08073 005 04 073 08 09 0807304 ... 1 1 08073 Barcelona Catalua Cornell de Llobregat 563.138566 1.841966e+04 563.138566 POLYGON ((2.080048319263547 41.35832426126629,...
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
295 5575 0810106003 08101 003 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 465.907130 1.222302e+04 465.907130 POLYGON ((2.107346478362054 41.35299296880945,...
296 5576 0810106004 08101 004 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 396.592428 9.320394e+03 396.592428 POLYGON ((2.10749779200804 41.34928961216207, ...
297 5577 0810106005 08101 005 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 463.988312 3.724479e+03 463.988312 POLYGON ((2.109295564176914 41.35195179616392,...
298 5578 0810106006 08101 006 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 489.033456 1.429594e+04 489.033456 POLYGON ((2.108177365059811 41.34770648802841,...
299 5579 0810106007 08101 007 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 625.599616 2.179929e+04 625.599616 POLYGON ((2.109390191493859 41.34787372860216,...
300 5580 0810106008 08101 008 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 773.734189 1.918379e+04 773.734189 POLYGON ((2.116906950356888 41.3518333115553, ...
301 5581 0810106009 08101 009 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 578.463503 1.556329e+04 578.463503 POLYGON ((2.1121606071758 41.35678368835044, 2...
302 5582 0810106010 08101 010 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 775.161620 2.240764e+04 775.161620 POLYGON ((2.115694358677211 41.3550198169447, ...
303 5583 0810106011 08101 011 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 1316.293472 7.186857e+04 1316.293472 POLYGON ((2.115942307489964 41.35669826603879,...
304 5584 0810106012 08101 012 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 591.985358 2.196809e+04 591.985358 POLYGON ((2.115731249011137 41.35532242585489,...
305 5585 0810106013 08101 013 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 608.530782 1.743800e+04 608.530782 POLYGON ((2.115576768962717 41.35405613070908,...
306 5586 0810106014 08101 014 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 1037.075497 4.908920e+04 1037.075497 POLYGON ((2.115341952095644 41.3521170374316, ...
307 5587 0810106015 08101 015 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 899.058499 4.170014e+04 899.058499 POLYGON ((2.114575876857076 41.35080843961178,...
308 5588 0810106016 08101 016 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 8663.704846 2.540967e+06 8663.704846 POLYGON ((2.133252597556686 41.35985738233334,...
309 5589 0810106017 08101 017 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 474.399297 1.150945e+04 474.399297 POLYGON ((2.115526284594824 41.35364240699773,...
310 5590 0810106018 08101 018 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 385.126810 8.786430e+03 385.126810 POLYGON ((2.109157519956944 41.35219010358173,...
311 5591 0810106019 08101 019 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 901.677412 4.862763e+04 901.677412 POLYGON ((2.111164050408914 41.35010261037827,...
312 5592 0810106020 08101 020 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 630.123767 1.990349e+04 630.123767 POLYGON ((2.109694363132621 41.35353451084169,...
313 5593 0810106021 08101 021 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 768.038125 2.529901e+04 768.038125 POLYGON ((2.110529078703358 41.35377572756204,...
314 5594 0810106022 08101 022 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 788.795447 1.891234e+04 788.795447 POLYGON ((2.118425676973036 41.35454631841772,...
315 5595 0810106023 08101 023 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 827.420246 3.450004e+04 827.420246 POLYGON ((2.111416021000836 41.35621617853905,...
316 5596 0810106024 08101 024 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 653.723365 1.984319e+04 653.723365 POLYGON ((2.113550259973175 41.35606702378573,...
317 5597 0810106025 08101 025 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 483.727974 1.420906e+04 483.727974 POLYGON ((2.111410363308776 41.35275964605734,...
318 5598 0810106026 08101 026 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 880.786590 2.655678e+04 880.786590 POLYGON ((2.117658212025399 41.35182031837279,...
319 5599 0810106027 08101 027 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 1268.008353 6.281778e+04 1268.008353 POLYGON ((2.113536213566468 41.35301129383581,...
320 5600 0810106028 08101 028 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 1071.470077 6.349624e+04 1071.470077 POLYGON ((2.110999495684243 41.35050065082766,...
321 5601 0810106029 08101 029 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 760.790096 2.088928e+04 760.790096 POLYGON ((2.117633170576807 41.35397195269742,...
322 5602 0810106030 08101 030 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 602.497575 2.196524e+04 602.497575 POLYGON ((2.112889569395336 41.35435189716479,...
323 5603 0810106031 08101 031 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 575.523324 1.930649e+04 575.523324 POLYGON ((2.113107605274231 41.35047178057036,...
324 5604 0810106032 08101 032 06 101 08 09 0810106 ... 1 1 08101 Barcelona Catalua Hospitalet de Llobregat, L' 1112.678450 5.908244e+04 1112.678450 POLYGON ((2.115942307489964 41.35669826603879,...

325 rows × 22 columns


In [ ]: