Im new at coding with SQL, specially with pgAdmin, right now i downloaded data form OpenStreetMap, and im trying to build questionnaires for the creation and visualization of isochrons in the road network, in intervals between : 2,5,10,15 minutes, if the spped of driving is 40 km/h. After I looked in internet i found some tutorials and here is my code, but I have some problems, if someone has already done a coding like this or can help me, it would a pleasure.
CREATE TABLE dd_caserne AS
SELECT di.seq As id,
di.node , di.edge ,
di.agg_cost As time_access
, v.the_geom As geom
FROM pgr_drivingDistance('select gid as id, source, target,cost_s as cost, reverse_cost_s as reverse_cost from osmpgr.ways', 36, 32, true
) AS di INNER JOIN osmpgr.ways_vertices_pgr
AS v ON di.node = v.id;
select * from dd_caserne
SELECT 1 As id, ST_SetSRID (pgr_pointsAsPolygon(
SELECT di.seq AS id, ST_X
(v.the_geom) AS x, ST_Y (v.the_geom) As y
FROM pgr_drivingDistance(SELECT gid As id, source, target,
cost_s AS cost,reverse_cost_s AS reverse_cost
FROM osmpgr.ways », 36, 300, true
) AS di INNER JOIN osmpgr.ways_vertices_pgr AS v ON di.node= v.id $$
), 4326) As geom;
SELECT i As time_access,
ST_SetSRID(pgr_pointsAsPolygon(
‘SELECT id::integer,ST_X(geom)::float AS x,ST_Y(geom)::float As y
FROM dd_caserne
WHERE access_time <= ‘|| i :: text), 4326) As geom
FROM generate_series(60,300)
As i
ORDER BY i DESC;