barryhunter / geocubes-api

Automatically exported from code.google.com/p/geocubes-api
0 stars 0 forks source link

Suggestion: "Update" method for points #25

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Occasionally need to update the record held at Geocubes for a point. For 
example if one of the user defined fields changes, or even if the lat/long is 
updated following a correction on the site. 

At the moment have to issue a remove and then re add ( the PHP api at least 
throws an error if try to re add the same id). This is wasteful.  

Have no problem supplying all the details again for a 'update' so it could 
internally be mapped to remove then add, but only one external API call :)

Original issue reported on code.google.com by BarryBHu...@gmail.com on 4 Aug 2009 at 1:17

GoogleCodeExporter commented 9 years ago
Hey Barry,

I will add a update feature soon. I've tested to readd a point with PHP library 
and
it worked for me:

xxx:~/geocubes/gcapi/php# php test.php
Geo Point with Id: 123456, Lat: 53.1337000000, Lng: 13.0549990000 added
Geo point with Id: 123456 successfully removed
Geo Point with Id: 123456, Lat: 53.1337000000, Lng: 13.0549990000 added
Geo point with Id: 123456 successfully removed

May be you can give me a litte debug output?

Also I will suggest you to integrate the REST api, because you have so many 
points
and the REST api is faster than PHP library. I will also try to add a feature to
add/remove multiple points in one request. 

Original comment by rk...@skilldeal.com on 4 Aug 2009 at 2:18

GoogleCodeExporter commented 9 years ago
You've got a delete in the middle. 

This bit failed:

                                if ($this->_sendTo("GEO ADD CPL", $ret) == 1)
                                        return $ret[1];
                                else {
                                        print "geocubes error: failed add";
                                        return 0;
                                }

When trying to 'add' a point that is already active in the database. Really 
just mean overwrite I 
guess. 

Admittedly havent tried it for a while, but know had issues when first adding 
geograph 
intergration. 

(Yes plan to mitgrate to the rest api - in fact just patch the php class to 
optionally be able to 
work via the rest api :)

Original comment by BarryBHu...@gmail.com on 4 Aug 2009 at 2:28

GoogleCodeExporter commented 9 years ago
Ah okay I misunderstood this. You are right this is not possible. I will add
"updateing points" only to the rest api. I hope this is okay for you? I will no
longer support PHP library because it's really too slow.

Original comment by rk...@skilldeal.com on 4 Aug 2009 at 2:42

GoogleCodeExporter commented 9 years ago
Just the RestAPI is fine by me :)

Original comment by BarryBHu...@gmail.com on 4 Aug 2009 at 2:46