[postgis-users] Point In Polygon Update Query

Birgit Laggner birgit.laggner at thuenen.de
Wed Jun 1 08:17:08 PDT 2016


Hi Chris,

for the warning if a user is within a mile of the warned area, you could 
use ST_DWithin instead of ST_Within.

Since you have EPSG 4326, I would convert the geometries into geography 
types because then you can define the distance in meters (not in 
degrees), perhaps like:

ST_DWithin(mastergistmp.geom::geography, wwmaster.geom::geography, 1610.0)

Otherwise your UPDATE queries look fine for me...

Regards,

Birgit

Am 27.05.2016 um 02:04 schrieb Chris B:
> I'm trying to put what the warning is for the point in the polygon, I 
> have my wwmaster which is where all the warnings are stored, my 
> mastergistmp where my users are stored, I know if a user is in a 
> severe thunderstorm warning and a tornado warning the tornado warning 
> will override the severe storm warning which is what I want does 
> anyone see anything wrong with this I think I am missing some users in 
> the warned area. everything is epsg 4326 I would like to also make it 
> where users with in a mile of the warned area are updated with the 
> information I've tried st_buffer and have had trouble with it. I'm 
> updating the mastergistmp.warn or thats what I'm shooting for.
>
> UPDATE mastergistmp SET warn = wwmaster.prod_type FROM wwmaster WHERE 
>  wwmaster.prod_type = 'Flash Flood Warning' and 
> ST_Within(mastergistmp.geom,wwmaster.geom);
> UPDATE mastergistmp SET warn = wwmaster.prod_type FROM wwmaster WHERE 
>  wwmaster.prod_type = 'Severe Thunderstorm Warning' and 
> ST_Within(mastergistmp.geom,wwmaster.geom);
> UPDATE mastergistmp SET warn = wwmaster.prod_type FROM wwmaster WHERE 
>  wwmaster.prod_type = 'Tornado Warning' and 
> ST_Within(mastergistmp.geom,wwmaster.geom);
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/postgis-users

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


More information about the postgis-users mailing list