Re: [GRASS-dev] How to calculate mean coordinates from big point datasets?
On 18/09/13 00:10, Markus Neteler wrote: Hi, I came across this question: http://gis.stackexchange.com/questions/71734/how-to-calculate-mean-coordinates-from-big-point-datasets and wondered if this approach would be the fasted: # http://grass.osgeo.org/sampledata/north_carolina/points.las v.in.lidar input=points.las output=lidarpoints -o ... Number of points: 1287775 ... Now I would use v.univar -d lidarpoints type=point This calculates geometry distances, not the mean coordinate: $ v.univar -d myhosp type=point number of primitives: 160 number of non zero distances: 12561 number of zero distances: 0 minimum: 9.16773 maximum: 760776 range: 760767 sum: 2.69047e+09 mean: 214193 mean of absolute values: 214193 population standard deviation: 128505 population variance: 1.65136e+10 population coefficient of variation: 0.599953 sample standard deviation: 128511 sample variance: 1.6515e+10 kurtosis: 0.277564 skewness: 0.801646 Is it the best way? How about v.to.db -p op=coor and then calculating the mean of the coordinates with an ad-hoc script. But that's probably not any faster than Hamish' v.out.ascii approach in v.points.cog. Would probably be a nice little module to have in C: calculate centroid of polygon, center point of line and centroid (possibly weighted) for points. Moritz ___ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] redirect graphic output of r.spread
Hi, On Wed, Sep 18, 2013 at 1:07 AM, Hamish hamis...@yahoo.com wrote: Margherita wrote: Any idea on how to (and IF it's possible to) redirect the graphic output of r.spread module to a gif or mov or avi file instead of to (or beside to) the monitor? not directly, but you might see the screencast section in: http://grasswiki.osgeo.org/wiki/Movies Thanks for the link. But I don't understand how to put this in practice. I mean, as far as I understand, you're suggesting to run r.spread in a loop, each step producing a final map as image and then compose together as a video, right? I had also thought something of the kind, but I was looking for a way to save the detailed fire evolution as it is generated by r.spread, hence a way to redirect the output directly to a video, or at least save several static images while r.spread is running, and then to compose them as a movie. Is that feasible? Thanks -- Best regards, Dr. Margherita DI LEO Scientific / technical project officer European Commission - DG JRC Institute for Environment and Sustainability (IES) Via Fermi, 2749 I-21027 Ispra (VA) - Italy - TP 261 Tel. +39 0332 78 3600 margherita.di-...@jrc.ec.europa.eu Disclaimer: The views expressed are purely those of the writer and may not in any circumstance be regarded as stating an official position of the European Commission. ___ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] How to calculate mean coordinates from big point datasets?
On 17 September 2013 22:10, Markus Neteler nete...@osgeo.org wrote: Hi, I came across this question: http://gis.stackexchange.com/questions/71734/how-to-calculate-mean-coordinates-from-big-point-datasets and wondered if this approach would be the fasted: # http://grass.osgeo.org/sampledata/north_carolina/points.las v.in.lidar input=points.las output=lidarpoints -o ... Number of points: 1287775 ... Now I would use v.univar -d lidarpoints type=point (still calculating here...) Is it the best way? maybe v.median [0] could help? Markus [1] http://trac.osgeo.org/grass/browser/grass-addons/grass7/vector/v.median -- ciao Luca http://gis.cri.fmach.it/delucchi/ www.lucadelu.org ___ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] How to calculate mean coordinates from big point datasets?
On 18/09/13 10:51, Luca Delucchi wrote: On 17 September 2013 22:10, Markus Netelernete...@osgeo.org wrote: Hi, I came across this question: http://gis.stackexchange.com/questions/71734/how-to-calculate-mean-coordinates-from-big-point-datasets and wondered if this approach would be the fasted: # http://grass.osgeo.org/sampledata/north_carolina/points.las v.in.lidar input=points.las output=lidarpoints -o ... Number of points: 1287775 ... Now I would use v.univar -d lidarpoints type=point (still calculating here...) Is it the best way? maybe v.median [0] could help? [1] http://trac.osgeo.org/grass/browser/grass-addons/grass7/vector/v.median Right. Here's a little test: $time v.median in=elev_lid792_randpts 638648.50|220378.50 real0m0.249s user0m0.180s sys 0m0.044s $time v.to.db elev_lid792_randpts op=coor -p | awk -F'|' 'BEGIN{SUMX=0; SUMY=0; N=0} {N+=1;SUMX+=$2;SUMY+=$3} END{print SUMX/N, SUMY/N}' Reading features... 100% 638544 220339 real0m0.106s user0m0.100s sys 0m0.020s Would be interesting to see results for big data. And AFAIK median is a bit more difficult to do in awk. I imagine that replacing the median by the mean in numpy is no problem (might be a flag to add to v.median). I didn't try v.points.cog as that actually creates a new vector map. Moritz ___ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] [GRASS GIS] #2077: implement drop-down menu for barscale styles
#2077: implement drop-down menu for barscale styles --+- Reporter: martinl | Owner: grass-dev@… Type: enhancement | Status: reopened Priority: major| Milestone: 7.0.0 Component: wxGUI| Version: svn-trunk Resolution: |Keywords: d.barscale Platform: All | Cpu: All --+- Comment(by martinl): Replying to [comment:9 martinl]: BTW, any chance to add barscale images to the manual, similarly to `r.colors`? Done in r57735. I am not sure about current solution, barscale previews are copied to `$(DIST)/gui/images` directory which seems to be a natural place for them. Previews in the manual link to this directory which is probably not a good idea. GRASS installation could be distributed without GUI, then the previews will be missing in the manual. We have two options (1) redundancy - copy barscales previews to two directories, ie. `gui/images` and `docs/html`. Already used for toolbar icons. (2) copy barscales only to `docs\html` Second option could be problem for distributions without documentation, then the previews would be missing. But it's quite improbable situation. BTW, colorstable previews are currently copied only to `docs/html`. -- Ticket URL: http://trac.osgeo.org/grass/ticket/2077#comment:15 GRASS GIS http://grass.osgeo.org ___ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] How to calculate mean coordinates from big point datasets?
On Wed, Sep 18, 2013 at 11:41 AM, Moritz Lennert mlenn...@club.worldonline.be wrote: On 18/09/13 10:51, Luca Delucchi wrote: On 17 September 2013 22:10, Markus Netelernete...@osgeo.org wrote: Hi, I came across this question: http://gis.stackexchange.com/questions/71734/how-to-calculate-mean-coordinates-from-big-point-datasets and wondered if this approach would be the fasted: # http://grass.osgeo.org/sampledata/north_carolina/points.las v.in.lidar input=points.las output=lidarpoints -o ... Number of points: 1287775 ... Now I would use v.univar -d lidarpoints type=point (still calculating here...) Is it the best way? maybe v.median [0] could help? [1] http://trac.osgeo.org/grass/browser/grass-addons/grass7/vector/v.median Right. Here's a little test: $time v.median in=elev_lid792_randpts 638648.50|220378.50 Should be 638648|220378. It seems that numpy gets the median wrong... real0m0.249s user0m0.180s sys 0m0.044s $time v.to.db elev_lid792_randpts op=coor -p | awk -F'|' 'BEGIN{SUMX=0; SUMY=0; N=0} {N+=1;SUMX+=$2;SUMY+=$3} END{print SUMX/N, SUMY/N}' Reading features... 100% 638544 220339 Should be 638650 220376 real0m0.106s user0m0.100s sys 0m0.020s Would be interesting to see results for big data. And AFAIK median is a bit more difficult to do in awk. I imagine that replacing the median by the mean in numpy is no problem (might be a flag to add to v.median). The v.to.db + v.db.univar approach is working just fine, and provides correct results. About a little module to calculate centroid of polygon, center point of line and centroid (possibly weighted) for points, that would be easy because all the components are there, even though there are in theory alternatives to the current calculation of centroids for polygons. Markus M ___ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] [GRASS GIS] #2077: implement drop-down menu for barscale styles
#2077: implement drop-down menu for barscale styles --+- Reporter: martinl | Owner: grass-dev@… Type: enhancement | Status: reopened Priority: major| Milestone: 7.0.0 Component: wxGUI| Version: svn-trunk Resolution: |Keywords: d.barscale Platform: All | Cpu: All --+- Comment(by wenzeslaus): The GUI should depend on documentation not the other way around, so 2 or 1 are the right options. Do we know that documentation is always in `$GISBASE/docs/html` on all platforms? Are there any distributions which put the documentation somewhere else? The first option (redundancy) would be the safest option in this case. Currently, the documentation path in the GUI is used for accessing the pages, e.g. in module dialogs/forms. So, the option 2 (things in docs/html) is already used and it seems to work. (But are we sure that it is always `$GISBASE/docs/html`?) By the way, I'm wondering how the compilation of HTML works in non-unix enviroments. Do I need to have `sed` installed? -- Ticket URL: http://trac.osgeo.org/grass/ticket/2077#comment:16 GRASS GIS http://grass.osgeo.org ___ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] [GRASS GIS] #2080: wxGUI: changing properties of barscale or legend
#2080: wxGUI: changing properties of barscale or legend -+-- Reporter: martinl | Owner: grass-dev@… Type: enhancement | Status: new Priority: normal | Milestone: 7.0.0 Component: wxGUI| Version: svn-trunk Keywords: decorations, d.barscale, d.legend, d.northarrow |Platform: All Cpu: All | -+-- Comment(by annakrat): Please test r57738 if it is acceptable for you or you have any better suggestions. -- Ticket URL: https://trac.osgeo.org/grass/ticket/2080#comment:10 GRASS GIS http://grass.osgeo.org ___ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] [GRASS GIS] #2080: wxGUI: changing properties of barscale or legend
#2080: wxGUI: changing properties of barscale or legend -+-- Reporter: martinl | Owner: grass-dev@… Type: enhancement | Status: new Priority: normal | Milestone: 7.0.0 Component: wxGUI| Version: svn-trunk Keywords: decorations, d.barscale, d.legend, d.northarrow |Platform: All Cpu: All | -+-- Comment(by martinl): Replying to [comment:10 annakrat]: Please test r57738 if it is acceptable for you or you have any better suggestions. much much more better! There is only one limitation - you cannot add multiple barscales, legends, or northarrows, right? -- Ticket URL: https://trac.osgeo.org/grass/ticket/2080#comment:11 GRASS GIS http://grass.osgeo.org ___ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] [GRASS GIS] #2080: wxGUI: changing properties of barscale or legend
#2080: wxGUI: changing properties of barscale or legend -+-- Reporter: martinl | Owner: grass-dev@… Type: enhancement | Status: new Priority: normal | Milestone: 7.0.0 Component: wxGUI| Version: svn-trunk Keywords: decorations, d.barscale, d.legend, d.northarrow |Platform: All Cpu: All | -+-- Comment(by annakrat): Replying to [comment:11 martinl]: Replying to [comment:10 annakrat]: Please test r57738 if it is acceptable for you or you have any better suggestions. much much more better! There is only one limitation - you cannot add multiple barscales, legends, or northarrows, right? Yes, but this limitation was there even before. The workaround is to add the command layer which then behaves little differently (no moving around). But I guess this is not the common requirement. -- Ticket URL: https://trac.osgeo.org/grass/ticket/2080#comment:12 GRASS GIS http://grass.osgeo.org ___ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] [GRASS GIS] #2080: wxGUI: changing properties of barscale or legend
#2080: wxGUI: changing properties of barscale or legend -+-- Reporter: martinl | Owner: grass-dev@… Type: enhancement | Status: new Priority: normal | Milestone: 7.0.0 Component: wxGUI| Version: svn-trunk Keywords: decorations, d.barscale, d.legend, d.northarrow |Platform: All Cpu: All | -+-- Comment(by martinl): Replying to [comment:12 annakrat]: much much more better! There is only one limitation - you cannot add multiple barscales, legends, or northarrows, right? Yes, but this limitation was there even before. The workaround is to add the command layer which then behaves little differently (no moving around). But I guess this is not the common requirement. right, the correct sentence is There is *still* one limitation. -- Ticket URL: https://trac.osgeo.org/grass/ticket/2080#comment:13 GRASS GIS http://grass.osgeo.org ___ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] redirect graphic output of r.spread
Margherita wrote: Any idea on how to (and IF it's possible to) redirect the graphic output of r.spread module to a gif or mov or avi file instead of to (or beside to) the monitor? Hamish: not directly, but you might see the screencast section in: http://grasswiki.osgeo.org/wiki/Movies Thanks for the link. But I don't understand how to put this in practice. I mean, as far as I understand, you're suggesting to run r.spread in a loop, each step producing a final map as image and then compose together as a video, right? nope, the screencast is to record the changes on the screen as they happen, like putting a movie camera pointed at the screen. (including the cursor if it happens to be in-shot) As-written I don't think there's a way to have r.spread write out static images per-iteration to encode later into a video from individual frames. regards, Hamish ___ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] redirect graphic output of r.spread
On Wed, Sep 18, 2013 at 3:29 PM, Hamish hamis...@yahoo.com wrote: Margherita wrote: Any idea on how to (and IF it's possible to) redirect the graphic output of r.spread module to a gif or mov or avi file instead of to (or beside to) the monitor? Hamish: not directly, but you might see the screencast section in: http://grasswiki.osgeo.org/wiki/Movies Thanks for the link. But I don't understand how to put this in practice. I mean, as far as I understand, you're suggesting to run r.spread in a loop, each step producing a final map as image and then compose together as a video, right? nope, the screencast is to record the changes on the screen as they happen, like putting a movie camera pointed at the screen. (including the cursor if it happens to be in-shot) As-written I don't think there's a way to have r.spread write out static images per-iteration to encode later into a video from individual frames. So, if I understand correctly this is a bug in r.spread. For GRASS 6 it may seem as feature request but for GRASS 7 it is a bug. Expected output is a series of maps which you can put into a temporal dataset, export as images or analyze individually. Visualization is another issue but for GRASS 7, -d switch will newer be enabled. I'm not familiar with r.spread much, only from manual, so correct me if I'm wrong. Maybe it is not so complicated to rewrite it, is somebody familiar with the code to say something about it? Vaclav regards, Hamish ___ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev ___ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev