ST_X(geomout) As lon, \r
ST_Y(geomout) As lat, (addy).* \r
FROM geocode('1731 New Hampshire Avenue Northwest, Washington, DC 20010') As g;\r
+\r
+Steps to upgrade your install:\r
+If you need to upgrade the geocoder -- run the create_geocode.sql. \r
+CAUTION: The upgrade script will drop any table columns that have a norm_addy type for a column type. This is rarely if ever done so you should be fine.\r
+We plan to fix this later.
\ No newline at end of file
SET search_path TO tiger,public;
BEGIN;
-- Type used to pass around a normalized address between functions
+-- This is s bit dangerous since it could potentially drop peoples tables
+-- TODO: put in logic to check if any tables have norm_addy and don't drop if they do
DROP TYPE IF EXISTS norm_addy CASCADE;
CREATE TYPE norm_addy AS (
address INTEGER,
RETURN;
END;
-$_$ LANGUAGE plpgsql;
+$_$ LANGUAGE plpgsql STABLE;
CREATE OR REPLACE FUNCTION geocode(
RETURN;
END;
-$_$ LANGUAGE plpgsql;
+$_$ LANGUAGE plpgsql STABLE
+ COST 1000;
RETURN;
END;
$$
- LANGUAGE 'plpgsql' VOLATILE;
+ LANGUAGE 'plpgsql' STABLE COST 1000;
RETURN;
END;
-$_$ LANGUAGE plpgsql;
+$_$ LANGUAGE plpgsql STABLE COST 100;
-- The address is not within the range
RETURN FALSE;
END;
-$_$ LANGUAGE plpgsql;
+$_$ LANGUAGE plpgsql IMMUTABLE COST 100;
result = interpolate_from_address(given_address, addr1, addr2, road);
RETURN result;
END
-$_$ LANGUAGE plpgsql;
+$_$ LANGUAGE plpgsql IMMUTABLE COST 100;
-- interpolate_from_address(local_address, from_address_l, to_address_l, from_address_r, to_address_r, local_road)
-- This function returns a point along the given geometry (must be linestring)
result = ST_Line_Interpolate_Point(road, part);
RETURN result;
END;
-$_$ LANGUAGE plpgsql;
+$_$ LANGUAGE plpgsql IMMUTABLE COST 100;
directionWeight;
return result;
END;
-$_$ LANGUAGE plpgsql;
+$_$ LANGUAGE plpgsql STABLE COST 10;