[Geocoding] Error updating nominatim database "UPDATE failed: ERROR: null value in column "geometry" violates not-null constraint"

Sarah Hoffmann lonvia at denofr.de
Fri Jul 13 21:45:01 BST 2012


Hi Adrian,

On Thu, Jul 12, 2012 at 10:54:28AM +0200, Adrian Chapela wrote:
> Configure date to start update database:
> ./utils/setup.php --osmosis-init --osmosis-init-date 2011-09-28T00:00:00
> 
> Start import new data from date configured:
> ./utils/update.php --import-osmosis-all --no-npi
> 
> The last is failing after a while when is updating 2011-09-28 12:00:00 
> or so..

We've alerady talked a bit about this in the chat. Trying to update
from such a long way back is not a very good idea because updates are
rather slow. You might easily have to wait two or three months to
catch up a year.

> The error I am getting is the next:
> index_placex: UPDATE failed: ERROR:  null value in column "geometry"
> violates not-null constraint
> CONTEXT:  SQL statement "insert into placex (osm_type, osm_id, class,
> type, admin_level, housenumber, street, isin, postcode,
>                   country_code, parent_place_id, rank_address,
> rank_search, indexed_status, geometry)
>                   values ('N',prevnode.osm_id, prevnode.class,
> prevnode.type, prevnode.admin_level, housenum, prevnode.street,
> prevnode.isin, coalesce(prevnode.postcode, defpostalcode),
>                   prevnode.country_code, prevnode.parent_place_id,
> prevnode.rank_address, prevnode.rank_search, 1,
> ST_Line_Interpolate_Point(linegeo,
> (housenum::float-orginalstartnumber::float)/originalnumberrange::float))"
> PL/pgSQL function "create_interpolation" line 92 at SQL statement
> PL/pgSQL function "placex_update" line 71 at assignment
> 
> Why could be the reason ?

I managed to reproduce that and it turns out that it is quite harmless.
It tries to update an address interpolation in an area that initially 
you haven't imported. Therefore it is missing half the data (the
nodes, to be precise). So, failing is the right thing to do in this case.
I've just submitted a fix, so that it will simply ignore the address
interpolation without spitting out an SQL error but even without the
fix it is save to ignore the error.

Sarah



More information about the Geocoding mailing list