[Geomoose-users] Isolate Water System Valve for Waterline Break
Dan Little
danlittle at yahoo.com
Tue Nov 1 15:02:10 EDT 2011
You're looking at some custom stuff.
But, I'd do something a long these lines:
- Load the data into PostgreSQL (hey, I have no systems restrictions, so I'm going to suggest it how *I'd* do it. :D )
- Read the point as a service, that's easy enough (look at identify.py) as an example.
- Run some SQL to find the nearest line to the point clicked (I'm assuming the data is stored in ground units, like meters...)
select line_id from water_lines where st_distance(geomfromtext($1, water_lines.wkb_geometry )) < 3
- Then use that line_id to find all the attached valves...
select valve_id, wkb_geometry from water_line_valves where line_id = $1
- Or, if I didn't find any ON the line with an ID... this will find all valves within 5 meters (assuming units of meters) of the water line.
select valve_id, valves.wkb_geometry
from water_lines, water_line_valves valves
where st_distance(water_lines.wkb_geometry, valves.wkb_geometry) < 5
and water_line.line_id = $1
Then do some magic to report more info on the valves, and ship down an extent made up of those points.
>________________________________
>From: Ed Boesenberg <eboesenberg at niraengineers.com>
>To: geomoose-users at lists.osgeo.org
>Sent: Tuesday, November 1, 2011 1:47 PM
>Subject: [Geomoose-users] Isolate Water System Valve for Waterline Break
>
>
>Would it be possible to create a GeoMoose service in which the user would click a point on a polyline (waterline), the point would represent a waterline break, and the service would search for valves along the waterline to determine which valves to shutoff to isolate the break then zoom to selected valves? All of my data is in shapefiles.
>
>If it is possible, what would be the sections of code I would start to modify or create?
>
>Ed Boesenberg
>_______________________________________________
>Geomoose-users mailing list
>Geomoose-users at lists.osgeo.org
>http://lists.osgeo.org/mailman/listinfo/geomoose-users
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geomoose-users/attachments/20111101/ccc36aad/attachment.html
More information about the Geomoose-users
mailing list