Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ejercicio: contar población alrededor de estaciones de metro #2

Open
plablo09 opened this issue Feb 22, 2021 · 0 comments
Open

Ejercicio: contar población alrededor de estaciones de metro #2

plablo09 opened this issue Feb 22, 2021 · 0 comments

Comments

@plablo09
Copy link
Member

select geo_estacion_metro.*, agg_pob.poblacion
from geo_estacion_metro
join
	(select id_metro, nombreesta, sum("POB1") as poblacion
	from
		(select m.id as id_manzana, m."POB1", buffer.id as id_metro, buffer.nombreesta
			from manzanas_zmv as m
			join (select id, nombreesta, st_buffer(geom, 500) as geom
			from geo_estacion_metro) as buffer
			on st_intersects(m.geom, buffer.geom)) as pob_metro
	group by id_metro, nombreesta) as agg_pob
on geo_estacion_metro.id = agg_pob.id_metro
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant