tag:blogger.com,1999:blog-5125852724824145995.comments2016-08-12T06:46:32.724-07:00GeogeekGeoGeekhttp://www.blogger.com/profile/02596534612535469564noreply@blogger.comBlogger52125tag:blogger.com,1999:blog-5125852724824145995.post-22643939534852869482016-08-12T06:46:32.724-07:002016-08-12T06:46:32.724-07:00Useful information, it will be interesting to try ...Useful information, it will be interesting to try it. I can share a good template for presentation <a href="http://charts.poweredtemplate.com/powerpoint-diagrams-charts/index.html" rel="nofollow">http://charts.poweredtemplate.com/powerpoint-diagrams-charts/index.html</a>. The cool thing is to save time. I advise you to try.Peter Quigleyhttp://www.blogger.com/profile/17613583875535931324noreply@blogger.comtag:blogger.com,1999:blog-5125852724824145995.post-84859446115035477962016-06-07T00:00:36.004-07:002016-06-07T00:00:36.004-07:00Really cool post, highly informative and professio...Really cool post, highly informative and professionally written and I am glad to be a visitor of this perfect blog, thank you for this rare info! , Regards, <a href="http://www.traininghyderabad.in/2015/09/servicenow-training-in-hyderabad.html" rel="nofollow">servicenow training in hyderabad</a>Nasreen Basuhttp://www.blogger.com/profile/10679228391917788595noreply@blogger.comtag:blogger.com,1999:blog-5125852724824145995.post-6746299831588129562015-06-11T03:43:14.003-07:002015-06-11T03:43:14.003-07:00Hi,
I used your code today to generate a vornoi di...Hi,<br />I used your code today to generate a vornoi diagram based on Bordeaux (France) Bikesharing system stations.<br /><br />you can see in this picture : http://tinypic.com/r/261f3h1/8<br />That there is a bug: the upper left cell is contained in a bigger cell. Thus two points (stations) are sharing a cell.<br /><br />I'll investigate further in tour code to see if I can catch this bug.Rémi Delassushttp://www.blogger.com/profile/08468609606068991731noreply@blogger.comtag:blogger.com,1999:blog-5125852724824145995.post-81359755298398966182014-09-09T00:20:26.803-07:002014-09-09T00:20:26.803-07:00This comment has been removed by the author.Tadas Motiejunashttp://www.blogger.com/profile/02001799414040651182noreply@blogger.comtag:blogger.com,1999:blog-5125852724824145995.post-41104773522134972622014-07-11T02:03:31.836-07:002014-07-11T02:03:31.836-07:00Hi, I'm a little bit late also...
I try to ge...Hi, I'm a little bit late also...<br /><br />I try to generate voronoi polygons with plpython3 and it's not working...<br /><br />I've taken the last code by Matthias and I'm trying to update it for plpython3 but I'm a newbie on python so it's quite hard.<br /><br />I tried to use the sorting implementation as in this code : <br />http://db.tt/4nrdorXm<br />But no success.<br /><br />The polygons obtained are not correct and I don't have any idea for the moment.<br /><br />Btw, I think the last comment by Rich is important too.<br /><br />Since last year, have you solved the problem with plpython3 ?<br /><br />Thanks for your attention.<br />Deneb.Denebhttp://www.blogger.com/profile/13338873735606485963noreply@blogger.comtag:blogger.com,1999:blog-5125852724824145995.post-83360774607013210602014-05-01T14:31:18.589-07:002014-05-01T14:31:18.589-07:00I'm a bit late into this, but I'm running ...I'm a bit late into this, but I'm running Matthias's improved version and it looks like the identity of rows gets lost?<br /><br />It does a:<br />SELECT DISTINCT st_x(%s) as x, st_y(%s) as y FROM %s<br /><br />and then numbers everything sequentially when generating a result.<br /><br />But that SQL query has no ORDER BY, so the results just come back at the whim of the database (per the Postgresql manual - there is probably an implementation dependent pattern).<br /><br />I think it really needs to take an id column name that comes back in the result?<br />Richhttp://www.blogger.com/profile/17092996828683002246noreply@blogger.comtag:blogger.com,1999:blog-5125852724824145995.post-63537058556459974632013-10-15T12:04:29.061-07:002013-10-15T12:04:29.061-07:00This comment has been removed by the author.Ahmedhttp://www.blogger.com/profile/03996814060911390172noreply@blogger.comtag:blogger.com,1999:blog-5125852724824145995.post-7990320409669300602013-07-22T10:53:50.902-07:002013-07-22T10:53:50.902-07:00Thanks, Matthias, that's fabulous work. Thanks...Thanks, Matthias, that's fabulous work. Thanks a ton. I'll post an update to the blog.<br /><br />GeoGeekhttp://www.blogger.com/profile/02596534612535469564noreply@blogger.comtag:blogger.com,1999:blog-5125852724824145995.post-53797945330062263312013-07-17T23:36:40.909-07:002013-07-17T23:36:40.909-07:00Hi again,
I managed to have a closer look at the ...Hi again,<br /><br />I managed to have a closer look at the code and found that somehow all the PostGIS based clipping and polygon creation seems to be too unstable. I wasn't able to produce 100% clean output using the PostGIS voronoi post-processing.<br /><br />So what I did is just additionally incorporated the "clip_voronoi" code which is also used in the QGIS fTools plugin for correctly clipping the lines and voila - it worked :-)<br /><br />Here is the modified code: http://db.tt/gwEGpu0Y<br />I tested it with various input data and it produced correct and clean output in all cases.<br /><br />Hope it helps! Not much of this is my work though so credits go to both GeoGeek and the fTools authors, whose work I only was able to put together correctly.<br /><br />Cheers,<br />Matthias<br /><br />matthttp://www.blogger.com/profile/02787513130494316389noreply@blogger.comtag:blogger.com,1999:blog-5125852724824145995.post-13844462492483792312013-07-12T06:38:43.201-07:002013-07-12T06:38:43.201-07:00Hi,
thanks for your work, it is very helpful for ...Hi,<br /><br />thanks for your work, it is very helpful for what I'm trying to achieve!<br /> <br />However, I cannot confirm the finding that the QGIS fTools plugin produces the same incorrect output as this version. In my use case, I run the voronoi algorithm on a rather dense point data set (approx. 1000 points closely located to each other). <br />While the QGIS plugin yields flawless and clean results, this plpython method lacks about 40% of the voronoi polygons after execution. The log shows the already mentioned Self-intersection errors.<br /><br />Did you meanwhile had the time to look on the details why this erroneous output could be produced?<br />Any help is appreciated!<br /><br />Thanks a lot and best regards,<br />Matthiasmatthttp://www.blogger.com/profile/02787513130494316389noreply@blogger.comtag:blogger.com,1999:blog-5125852724824145995.post-92114198612074580412013-04-16T12:19:25.517-07:002013-04-16T12:19:25.517-07:00This comment has been removed by the author.rayhttp://www.blogger.com/profile/13777772035471547485noreply@blogger.comtag:blogger.com,1999:blog-5125852724824145995.post-82293010632281356652013-04-16T12:17:36.763-07:002013-04-16T12:17:36.763-07:00hey you have to create another function called int...hey you have to create another function called intersects(). i.e. you need two functions with the same content: st_intersects() and intersects().Then it is working.Not very logical I know, but it does the trick ;-)rayhttp://www.blogger.com/profile/13777772035471547485noreply@blogger.comtag:blogger.com,1999:blog-5125852724824145995.post-43623859222744550722013-04-16T08:11:02.580-07:002013-04-16T08:11:02.580-07:00On Ubuntu 12.10 (quantal) for postrgres 9.1 (the l...On Ubuntu 12.10 (quantal) for postrgres 9.1 (the last version with support for postGIS 2.0 as of the time of this writing) you can get it installing the ubuntugis repository[1] and the via apt:<br />sudo apt-get install postgresql-plpython-9.1<br />and then[2] in your database you can:<br /><br />CREATE EXTENSION plpythonu;<br /><br />HTH,<br /><br />Cristian<br />[1] https://wiki.ubuntu.com/UbuntuGIS<br />[2] http://www.postgresql.org/docs/9.1/static/plpython.htmlCristian Consonnihttp://www.blogger.com/profile/15199684704969460309noreply@blogger.comtag:blogger.com,1999:blog-5125852724824145995.post-43481170123584985642012-11-09T16:51:00.401-08:002012-11-09T16:51:00.401-08:00Hi, I also changed intersects() to st_intersects()...Hi, I also changed intersects() to st_intersects() and got the "function is not unique" error. I don't understand your comment where you said that you created an intersects() function [to get around this problem]. Do you mean your own version of intersects()? Using what? Could you explain what you are doing here. Thank you.Liam Caffreyhttp://www.blogger.com/profile/02481523052731087955noreply@blogger.comtag:blogger.com,1999:blog-5125852724824145995.post-49086023114309500452012-09-11T08:55:05.128-07:002012-09-11T08:55:05.128-07:00I didn't know that the QGIS code would produce...I didn't know that the QGIS code would produce errors, too. That's good to know, as I haven't had time to dive into a couple problems people have reported. (I did say it was quick and dirty, after all.) I'll have to run some comparisons between the output from QGIS and that from the PostGIS function to satisfy myself that it's not my fault. :) Then maybe I can dig into it and find out what's going on.<br /><br />Thanks for the heads up.GeoGeekhttp://www.blogger.com/profile/02596534612535469564noreply@blogger.comtag:blogger.com,1999:blog-5125852724824145995.post-79937544500770719792012-09-11T08:45:19.785-07:002012-09-11T08:45:19.785-07:00After trying the plpythonu Voronoi function and pr...After trying the plpythonu Voronoi function and producing artefacts and overlapping and self-overlapping voronoi polygons all the time (same happens if you use the ftools voronoi tool in QGIS, as the plpython code is derived from this), I tried out the PL/R voronoi function from http://punkish.org/Voronoi-Diagrams-In-PostGIS and found out that after some small adaptions to postgis 2 (make srid()-->st_srid() creating a intersects() function (otherwise you get the error "function st_intersects(geometry, text) is not unique"), the function produced a flawless set of voronoi polygons for 1000 points in about 13 seconds on a Core2duo CPU. I can only recommend to directly go for the PL/R function for voronois on large point sets. Only tested on Linux though ;-)raliskihttp://www.blogger.com/profile/11828343425764159849noreply@blogger.comtag:blogger.com,1999:blog-5125852724824145995.post-50147812298130292832012-09-11T08:43:13.343-07:002012-09-11T08:43:13.343-07:00After trying the plpythonu Voronoi function and pr...After trying the plpythonu Voronoi function and producing artefacts and overlapping and self-overlapping voronoi polygons all the time (same happens if you use the ftools voronoi tool in QGIS, as the plpython code is derived from this), I tried out the PL/R voronoi function from http://punkish.org/Voronoi-Diagrams-In-PostGIS and found out that after some small adaptions to postgis 2 (make srid()-->st_srid() etc), the function produced a flawless set of voronoi polygons for 1000 points in about 13 seconds on a Core2duo CPU. raliskihttp://www.blogger.com/profile/11828343425764159849noreply@blogger.comtag:blogger.com,1999:blog-5125852724824145995.post-16762443691089310972012-09-05T09:37:12.252-07:002012-09-05T09:37:12.252-07:00ok on my above comment I can say that changing to ...ok on my above comment I can say that changing to single polygons doesnt make a difference.<br /><br />As the voronoi function is borrowed from QGIS code I want to add the following: When I take a point set and run the voronoi creation on QGIS (1.8) , the extent of the resulting shapefile is always rectangular, while the extent of the geometries created by the plpythonu function is not rectangular, in spite of the function doing a clipping to the extent (almost at the end of the code...)<br /><br />Isnt there a Python developer with some spare time out there who could tackle the problem? I would be very veryvery thankful!<br /><br />Greetings!raliskihttp://www.blogger.com/profile/11828343425764159849noreply@blogger.comtag:blogger.com,1999:blog-5125852724824145995.post-39372425735832820172012-09-05T09:35:49.017-07:002012-09-05T09:35:49.017-07:00This comment has been removed by the author.raliskihttp://www.blogger.com/profile/11828343425764159849noreply@blogger.comtag:blogger.com,1999:blog-5125852724824145995.post-7594819779016097892012-09-04T09:05:39.341-07:002012-09-04T09:05:39.341-07:00hi also under plpython2u, I get some weird notices...hi also under plpython2u, I get some weird notices, and also some very weird voronois geometries far outside the extents of the poitn cloud used for the voronois: <br /><br />NOTICE: Self-intersection at or near point -x y<br />CONTEXT: SQL statement "<br /> SELECT <br /> CASE WHEN ST_IsValid(a.the_geom) AND ST_Overlaps(ST_Multi('xxx'::geometry), a.the_geom)<br /> THEN<br /> ST_Multi(ST_Intersection('xxx'::geometry, a.the_geom)) <br /> ELSE <br /> a.the_geom<br /> END as the_geom<br /> FROM (SELECT st_multi(ST_Polygon($1,4326)) as the_geom) a<br /> "<br /><br />could this have to do with the voronoi polygons being created as multipolygons inspite of the fact thata voronoi can only be a single polygon at least when it is created for a set single points?raliskihttp://www.blogger.com/profile/11828343425764159849noreply@blogger.comtag:blogger.com,1999:blog-5125852724824145995.post-38209130414807345812012-08-22T08:54:58.790-07:002012-08-22T08:54:58.790-07:00Hi Paul,
The code is available. See http://geogee...Hi Paul,<br /><br />The code is available. See http://geogeek.garnix.org/2012/04/faster-voronoi-diagrams-in-postgis.html<br /><br />If you look through the comments you'll see that it only works with Python 2.x – the 3.x version still has some bugs I haven't had time to fix.<br />GeoGeekhttp://www.blogger.com/profile/02596534612535469564noreply@blogger.comtag:blogger.com,1999:blog-5125852724824145995.post-24552109486568605732012-08-20T15:19:18.071-07:002012-08-20T15:19:18.071-07:00Was wondering if you could make your modified code...Was wondering if you could make your modified code available? I've come across the other Voronoi example on BostonGIS but it dependso n PL/R and the R stats packages. I'd like to work with your example as it sounds like it doesn't have that dependency.<br /><br />ThankPaul Wickmanhttp://www.blogger.com/profile/17311942878098442838noreply@blogger.comtag:blogger.com,1999:blog-5125852724824145995.post-78760715998726909392012-07-31T07:24:02.598-07:002012-07-31T07:24:02.598-07:00hey can you contact me at raliski@gmail.com...its ...hey can you contact me at raliski@gmail.com...its urgent here to get voronoi working on Postgis 2.0 / Python3 combination..thanks!raliskihttp://www.blogger.com/profile/11828343425764159849noreply@blogger.comtag:blogger.com,1999:blog-5125852724824145995.post-18487676528014894232012-07-19T02:04:36.432-07:002012-07-19T02:04:36.432-07:00Hi, I was looking for a possibility to write you a...Hi, I was looking for a possibility to write you a PM, but didnt find it.. As we are very dependent on running the faster python voronoi function on python3u, we would like to politely ask you if you think the transfer to python3 can be realized and if you are still working on it (Unfortenately we are kind of tuck due to limited Python knowledge here). Kind greetings and many thanks for your work until now...raliskihttp://www.blogger.com/profile/11828343425764159849noreply@blogger.comtag:blogger.com,1999:blog-5125852724824145995.post-2028916487001673932012-07-12T16:11:45.392-07:002012-07-12T16:11:45.392-07:00hmm I get thiserror message now
Self-intersection...hmm I get thiserror message now<br /><br />Self-intersection at or near point ...<br />CONTEXT: SQL-Anweisung »<br />SELECT<br />CASE WHEN ST_IsValid(a.the_geom) AND ST_Overlaps(ST_Multi('...'::geometry), a.the_geom)<br />THEN<br />ST_Multi(ST_Intersection('...'::geometry, a.the_geom))<br />ELSE<br />a.the_geom<br />END as the_geom<br />FROM (SELECT st_multi(ST_Polygon($1,4326)) as the_geom) a<br />«<br />PL/Python function "voronoi_p3cmp"<br />HINWEIS: Self-intersection at or near point ...<br />KONTEXT: SQL-Anweisung »<br />SELECT<br />CASE WHEN ST_IsValid(a.the_geom) AND ST_Overlaps(ST_Multi('...'::geometry), a.the_geom)<br />THEN<br />ST_Multi(ST_Intersection('...'::geometry, a.the_geom))<br />ELSE<br />a.the_geom<br />END as the_geom<br />FROM (SELECT st_multi(ST_Polygon($1,4326)) as the_geom) a<br />«<br />PL/Python function "voronoi_p3cmp"<br /><br />or also this<br /><br />spiexceptions.InternalError: Shell is not a line<br /><br />with a smaller point setraliskihttp://www.blogger.com/profile/11828343425764159849noreply@blogger.com