Commit graph

20 commits

Author SHA1 Message Date
Matt Amos
ced8ac86ab Remove need for shared library PostgreSQL functions
This repo contains code for three functions to be loaded into PostgreSQL as a shared library:

1. `maptile_for_point`, which is used only by the `/changes` API call. This API call is little-used and IMHO should be deprecated and removed. However, even now it's hardly on the hot path for most development activities.
2. `tile_for_point`, which is used only in migrations. At this point, it seems unlikely that anyone will be doing a migration on existing data which would call this function (most developers will be running migrations on an empty database, to set it up).
3. `xid_to_int4`, which is only used for replication using Osmosis and isn't used in the Rails code at all. Hopefully this will be replaced Real Soon Now, but until then it's a quite advanced feature that most developers won't need.

Therefore, this patch proposes to replace the above three shared library functions with SQL implementations of the first two. These are _much_ slower - by a factor of about 30x, however this makes no difference when they're run on a completely empty database. In return, we're able to drop a dependency on the PostgreSQL server development package, and clean a few lines out of the installation instructions.

It's still possible to make and install the shared library functions, and I've included instructions about how to do that - although it shouldn't be necessary for the vast majority of `openstreetmap-website` developers.
2019-10-04 13:25:00 +01:00
Andy Allan
8db7f5aeac Alter the Makefile to be robust against bundler warnings
In bundle < 2.0, warnings are printed to stdout, along with the path information
that we need. This takes the final line of the output and assumes it's the path.

Fixes #1930
2018-08-29 12:36:31 +08:00
Benjamin Reynolds
d5672aed4a Remove quad_tile library and extract to gem
Quad tile functions are now installed via a gem with native extension
automatically. This improves the run time of the test suite by ~30% for
users that didn't bother to build the C version of the functions.

Closes #1314
Closes #1899
2018-06-14 18:29:37 +01:00
Tom Hughes
cb0c185ce6 Update xid_to_int4 to use postgres version 1 calling convention 2018-04-28 15:16:46 +01:00
Tom Hughes
2e2b33ea61 Link all objects into libpgosm.so 2016-07-27 20:51:32 +01:00
Tom Hughes
cfd55f0c7d Allow multiple versions of DB functions to be built
Allows the pg_config location to be configured, along with
the target directory for the built code.
2016-07-27 20:44:16 +01:00
Tom Hughes
beb0ef6357 Stop pretending we support MySQL 2012-02-08 14:08:49 +00:00
Grant Slater
60fc060d27 DB Function add standard pgsql include dir too 2010-11-12 15:31:44 +00:00
Tom Hughes
e3fc033c1e Ignore some more generated files 2010-04-20 21:41:57 +01:00
Tom Hughes
7b632da44a Add xid_to_int4() function for Postgres. 2009-09-07 16:44:54 +00:00
Tom Hughes
55b1ba32e5 Add postgres implementation of tile_for_point function. 2009-05-08 08:01:33 +00:00
Tom Hughes
ea7938dd89 Use pg_config to find postgres. 2009-04-09 14:47:41 +00:00
Daniel Silverstone
509b8d5207 CREATE FUNCTION statement for pgsql 2008-11-08 19:21:03 +00:00
Daniel Silverstone
ee656dd1f3 Support building a postgresql binding for maptile_for_point 2008-11-08 19:18:22 +00:00
Tom Hughes
250466e58e Add a maptile_for_point() function for MySQL to work out which slippy
map tile a given point lies in.
2007-10-09 22:59:32 +00:00
Richard Fairhurst
09ccace450 OS X-compatible makefile supplied by agnat 2007-10-07 11:15:09 +00:00
Tom Hughes
dd9ad16303 Document installation of database functions on MacOS X. 2007-09-28 14:57:31 +00:00
Tom Hughes
9afb35449b Change the gps_points table to store latitude and longitude values to
seven decimal places to given a worse case precision of about 1cm.
2007-09-18 23:29:47 +00:00
Tom Hughes
b1a0e5ae8b Make the MySQL tile_for_point function take arguments in the same order
as the ruby version.
2007-09-12 17:46:03 +00:00
Tom Hughes
33a65a90c9 QuadTile infrastructure. 2007-09-11 23:55:25 +00:00