[postgis-users] updating a geometry column, db procedure needed?
Bart van den Eijnden
BEN at Syncera-ITSolutions.NL
Tue Sep 13 02:16:41 PDT 2005
Hi Nicolas,
thanks for your reply.
For the record, I got the following to work:
update bouwvergunning.aanvraag set the_geom = setSRID(makePoint(adres.x, adres.y), 28992)
from basis.adrloc as adres where aanvraag.postcode = adres.pstk and aanvraag.huisnr = adres.huisnummer;
Best regards,
Bart
Bart van den Eijnden
Syncera IT Solutions
Postbus 270
2600 AG DELFT
tel.nr.: 015-7512436
email: BEN at Syncera-ITSolutions.nl
>>> Nicolas Ribot <nicky666 at gmail.com> 12-9-2005 19:58:30 >>>
> Hi list,
>
> I have 2 tables:
>
> 1) an address table with postal code, house no., X and Y columns (no
> geometry column)
> 2) another table X which has postal code and house no.
>
> I have added a geometry column to table X and want to update it with
> address matching from the address table using postal code and house no.
>
> Can I do this with plain SQL? Or do I need a database procedure to do this
> for all of the records?
>
> Thanks in advance.
>
Hi Bart.
You can do that with plain SQL, something like (pseudo SQL)
update x set the_geom = makePoint(address.X, address.Y)
from address where X.address.postal_code = postal_code and X.house_no = house_no
Nicolas
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
More information about the postgis-users
mailing list