The geoshapes service currently runs a transformation every time a client requests geoshapes:
```
SELECT id, ST_AsGeoJSON(ST_Transform(ST_Simplify(geometry, $3*sqrt(ST_Area(ST_Envelope(geometry)))), 4326)) as data
FROM (
SELECT id, ST_Multi(ST_Collect(geometry)) AS geometry
FROM (
SELECT wikidata AS id, (ST_Dump(geometry)).geom AS geometry
FROM $1~
WHERE wikidata IN ($2:csv)
AND GeometryType(geometry) != 'POINT'
) combq
GROUP BY id
) subq
```
This seems like an expensive query, and it might be more efficient to run only once at the time of import. The dynamic granularity "$3" might never be changed from the default in production requests.
* [ ] Profile this transformation to determine the resource demands for these queries, and the data size reduction.
* [ ] Verify that granularity isn't changed in Kartographer requests.
* [ ] Look at the imposm job to see if we can hook into it, either processing rows during or after the synchronization.
* [ ] Write this synchronization simplification
* [ ] Update the service to use the simplified column (maybe overlapping old and new data during the migration period)
* [ ] Fully refresh the master database with simplified data.
* [ ] Drop the old data column.