SQL - Dos funciones en una

 
Vista:
sin imagen de perfil

Dos funciones en una

Publicado por Rafael Patricio (1 intervención) el 30/12/2014 11:17:44
Saludos.Soy nuevo tanto en el foro como en programación en SQL y llevo bastante tiempo intentando integrar dos funciones de Postgis para que se ejecuten como una sola función,son las siguientes:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
1.**pgr_drivingdistance:**
 
    SELECT id, id1 AS node, id2 AS edge, cost, the_geom
    INTO "20_10min_nodes"
      FROM pgr_drivingdistance(
        'SELECT id, source, target, time_min as cost FROM roads',
        9798, 10, false, false
      ) as di
      JOIN vertices_tmp pt
      ON di.id1 = pt.id;
 
2.**pgr_alphAShape**
 
    CREATE TABLE "20_10min_alpha" AS
    SELECT ST_MakePolygon(ST_AddPoint(foo.openline, ST_StartPoint(foo.openline)))::geometry, 2 as alphaPoly
    from (select st_makeline(points order by id)  as openline from
    (SELECT st_makepoint(x,y) as points ,row_number() over() AS id
    FROM pgr_alphAShape('SELECT id::integer, st_x(the_geom)::float as x, st_y(the_geom)::float as y  FROM "20_10min_nodes"')
    ) as a) as foo;
¿Como podría realizar dicha consulta?.
Gracias.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder