[postgis-users] Problem updating geometry in a record

Birgit Laggner birgit.laggner at ti.bund.de
Tue Sep 29 00:00:22 PDT 2015


Hi Bob,

I had the problem sometimes that st_union() result was NULL. Perhaps 
that's the case with your query, too? Is it necessary to use st_union()? 
Otherwise you could replace it with st_collect(), if you just want to 
collect all geometries into a multilinestring. That's more robust 
because no geoprocessing is needed...

Regards,

Birgit


Am 28.09.2015 um 22:46 schrieb Bistrais, Bob:
>
> I have been able to derive a geometry from a query.  I want to insert 
> that geometry into a Multilinestring field.  I have some SQL code to 
> do it.  When I run the code, the output say that the query was 
> successful. But I don’t see the geometry inserted into the table.  
> Here is the code:
>
> update highschools_aroo set routegeom =
>
> (SELECT ST_Union(geom) as mygeom from (SELECT pt.geom
>
>                 FROM pgr_dijkstra(
>
>                                 'SELECT gid AS id,
>
> sourceroute::integer as source,
>
> targetroute::integer as target,
>
> (feet / 5280)::double precision AS cost,
>
> feet::double precision as reverse_cost
>
> FROM ngrdsaroo2',2465,1713,false,true)
>
> as di
>
> JOIN ngrdsaroo2 pt on di.id2 = pt.gid) as foo)
>
> WHERE source_node = 2465 and target_node = 1713;
>
> -As mentioned, this runs with no errors, but the geometry field is not 
> updated.  Any suggestions?
>
>
> Thanks,
>
> Bob
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20150929/8bc55f61/attachment.html>


More information about the postgis-users mailing list