Datos obtenidos del portal de datos abiertos del gobierno de España.
Created
January 5, 2017 10:23
-
-
Save ramiroaznar/6250dae6487d215aa7de7a836d163bdf to your computer and use it in GitHub Desktop.
Obtener geometrías de los datos brutos de datos.gob.es
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Cáceres | |
update arboles_caceres | |
set the_geom = cdb_latlng(geo_lat, geo_long); | |
# Valencia | |
update arboles_valencia | |
set the_geom = ST_Transform(ST_SetSrid(ST_MakePoint(x, y), 32630), 4326) | |
# Castilla y León | |
with a as( | |
select | |
cartodb_id, | |
arbol_geometria, | |
(trim(both '(' from (string_to_array(arbol_geometria, ' '))[2]))::numeric as x, | |
(trim(both ')' from (string_to_array(arbol_geometria, ' '))[3]))::numeric as y | |
from arboles_cyl | |
) | |
update arboles_cyl b | |
set x = a.x --- y = a.y | |
from a | |
where b.cartodb_id = a.cartodb_id | |
update arboles_cyl | |
set the_geom = ST_Transform(ST_SetSrid(ST_MakePoint(x, y), 32630), 4326) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment