Re: [gdal-dev] Zonal statistics with GDAL/StarSpan

2008-12-19 Thread Greg Ederer
That's interesting.  This may explain why the --fid switch has no effect.  I wonder what the --fid switch is for, then. Brent Fraser wrote: Is the FID supposed to be in the .dbf file that accompanies the .shp file? I have examined this file, and I don't see an FID column (col

Re: [gdal-dev] Zonal statistics with GDAL/StarSpan

2008-12-19 Thread Brent Fraser
Is the FID > supposed to be in the .dbf file that accompanies the .shp file? > I have examined this file, and I don't see an FID column (column > names are in the first row). In particular, since starspan2 > reports an FID of 0 for Zemmour, Mauritania, I would expect to > see a column with t

Re: [gdal-dev] Zonal statistics with GDAL/StarSpan

2008-12-19 Thread Greg Ederer
Great question.  I should have mentioned that I did so, and didn't see anything weird.  I zoomed way in, and it just looks like an unbroken line.  I did this with the Tiris Zemmour polygon selected, and again with the Adrar polygon selected, hoping something would pop out.  But, it looks fine.

Re: [gdal-dev] Zonal statistics with GDAL/StarSpan

2008-12-19 Thread Greg Ederer
a) Is there some way to get a dump of FIDs with their corresponding country/province names? You could use dbfdump. I think it is delivered with FWTools. Is the FID supposed to be in the .dbf file that accompanies the .shp file?  I have examined this file, and I don't s

Re: [gdal-dev] Zonal statistics with GDAL/StarSpan

2008-12-19 Thread Brent Fraser
> Hi, > > I performed the OpenJump procedure. But, I still get: > > Macintosh-4:starspan_tests gregederer$ starspan2 --progress --RID none > --vector afadmn2n.shp --fid 3 --raster rfe_2006_04_pct.tif --stats > results.txt avg --out-prefix bar --out-type table > Number of features: 550 > starspan_

Re: [gdal-dev] Zonal statistics with GDAL/StarSpan

2008-12-19 Thread Greg Ederer
Hi, I performed the OpenJump procedure. But, I still get: Macintosh-4:starspan_tests gregederer$ starspan2 --progress --RID none --vector afadmn2n.shp --fid 3 --raster rfe_2006_04_pct.tif --stats results.txt avg --out-prefix bar --out-type table Number of features: 550 starspan_csv: 1: E

Re: [gdal-dev] Zonal statistics with GDAL/StarSpan

2008-12-18 Thread Greg Ederer
Thanks, Brent. I'll give this a whirl. Cheers, Greg Brent Fraser wrote: Greg, OpenJump is a good topology/geometry fixing tool. Load your shapefile and do Tools->Generate->Buffer, set the Buffer distance to 0 to clean up the polygon vertices. I seem to recall it may have a problem pres

Re: [gdal-dev] Zonal statistics with GDAL/StarSpan

2008-12-18 Thread Brent Fraser
Greg, OpenJump is a good topology/geometry fixing tool. Load your shapefile and do Tools->Generate->Buffer, set the Buffer distance to 0 to clean up the polygon vertices. I seem to recall it may have a problem preserving attributes when the results are saved as a shapefile, but you may be a

Re: [gdal-dev] Zonal statistics with GDAL/StarSpan

2008-12-18 Thread Greg Ederer
Brent, My Google search didn't turn up much of use (most of the results were PostGIS-specific). Do you know of a tool that would tell me which feature(s) have problems? Do you know of a tool that might be able to fix these polygons? Thanks! Greg Brent Fraser wrote: Greg, It means the

Re: [gdal-dev] Zonal statistics with GDAL/StarSpan

2008-12-18 Thread Brent Fraser
Greg, It means the GEOS topology library is having problems with geometry of your input shapefile. Most likely related to duplicate vertices (or near-duplicate) in a polygon. Do a Google for "side location conflict". It would be nice if it spat out the FID of the offending polygon... Bre

Re: [gdal-dev] Zonal statistics with GDAL/StarSpan

2008-12-18 Thread Greg Ederer
Hi Brent, Thanks for the example. Here's what I got: Macintosh-4:starspan_tests gregederer$ starspan2 --progress --RID none --vector /Users/gregederer/servers/geoserver_data/data/shapefiles/Admin/afadmn2n.shp --raster rfe_2006_04_pct.tif --stats results.txt avg starspan: --out-prefix: ? T

Re: [gdal-dev] Zonal statistics with GDAL/StarSpan

2008-12-18 Thread Brent Fraser
Greg, I've used StarSpan to do similar things; in my case I wanted "mode" not "avg". Using v1.2.01 (I don't think I made major mods to the source): starspan2.exe --progress --RID none --vector boundaries.shp --raster big.tif --stats results.txt mode I edited the resulting results.

[gdal-dev] Zonal statistics with GDAL/StarSpan

2008-12-18 Thread Greg Ederer
Hello all, I'm a GDAL newbie. I have a shape file containing subnational boundaries for Africa. I have a raster containing rainfall for Africa. I need to pull out the spatial average of rainfall for each of the subnational units. I think that I might be able to pull this off using StarSpa