diff --git a/cartoDB_functions/insert_function.sql b/cartoDB_functions/insert_function.sql index d77c2ed..7b75934 100644 --- a/cartoDB_functions/insert_function.sql +++ b/cartoDB_functions/insert_function.sql @@ -3,26 +3,26 @@ DROP FUNCTION IF EXISTS insert_bikeways_data(text,text,text,text); CREATE OR REPLACE FUNCTION insert_bikeways_data ( _geojson TEXT, - _notes TEXT, + _description TEXT, _name TEXT, _zip TEXT) --Has to return something in order to be used in a "SELECT" statement RETURNS integer AS $$ -DECLARE +DECLARE _the_geom GEOMETRY; BEGIN - --Convert the GeoJSON to a geometry type for insertion. - _the_geom := ST_SetSRID(ST_GeomFromGeoJSON(_geojson),4326); + --Convert the GeoJSON to a geometry type for insertion. + _the_geom := ST_SetSRID(ST_GeomFromGeoJSON(_geojson),4326); - EXECUTE ' INSERT INTO bikeways (the_geom, notes, name, zipcode) + EXECUTE ' INSERT INTO bikeways (the_geom, description, name, zipcode) VALUES ($1, $2, $3, $4) - ' USING _the_geom, _notes, _name, _zip; - + ' USING _the_geom, _description, _name, _zip; + RETURN 1; END; $$ LANGUAGE plpgsql SECURITY DEFINER ; --Grant access to the public user -GRANT EXECUTE ON FUNCTION insert_bikeways_data(text,text,text,text) TO publicuser; \ No newline at end of file +GRANT EXECUTE ON FUNCTION insert_bikeways_data(text,text,text,text) TO publicuser; diff --git a/index.html b/index.html index 045d050..70c55a2 100644 --- a/index.html +++ b/index.html @@ -11,13 +11,13 @@ - - + + - - + + @@ -25,23 +25,23 @@ - + - + - +