[Routing] how to delete a line temporary

Stephen Woodbridge woodbri at swoodbridge.com
Sun Jul 31 20:06:54 BST 2011


On 7/31/2011 2:04 PM, javad sadidi wrote:
> hi to all
> who does know , how can I select a route in browser then send a request
> to postgrsql database to delete in temporary but not for always . and
> then to back the deleted line to the database whenever I want .
> I know that I have to put a point then select the nearest edge . and I
> dont know what should I do then.
> thanks

There are a bunch of different ways to do this but they depend on what 
you want to achieve.

For example if one use deletes a line do you want the line deleted for 
all users?

If it is only for a single user during there active session, then you 
can get the gid for each segment that the user wants to delete into an 
array. Then you can change you query to selecting segments and add to 
the where clause 'and gid not in (<list of gid from array>)'

You could also add another layer in openlayers to display the deleted 
features in say red so the use can see them.

If you want this to be global then create a table and add the gid for 
the deleted segments to that table and modify your query to join to this 
table and eliminate those segments ro do something like:

'and gid not in (select gid from deleted)'

Then when you want to add the segments back in, remove them from the 
array or table.

-Steve



More information about the Routing mailing list