[GRASS-user] v.rast.stats
Hi It is still giving me -NULL value error. Do you think maybe its the way I downloaded my rainfall data? This is the site where I downloaded my data sets* ftp://trmmopen.gsfc.nasa.gov/pub/gis/ *and this data covers the whole world, the only thing I did was to clip a specific region (using coordinates) that is in South Africa to do my analysis. I used a bash script to download and project the data, see below: #!/bin/bash wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw gdal_translate -of GTiff -co PROFILE=GeoTIFF -co INTERLEAVE=PIXEL -co COMPRESS=LZW -co TILED=YES -a_srs EPSG:4326 -a_ullr 18.2987501 -33.6795831 19.1712501 -34.3487498 3B42RT.2010032900.1day.tif TRMMLast1day.tif 2010/6/15 Micha Silver mi...@arava.co.il On 15/06/2010 14:35, Sandile Gumede wrote: Hi If I run g.region rast=rainfall -p, I get: OK, what you've done here is change the current region to match the raster rainfall. Can you now try: v.rast.stats -c vect=catchments rast=rainfall pref=precip projection: 3 (Latitude-Longitude) zone: 0 datum: wgs84 ellipsoid: wgs84 north: 33:40:46.49916S south: 34:20:55.49928S west: 18:17:55.50036E east: 19:10:16.50036E nsres: 0:00:05.01875 ewres: 0:00:02.18125 rows: 480 cols: 1440 cells: 691200 and If I run r.univar rainfall, I get the following output: 100% total null and non-null cells: 691200 total null cells: 0 Of the non-null cells: -- n: 691200 minimum: 0 maximum: 3094 range: 3094 mean: 22.0228 mean of absolute values: 22.0228 standard deviation: 76.1639 variance: 5800.94 variation coefficient: 345.841 % sum: 15222164 On Tue, Jun 15, 2010 at 12:22 PM, Hamish hamis...@yahoo.com wrote: Micha wrote: The only unusual thing I notice above is that the resolution settings for the raster are different N-S and E-W. This came from the original tiff (see below) which also has rectangular pixels, that is perfectly normal for a lat/lon map away from the equator. longitude scales a cos(lat). (the v.rast.stats module creates a temp raster at the *current region's resolution* settings, which might be different from this rainfall raster's rectangular resolution...) the results of: g.region -p rast=mapname r.univar mapname could help. Hamish -- Kind Regards TS Gumede CSIR, Meraka Institute 072 258 1650 This mail was received via Mail-SeCure System. -- Micha Silverhttp://www.surfaces.co.il/ Arava Development Co. +972-52-3665918 -- Kind Regards TS Gumede CSIR, Meraka Institute 072 258 1650 ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Using Tck/tk vector digitizer for training areas
Thanks Micha for your help but I got an error while doing this 1- Create new empty vectorial 2- run v.db.addtable command that you kindly sent me 3- use v.digit as defined previously 4- Inside tcltk's digitizing menu select Digitize new Centroid 5- Leave layer as 1 6- Change Mode to Manual Entry 7- First digitize boundary (by selecting boundary) by selecting points with left-mouse-button and close polygon with right-mouse-button 8- A panel with FORM title appears with a tab saying Attributes saying: New record was created saying CAT : 1 (this cat refers to the land cover category right?); train_lbl value and GRASSRGB; 9- I place the values (water,1) for train_lbl and GRASSRGB 10- a box ask me for ASSUME DATA ENCODING AS a list appears. I should select which one? ASCII? 11- In trhis case I select ASCII and press SUBMIT. In the bottom of that box Record successfully updated appeared. 12- Insert centroid-1 and press submit in Form panel 13- Did the same for a few more polygons of cat 1 14- Did the same for a few more polygons of cat 2 and 3 15- Pressed Save and Exit Then I realized that at my v.digit panel command output I had this warning in there: *Could not set Tcl system encoding to 'ascii' (unknown encoding ascii)* *Unable to read vector map* Questions: 1- Is this the right procedure? 2- What encoding should I use? 3- Regarding GRASSRGB field, what information usually you place in there? Color code or color description? 4- For Supervised classification algorithms in GRASS, Vector type (accessible by using Query raster/vector tool) should be Boundary? Because, for instance, if I press a defined boundary, in some places I get Type: AREA and in others: Boundary (as shown bellow) (...) Map: vector06 Mapset: landsat Type: Boundary Id: 9 Layer: 1 Category: 3 Driver: dbf Database: C:\GRASS6\grassdata/North-Carolina/landsat/dbf/ Table: vector06 Key column: cat cat : 3 train_lbl : urban GRASSRGB : 3 (Thu Jun 17 10:34:04 2010) Command finished (0 sec) (Thu Jun 17 10:34:06 2010) v.what --q -a map=vecto...@landsat east_north=639279.744997,227730.071998 (...) Map: vector06 Mapset: landsat Type: Area Sq Meters: 2158429.741 Hectares: 215.843 Acres: 533.360 Sq Miles: 0.8334 Layer: 1 Category: 3 Driver: dbf Database: C:\GRASS6\grassdata/North-Carolina/landsat/dbf/ Table: vector06 Key column: cat cat : 3 train_lbl : urban GRASSRGB : 3 Thanks for your help and support Jenny On Wed, Jun 16, 2010 at 7:59 PM, Micha Silver mi...@arava.co.il wrote: On 06/16/2010 06:55 PM, Jenny Turner wrote: Hi Micha and GRASS-users/list Let me see if I get this straight 1- use v.digit (e.g. v.digit -n map=vector00 bgcmd=d.rast map=lsat5_1987_40 ) 2- Inside tcltk's digitizing menu select Digitize new Centroid 3- Leave layer as 1? 4- Change Mode to Manual Entry? All the above looks good. 5- And for each Centroid I select a Cat right? Yes, always using the *same* cat for training areas of the same type. (Is this the proceeding?) About this, I have two questions: a- I have to leave Insert New record into table checked right? Yes b- After I left Insert New record into table checked, Layer 1 and Cat 1 and Mode: Manual Entry, when I presss in the image a Error Window appeared stating: Database table for this layer is not defined. Where shall i define the database table for a new vectorial that I digitizing? Ah, v.db.addtable vector00 col=train_lbl varchar(16), GRASSRGB varchar(16) THis should setup an attrib table with two columns, one for a label and one for an RGB color for the training area. c- When I press the image a point is created but how can I define the boundaries of the centroid? First digitize the boundary. Here you need not enter any attributes. The cat values are also not relevant. NExt digitize a centroid inside each boundary. Give each centroid a cat value that matches the type of training area. So all the forests will be i.e cat=1, and all the urban will be i.e cat=10, etc. Thanks Jenny On Wed, Jun 9, 2010 at 7:06 PM, Micha Silver mi...@arava.co.il wrote: polygon to a certain category? This indeed is not obvious. What I've done is change the category mode from Next not used to Manual entry. This is set in the lower part of the v.digit window (in tcltk interface). Now each time you digitize a *centroid* for a training area, set its cat value to some standard value you choose. For example, you might decide: train_areacat forest 1 agriculture2 urban 9 water 10 Now for each training polygon which is a forest, set the cat value of its centroid to 1, agri areas will get value 2, and so on for all the centroids of all the training polygons. (Note that the cat values for the boundary lines are pretty much irrelevant in GRASS's vector model). When you're done digitizing training areas, you might add another column or two to the attrib table for the training areas -
[GRASS-user] v.rast.stats
Hi It is still giving me -NULL value error. Do you think maybe its the way I downloaded my rainfall data? This is the site where I downloaded my data sets* ftp://trmmopen.gsfc.nasa.gov/pub/gis/ *and this data covers the whole world, the only thing I did was to clip a specific region (using coordinates) that is in South Africa to do my analysis. I used a bash script to download and project the data, see below: #!/bin/bash wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw gdal_translate -of GTiff -co PROFILE=GeoTIFF -co INTERLEAVE=PIXEL -co COMPRESS=LZW -co TILED=YES -a_srs EPSG:4326 -a_ullr 18.2987501 -33.6795831 19.1712501 -34.3487498 3B42RT.2010032900.1day.tif TRMMLast1day.tif On Thu, Jun 17, 2010 at 8:41 AM, Sandile Gumede akasand...@gmail.comwrote: Hi It is still giving me -NULL value error. Do you think maybe its the way I downloaded my rainfall data? This is the site where I downloaded my data sets* ftp://trmmopen.gsfc.nasa.gov/pub/gis/ *and this data covers the whole world, the only thing I did was to clip a specific region (using coordinates) that is in South Africa to do my analysis. I used a bash script to download and project the data, see below: #!/bin/bash wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tif wget ftp://trmmopen.gsfc.nasa.gov/pub/gis/3B42RT.2010032900.1day.tfw gdal_translate -of GTiff -co PROFILE=GeoTIFF -co INTERLEAVE=PIXEL -co COMPRESS=LZW -co TILED=YES -a_srs EPSG:4326 -a_ullr 18.2987501 -33.6795831 19.1712501 -34.3487498 3B42RT.2010032900.1day.tif TRMMLast1day.tif 2010/6/15 Micha Silver mi...@arava.co.il On 15/06/2010 14:35, Sandile Gumede wrote: Hi If I run g.region rast=rainfall -p, I get: OK, what you've done here is change the current region to match the raster rainfall. Can you now try: v.rast.stats -c vect=catchments rast=rainfall pref=precip projection: 3 (Latitude-Longitude) zone: 0 datum: wgs84 ellipsoid: wgs84 north: 33:40:46.49916S south: 34:20:55.49928S west: 18:17:55.50036E east: 19:10:16.50036E nsres: 0:00:05.01875 ewres: 0:00:02.18125 rows: 480 cols: 1440 cells: 691200 and If I run r.univar rainfall, I get the following output: 100% total null and non-null cells: 691200 total null cells: 0 Of the non-null cells: -- n: 691200 minimum: 0 maximum: 3094 range: 3094 mean: 22.0228 mean of absolute values: 22.0228 standard deviation: 76.1639 variance: 5800.94 variation coefficient: 345.841 % sum: 15222164 On Tue, Jun 15, 2010 at 12:22 PM, Hamish hamis...@yahoo.com wrote: Micha wrote: The only unusual thing I notice above is that the resolution settings for the raster are different N-S and E-W. This came from the original tiff (see below) which also has rectangular pixels, that is perfectly normal for a lat/lon map away from the equator. longitude scales a cos(lat). (the v.rast.stats module creates a temp raster at the *current region's resolution* settings, which might be different from this rainfall raster's rectangular resolution...) the results of: g.region -p rast=mapname r.univar mapname could help. Hamish -- Kind Regards TS Gumede CSIR, Meraka Institute 072 258 1650 This mail was received via Mail-SeCure System. -- Micha Silverhttp://www.surfaces.co.il/ Arava Development Co. +972-52-3665918 -- Kind Regards TS Gumede CSIR, Meraka Institute 072 258 1650 -- Kind Regards TS Gumede CSIR, Meraka Institute 072 258 1650 ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] Compiling r.seg
Hi there I have tried to compile r.seg, a Segmentation developed by Trento University. I Know this is not part of GRASS6.4 and not even an addon but can you help me on this? (where I got the module http://www.ing.unitn.it/~grass/) This is the command:sudo make -C r.seg MODULE_TOPDIR=/usr/local/grass-6.4.0svn The output: make: Entering directory `/home/knrr/Desktop/GRASS_dvp/r.seg' aseglib make[1]: Entering directory `/home/knrr/Desktop/GRASS_dvp/r.seg/aseglib' make[1]: Leaving directory `/home/knrr/Desktop/GRASS_dvp/r.seg/aseglib' src make[1]: Entering directory `/home/knrr/Desktop/GRASS_dvp/r.seg/src' gcc -L/usr/local/grass-6.4.0svn/lib -Wl,--export-dynamic -Wl,-rpath-link,/usr/local/grass-6.4.0svn/lib-o /usr/local/grass-6.4.0svn/bin/r.seg OBJ.i686-pc-linux-gnu/main.o -laseg -lgrass_gis -lgrass_datetime -lz -lm -lz make htmlcmd make[2]: Entering directory `/home/knrr/Desktop/GRASS_dvp/r.seg/src' make /usr/local/grass-6.4.0svn/docs/html/r.seg.html HTMLSRC=/usr/local/grass-6.4.0svn/bin/r.seg make[3]: Entering directory `/home/knrr/Desktop/GRASS_dvp/r.seg/src' if [ /usr/local/grass-6.4.0svn/bin/r.seg != ] ; then GISRC=/usr/local/grass-6.4.0svn/demolocation/grassrc64 GISBASE=/usr/local/grass-6.4.0svn PATH=/usr/local/grass-6.4.0svn/bin:$PATH LD_LIBRARY_PATH=/usr/local/grass-6.4.0svn/bin:/usr/local/grass-6.4.0svn/lib: LC_ALL=C /usr/local/grass-6.4.0svn/bin/r.seg --html-description /dev/null | grep -v '/body\|/html' r.seg.tmp.html ; true ; fi /usr/local/grass-6.4.0svn/tools/mkhtml.sh r.seg ; mkdir -p /usr/local/grass-6.4.0svn/docs/html ; /usr/bin/install -c -m 644 r.seg.tmp.html /usr/local/grass-6.4.0svn/docs/html/r.seg.html ; for file in *.png *.jpg ; do head -n 1 $file | grep '^#!' /dev/null ; if [ $? -ne 0 ] ; then /usr/bin/install -c -m 644 $file /usr/local/grass-6.4.0svn/docs/html ; fi done 2 /dev/null ; true make[3]: Leaving directory `/home/knrr/Desktop/GRASS_dvp/r.seg/src' make[2]: Leaving directory `/home/knrr/Desktop/GRASS_dvp/r.seg/src' make mancmd make[2]: Entering directory `/home/knrr/Desktop/GRASS_dvp/r.seg/src' make /usr/local/grass-6.4.0svn/man/man1/r.seg.1 MANSRC=/usr/local/grass-6.4.0svn/docs/html/r.seg.html make[3]: Entering directory `/home/knrr/Desktop/GRASS_dvp/r.seg/src' mkdir -p /usr/local/grass-6.4.0svn/man/man1 GRASS_PERL=/usr/bin/perl VERSION_NUMBER=6.4.0svn sh /usr/local/grass-6.4.0svn/tools/g.html2man/g.html2man /usr/local/grass-6.4.0svn/docs/html/r.seg.html /usr/local/grass-6.4.0svn/man/man1/r.seg.1 1 sh: Can't open /usr/local/grass-6.4.0svn/tools/g.html2man/g.html2man make[3]: *** [/usr/local/grass-6.4.0svn/man/man1/r.seg.1] Error 2 make[3]: Leaving directory `/home/knrr/Desktop/GRASS_dvp/r.seg/src' make[2]: *** [mancmd] Error 2 make[2]: Leaving directory `/home/knrr/Desktop/GRASS_dvp/r.seg/src' make[1]: *** [cmd] Error 2 make[1]: Leaving directory `/home/knrr/Desktop/GRASS_dvp/r.seg/src' make: Leaving directory `/home/knrr/Desktop/GRASS_dvp/r.seg' Does it seems to all ok? At my GRASS binary folder I don't have an executable (application/x-executable) but a KSeg document (application/x-kseg) that can be runned from GRASS. Is this normal/expected? Thanks Katrin ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] scripts
Hi I'm not familiar with bash scripting, I want to write a script that starts GRASS and create a new LOCATION and a MAPSET, specify the coordinate system for my database, specify a geodetic datum for the LOCATION, import datasets into the GRASS, do watershed analysis on the DEM data set, convert DEM raster into vector, and then calculate univariate statistics from a GRASS raster map. Can you guys help me with this? I tried to write a script and I got stucked, see below: #!/bin/sh #variable to customize: # path to GRASS software main directory GISBASE=/usr/bin/grass64 # path to GRASS database GISDBASE=$HOME/grassdem # nothing to change below #MAP=PERMANENT #LOCATION=SRTMDEM # generate temporal LOCATION: LOCATION=srtmdem mkdir -p $GISDBASE/$LOCATION/PERMANENT # save existing $HOME/.grassrc6 if test -e $HOME/.grassrc6 ; then mv $HOME/.grassrc6 /$HOME/grassdem/$LOCATION.grassrc6 fi echo LOCATION_NAME: $LOCATION $HOME/.grassrc6 echo MAPSET:tmp $HOME/.grassrc6 echo DIGITIZER: none $HOME/.grassrc6 echo GISDBASE: $GISDBASE $HOME/.grassrc6 export GISBASE=$GISBASE -- Kind Regards TS Gumede CSIR, Meraka Institute 072 258 1650 ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Compiling r.seg
Hi, I compiled r.seg in grass 6.5 (Ubuntu 10.04) but it must be the same in grass 6.4. Just copy r.seg directory to the raster subdirectory of the grass source code tree. cd /usr/local/grass-6.4.0svn/ratster/r.seg make when done... cd /usr/local/grass-6.4.0svn make sudo make install. Hope it helps On 06/17/2010 08:22 AM, katrin eggert wrote: Hi there I have tried to compile r.seg, a Segmentation developed by Trento University. I Know this is not part of GRASS6.4 and not even an addon but can you help me on this? (where I got the module http://www.ing.unitn.it/~grass/ http://www.ing.unitn.it/%7Egrass/) This is the command:sudo make -C r.seg MODULE_TOPDIR=/usr/local/grass-6.4.0svn The output: make: Entering directory `/home/knrr/Desktop/GRASS_dvp/r.seg' aseglib make[1]: Entering directory `/home/knrr/Desktop/GRASS_dvp/r.seg/aseglib' make[1]: Leaving directory `/home/knrr/Desktop/GRASS_dvp/r.seg/aseglib' src make[1]: Entering directory `/home/knrr/Desktop/GRASS_dvp/r.seg/src' gcc -L/usr/local/grass-6.4.0svn/lib -Wl,--export-dynamic -Wl,-rpath-link,/usr/local/grass-6.4.0svn/lib-o /usr/local/grass-6.4.0svn/bin/r.seg OBJ.i686-pc-linux-gnu/main.o -laseg -lgrass_gis -lgrass_datetime -lz -lm -lz make htmlcmd make[2]: Entering directory `/home/knrr/Desktop/GRASS_dvp/r.seg/src' make /usr/local/grass-6.4.0svn/docs/html/r.seg.html HTMLSRC=/usr/local/grass-6.4.0svn/bin/r.seg make[3]: Entering directory `/home/knrr/Desktop/GRASS_dvp/r.seg/src' if [ /usr/local/grass-6.4.0svn/bin/r.seg != ] ; then GISRC=/usr/local/grass-6.4.0svn/demolocation/grassrc64 GISBASE=/usr/local/grass-6.4.0svn PATH=/usr/local/grass-6.4.0svn/bin:$PATH LD_LIBRARY_PATH=/usr/local/grass-6.4.0svn/bin:/usr/local/grass-6.4.0svn/lib: LC_ALL=C /usr/local/grass-6.4.0svn/bin/r.seg --html-description /dev/null | grep -v '/body\|/html' r.seg.tmp.html ; true ; fi /usr/local/grass-6.4.0svn/tools/mkhtml.sh r.seg ; mkdir -p /usr/local/grass-6.4.0svn/docs/html ; /usr/bin/install -c -m 644 r.seg.tmp.html /usr/local/grass-6.4.0svn/docs/html/r.seg.html ; for file in *.png *.jpg ; do head -n 1 $file | grep '^#!' /dev/null ; if [ $? -ne 0 ] ; then /usr/bin/install -c -m 644 $file /usr/local/grass-6.4.0svn/docs/html ; fi done 2 /dev/null ; true make[3]: Leaving directory `/home/knrr/Desktop/GRASS_dvp/r.seg/src' make[2]: Leaving directory `/home/knrr/Desktop/GRASS_dvp/r.seg/src' make mancmd make[2]: Entering directory `/home/knrr/Desktop/GRASS_dvp/r.seg/src' make /usr/local/grass-6.4.0svn/man/man1/r.seg.1 MANSRC=/usr/local/grass-6.4.0svn/docs/html/r.seg.html make[3]: Entering directory `/home/knrr/Desktop/GRASS_dvp/r.seg/src' mkdir -p /usr/local/grass-6.4.0svn/man/man1 GRASS_PERL=/usr/bin/perl VERSION_NUMBER=6.4.0svn sh /usr/local/grass-6.4.0svn/tools/g.html2man/g.html2man /usr/local/grass-6.4.0svn/docs/html/r.seg.html /usr/local/grass-6.4.0svn/man/man1/r.seg.1 1 sh: Can't open /usr/local/grass-6.4.0svn/tools/g.html2man/g.html2man make[3]: *** [/usr/local/grass-6.4.0svn/man/man1/r.seg.1] Error 2 make[3]: Leaving directory `/home/knrr/Desktop/GRASS_dvp/r.seg/src' make[2]: *** [mancmd] Error 2 make[2]: Leaving directory `/home/knrr/Desktop/GRASS_dvp/r.seg/src' make[1]: *** [cmd] Error 2 make[1]: Leaving directory `/home/knrr/Desktop/GRASS_dvp/r.seg/src' make: Leaving directory `/home/knrr/Desktop/GRASS_dvp/r.seg' Does it seems to all ok? At my GRASS binary folder I don't have an executable (application/x-executable) but a KSeg document (application/x-kseg) that can be runned from GRASS. Is this normal/expected? Thanks Katrin ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] Re: Compiling r.seg
Hello Leonardo It wAs more or less what I have done. Thanks... My only question was related with binary file because it's slightly different from the others.. Regarding r.seg usability: have you tried/used? I'm having some difficulties in using and parameterizing and there is not much information about it. Do you have any additional information? Thanks Katrin ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] Import, project
Hi, I am new to grass and don't really know where to start. Please give me some hints on 1) how to import+project a vector-shapefile (containing one layer of non-overlapping administrative regions) with unknown projection+coordinate-system into a database with latitude/longitude 2) how to import+project a e00-rasterfile into the same database (containing rasterpoints 1kmx1km, each with one scalar property) 3) how to export an ascii/excel/csv-list of every raster-point with a) the corresponding scalar and b) the administrative region and c) the coordinates lat/long of the raster-point I could not import because the files be imported have a different coordinate system and import was refused because of that. I tried to google for a commandline/gui-program that reprojects, found a few like shpproj, g.proj, m.proj, none of which seem to have anything to do with reprojecting a shape-file. I use grass 6.4 on windows (linux is fine too) and have already created a workspace fitted for germany with lat/long-coordinates in an appropriate resolution. Thanks stn ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Import, project
stn wrote: I am new to grass and don't really know where to start. here is a good place: http://grass.osgeo.org/wiki/GRASS_Help also the GRASS book is very good. also Markus's quick intro guides: http://grass.osgeo.org/grass64/manuals/html64_user/index.html Please give me some hints on 1) how to import+project a vector-shapefile (containing one layer of non-overlapping administrative regions) with unknown projection+coordinate-system into a database with latitude/longitude these should help: http://grass.osgeo.org/wiki/Importing_data http://grass.osgeo.org/grass64/manuals/html64_user/projectionintro.html you have to create a GRASS Location for each source map projection, then pull them all into the target Location with r.proj or v.proj. 2) how to import+project a e00-rasterfile into the same database (containing rasterpoints 1kmx1km, each with one scalar property) not sure, v.in.e00 handles the vector side, probably r.in.gdal does the raster side. 3) how to export an ascii/excel/csv-list of every raster-point with a) the corresponding scalar and b) the administrative region and c) the coordinates lat/long of the raster-point r.out.xyz, or r.to.vect + v.out.ascii maybe with some other custom magic along the way. I could not import because the files be imported have a different coordinate system and import was refused because of that. I tried to google for a commandline/gui-program that reprojects, found a few like shpproj, g.proj, m.proj, none of which seem to have anything to do with reprojecting a shape-file. you were close, v.proj and r.proj are the two. v.proj for an imported shapefile (v.in.ogr to import it). maps must import into a location of their natural projection and be reprojected from there. from the command line GDAL's ogr2ogr and gdalwarp can reproject shapefiles and GeoTiffs etc directly. I use grass 6.4 on windows (linux is fine too) and have already created a workspace fitted for germany with lat/long-coordinates in an appropriate resolution. ok. when importing maps GRASS generally ignores the current region settings and uses the data's natural bounds and resolution. Hamish ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Import, project
On 06/17/2010 08:59 PM, stn wrote: Hi, I am new to grass and don't really know where to start. With the man pages ;-) Please give me some hints on 1) how to import+project a vector-shapefile (containing one layer of non-overlapping administrative regions) with unknown projection+coordinate-system into a database with latitude/longitude If you don't know the projection of the source layer, you're pretty much out of luck. There's no way GRASS (or any GIS for that matter) can use geographic data without knowing its CRS. No *.prj attached to the shapefile?? Does it overlap correctly with other layers of known CRS?? 2) how to import+project a e00-rasterfile into the same database (containing rasterpoints 1kmx1km, each with one scalar property) I'm not sure about e00 raster. I think you have to import as a vector then convert to raster, so: v.in.e00 then use one of the interpolation modules (i.e. v.surf.rst) Another way might be to use ogr2ogr to convert the e00 file to an ascii grid, then import that as a raster. 3) how to export an ascii/excel/csv-list of every raster-point with a) the corresponding scalar and b) the administrative region and c) the coordinates lat/long of the raster-point r.out.xyz does that I could not import because the files be imported have a different coordinate system and import was refused because of that. I tried to google for a commandline/gui-program that reprojects, found a few like shpproj, g.proj, m.proj, none of which seem to have anything to do with reprojecting a shape-file. If you do find the correct projection of the original shapefile, then you'll need to create two GRASS locations: one defined by the projection of the shapefile, and the second defined by Lon/Lat WGS84 . Then you * import the shapefile into the Location that matches its projection * switch to the target (WGS84) Location * and from there, you run v.proj to reproject into the target projection. I use grass 6.4 on windows (linux is fine too) and have already created a workspace fitted for germany with lat/long-coordinates in an appropriate resolution. Keep us posted on your progress. Thanks stn This mail was received via Mail-SeCure System. ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user This mail was received via Mail-SeCure System. -- Micha Silver Arava Development Co. +972-52-3665918 http://surfaces.co.il ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Import, project
2) how to import+project a e00-rasterfile into the same database (containing rasterpoints 1kmx1km, each with one scalar property) This solution may not help if ESRI software is inaccessible, but perhaps the maintainer of the .e00 data can do this conversion for you. I verified it does work (I cant locate how to import a raster .e00). The raster ascii .e00 uses different formatting than an export from ArcToolbox using Raster to ASCII. I imported a raster .e00 in ArcToolbox to an arc/info GRID, then exported it to an ASCII file with the ArcCatalog tool Raster to ASCII. This exported raster ASCII data can be directly imported into GRASS with the r.in.arc module. I also noticed that if you tail the last portion of the raster .e00 file ($ tail -n 50 someFile.e00), you can see the projection definition information, which helps to setup the right location in GRASS for importing. Note: you will only see the definition if a user applied the definition. Apologies in advance for a non-open source solution, but I hope can help if there are no other options. Mark ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Using Tck/tk vector digitizer for training areas
On 06/17/2010 12:36 PM, Jenny Turner wrote: Thanks Micha for your help but I got an error while doing this 1- Create new empty vectorial 2- run v.db.addtable command that you kindly sent me 3- use v.digit as defined previously 4- Inside tcltk's digitizing menu select Digitize new Centroid 5- Leave layer as 1 6- Change Mode to Manual Entry 7- First digitize boundary (by selecting boundary) by selecting points with left-mouse-button and close polygon with right-mouse-button 8- A panel with FORM title appears with a tab saying Attributes saying: New record was created saying CAT : 1 (this cat refers to the land cover category right?); train_lbl value and GRASSRGB; 9- I place the values (water,1) for train_lbl and GRASSRGB 10- a box ask me for ASSUME DATA ENCODING AS a list appears. I should select which one? ASCII? 11- In trhis case I select ASCII and press SUBMIT. In the bottom of that box Record successfully updated appeared. 12- Insert centroid-1 and press submit in Form panel 13- Did the same for a few more polygons of cat 1 14- Did the same for a few more polygons of cat 2 and 3 15- Pressed Save and Exit Then I realized that at my v.digit panel command output I had this warning in there: *Could not set Tcl system encoding to 'ascii' (unknown encoding ascii)* *Unable to read vector map* Questions: 1- Is this the right procedure? Yes. I'd just add one thing that might make the work easier. You don't need to enter the label and GRASSRGB for each centroid. Just leave them blank. Then, when you're all finished digitizing, you can run an update such as: echo 'UPDATE vector06 SET train_lbl=Forest WHERE cat=1' | db.execute echo 'UPDATE vector06 SET GRASSRGB=0:255:0 WHERE cat=1' | db.execute (The second line will set the GRASSRGB column to green ) 2- What encoding should I use? Perhaps try Latin1 3- Regarding GRASSRGB field, what information usually you place in there? Color code or color description? The format is a text string containing three numbers =255 separated by ':'. So i.e. 128:128:128 is medium gray. 4- For Supervised classification algorithms in GRASS, Vector type (accessible by using Query raster/vector tool) should be Boundary? Because, for instance, if I press a defined boundary, in some places I get Type: AREA and in others: Boundary (as shown bellow) AFAIK, each of the classification algorithms needs a *raster* map of training areas. So your next step, after finishing the vector map of training areas, will be to convert it to raster. So you'll be doing something like: v.to.rast vector06 out=train06 use=cat type=area Now the cat value that will be used for each raster pixels inside a vector area is the cat value of the *centroid*. Again, the boundary in GRASS's topological vector structure is not relevant to the enclosed area's attributes. You can, if you want, give the boundary the same cat value, and same GRASSRGB as the centroid. Then, if you use this column to color the vector when displaying the map, the boundary and the filled area will be in the same color. But for classification, when you convert the vector training areas to raster, what will be used is the *centroid* cat value. (...) Map: vector06 Mapset: landsat Type: Boundary Id: 9 Layer: 1 Category: 3 Driver: dbf Database: C:\GRASS6\grassdata/North-Carolina/landsat/dbf/ Table: vector06 Key column: cat cat : 3 train_lbl : urban GRASSRGB : 3 (Thu Jun 17 10:34:04 2010) Command finished (0 sec) (Thu Jun 17 10:34:06 2010) v.what --q -a map=vecto...@landsat east_north=639279.744997,227730.071998 (...) Map: vector06 Mapset: landsat Type: Area Sq Meters: 2158429.741 Hectares: 215.843 Acres: 533.360 Sq Miles: 0.8334 Layer: 1 Category: 3 Driver: dbf Database: C:\GRASS6\grassdata/North-Carolina/landsat/dbf/ Table: vector06 Key column: cat cat : 3 train_lbl : urban GRASSRGB : 3 Thanks for your help and support Jenny On Wed, Jun 16, 2010 at 7:59 PM, Micha Silver mi...@arava.co.il mailto:mi...@arava.co.il wrote: On 06/16/2010 06:55 PM, Jenny Turner wrote: Hi Micha and GRASS-users/list Let me see if I get this straight 1- use v.digit (e.g. v.digit -n map=vector00 bgcmd=d.rast map=lsat5_1987_40 ) 2- Inside tcltk's digitizing menu select Digitize new Centroid 3- Leave layer as 1? 4- Change Mode to Manual Entry? All the above looks good. 5- And for each Centroid I select a Cat right? Yes, always using the *same* cat for training areas of the same type. (Is this the proceeding?) About this, I have two questions: a- I have to leave Insert New record into table checked right? Yes b- After I left Insert New record into table checked, Layer 1 and Cat 1 and Mode: Manual Entry, when I presss in the image a Error Window appeared stating: Database table for this layer is not defined. Where shall i define the database table for a new vectorial that I digitizing? Ah, v.db.addtable vector00 col=train_lbl varchar(16),
[GRASS-user] how to get raster region corresponding to vector polygon region?
Hello, I have a raster map (dem) and I want to select a region of the raster corresponding to a polygon that is in a vector map. What is the best way to do this? It looks like r.in.poly might be along the lines of what I need but in that case I think I would need to generate the ascii poly file first but I'm wondering if there is a better way? Seems like there should be a single command to do this. My vector map has 45 polygons with cat values 1..45, so I would like to get a section from my raster map corresponding to one of the polygons specified by cat value. appreciate any help! thanks, ken ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Import, project
2010/6/17 Hamish hamis...@yahoo.com you have to create a GRASS Location for each source map projection, then pull them all into the target Location with r.proj or v.proj. Hi Hamish, thanks for the infos. Here is one thing I can't get into my head. First there is the problem that I do not know the coordinates and projection etc of the two files mentioned. Of course I can go to someone with esri-software and ask him to check that for me. But in my (apparently very naive) view I this is completely not the point. If I have to use esri anyway then why bother taking data into grass ?? What I would think is this: If I can find out the projection/coordinates etc of the shapefile by any manual means then this info MUST BE included in the shapefile itself. Along with the actual geodata. More so the import-program within grass cannot import even a single byte without thorough knowledge of the imported format, but i seems that it can only read objects but not their coordinate-system. So: If all the info is already in the shapefile there then why 1) do I have to manually find it by some way outside grass and 2) why doesn't the import-program simply read that info from the file, read the coordinates and projection from the current location and the call the appropriate projection-program to reproject the imported file to fit the current location. All the infos (proj/coord/bounds/etc) of import and target are there (says the naive man :-) , the sequence of operations is completely obvious and always exactly the same and yet everything has to be done manually. If I want to recode a moviefile to another format I tell the encoder what I want to have as an output and the encoder then looks by itself what format the original has. What is different about geodata ? I don't really mind doing that for one map. But somehow I expect lots more maps from different sources being added later and each one causing lots of work. What is it I don't understand here? 3) how to export an ascii/excel/csv-list of every raster-point with a) the corresponding scalar and b) the administrative region and c) the coordinates lat/long of the raster-point r.out.xyz, or r.to.vect + v.out.ascii maybe with some other custom magic along the way. Thanks, that sounds promising. I will try ASAP. from the command line GDAL's ogr2ogr and gdalwarp can reproject shapefiles and GeoTiffs etc directly. Tried that (on ubuntu) : u...@nb ~ $ gdalwarp file1.shp file1.out ERROR 4: `file1.shp' not recognised as a supported file format. and: gdalwrap --formats lists 88 formats including a few from esri, but no shapefile. stn ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] Re: how to get raster region corresponding to vector polygon region?
Kwas wrote: Hello, I have a raster map (dem) and I want to select a region of the raster corresponding to a polygon that is in a vector map.nbsp; What is the best way to do this?nbsp; It looks like r.in.poly might be along the lines of what I need but in that case I think I would need to generate the ascii poly file first but I'm wondering if there is a better way?nbsp; Seems like there should be a single command to do this. My vector map has 45 polygons with cat values 1..45,nbsp; so I would like to get a section from my raster map corresponding to one of the polygons specified by cat value. appreciate any help! thanks, ken ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user Hello Ken, I am also new to GRASS, but I have been doing what you want quite a lot these days. There is probably a better way to do that (and I would like to hear it very much, specially if there is a single command to do this), but for now, I think the code below does the job: g.region vect=your_vector v.extract input=your_vector output=selected_polygon type=area where=cat=desired_cat v.to.rast input=selected_polygon output=polygon_rasterized use=val type=area r.mask input=polygon_rasterized Now, any processing that you do will be applied only in the region corresponding to the selected polygon. If you want to create a raster corresponding to the selected polygon, just do: r.mapcalc new_raster=any_old_raster To take out the mask, just type: r.mask -r Hope this helps, Marcello. -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/how-to-get-raster-region-corresponding-to-vector-polygon-region-tp5192862p5193386.html Sent from the Grass - Users mailing list archive at Nabble.com. ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] Re: grass-user Digest, Vol 50, Issue 45
grass-user-requ...@lists.osgeo.org wrote: Send grass-user mailing list submissions to grass-user@lists.osgeo.org To subscribe or unsubscribe via the World Wide Web, visit http://lists.osgeo.org/mailman/listinfo/grass-user or, via email, send a message with subject or body 'help' to grass-user-requ...@lists.osgeo.org You can reach the person managing the list at grass-user-ow...@lists.osgeo.org When replying, please edit your Subject line so it is more specific than Re: Contents of grass-user digest... Today's Topics: 1. Re: Compiling r.seg (katrin eggert) 2. Import, project (stn) 3. Re: Import, project (Hamish) 4. Re: Import, project (Micha Silver) 5. Re: Import, project (Mark Seibel) 6. Re: Using Tck/tk vector digitizer for training areas (Micha Silver) -- Message: 1 Date: Thu, 17 Jun 2010 17:00:30 +0100 From: katrin eggert katrineggert1...@gmail.com Subject: [GRASS-user] Re: Compiling r.seg To: leohard...@gmail.com, GRASS user list grass-user@lists.osgeo.org Message-ID: aanlktimk_exguhbxsahyoeesotxd2mdun39unl2ok...@mail.gmail.com Content-Type: text/plain; charset=iso-8859-1 Hello Leonardo It wAs more or less what I have done. Thanks... My only question was related with binary file because it's slightly different from the others.. Regarding r.seg usability: have you tried/used? I'm having some difficulties in using and parameterizing and there is not much information about it. Do you have any additional information? Thanks Katrin -- next part -- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20100617/de65f9ec/attachment-0001.html -- Message: 2 Date: Thu, 17 Jun 2010 19:59:18 +0200 From: stn stneum...@web.de Subject: [GRASS-user] Import, project To: grass-user@lists.osgeo.org, stneum...@web.de Message-ID: aanlktil6pbzhowiyylnn9vrnp1kije4a9qmlvy0nl...@mail.gmail.com Content-Type: text/plain; charset=iso-8859-1 Hi, I am new to grass and don't really know where to start. Please give me some hints on 1) how to import+project a vector-shapefile (containing one layer of non-overlapping administrative regions) with unknown projection+coordinate-system into a database with latitude/longitude If you're really stuck on the vector's projection, import it into a flat location (using the import into new location option), then georectify it against a map with known projection. However, I should warn that the interfaces for rectifying vectors can be confusing for the first-timer. Richard ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Import, project
(Apologies for the interference...) Hamish: you have to create a GRASS Location for each source map projection, then pull them all into the target Location with r.proj or v.proj. stn wrote: Hi Hamish, thanks for the infos. Here is one thing I can't get into my head. First there is the problem that I do not know the coordinates and projection etc of the two files mentioned. Of course I can go to someone with esri-software and ask him to check that for me. Shapefiles are build up by various files normally (not only one). Check if you have the .shx _and_ the one with extension .prj. If I am not wrong even under @rc-gis the .prj is required to work properly. But in my (apparently very naive) view I this is completely not the point. If I have to use esri anyway then why bother taking data into grass ?? There are several reasons why one can/should use grass. Long discussion. To make the long story short, there are links which might be of your interest [1] [2][3]. If you are convinced that F(L)OSS is the way to go, then you have a *STRONG* reason to stick with grass and/or other open geo-spatial tools. What I would think is this: If I can find out the projection/coordinates etc of the shapefile by any manual means then this info MUST BE included in the shapefile itself. Along with the actual geodata. I think these infos are not integrated in the file. More so the import-program within grass cannot import even a single byte without thorough knowledge of the imported format, but i seems that it can only read objects but not their coordinate-system. grass-gis (in its entirety) is strict and clean, an honest friend which you can rely on, discuss, learn and find the way. So: If all the info is already in the shapefile there then why 1) do I have to manually find it by some way outside grass and 2) why doesn't the import-program simply read that info from the file, read the coordinates and projection from the current location and the call the appropriate projection-program to reproject the imported file to fit the current location. All the infos (proj/coord/bounds/etc) of import and target are there (says the naive man :-) It would useful/helpful to feed the list with the actual information (filenames for example) that are beforehand. If those are there (as separate files, which is the way they should exist) then it should fairly easy and strait to import the data clean(ly) in grass' database. , the sequence of operations is completely obvious and always exactly the same and yet everything has to be done manually. If I want to recode a moviefile to another format I tell the encoder what I want to have as an output and the encoder then looks by itself what format the original has. What is different about geodata ? I don't really mind doing that for one map. But somehow I expect lots more maps from different sources being added later and each one causing lots of work. What is it I don't understand here? 3) how to export an ascii/excel/csv-list of every raster-point with a) the corresponding scalar and b) the administrative region and c) the coordinates lat/long of the raster-point r.out.xyz, or r.to.vect + v.out.ascii maybe with some other custom magic along the way. Thanks, that sounds promising. I will try ASAP. from the command line GDAL's ogr2ogr and gdalwarp can reproject shapefiles and GeoTiffs etc directly. Tried that (on ubuntu) : u...@nb ~ $ gdalwarp file1.shp file1.out ERROR 4: `file1.shp' not recognised as a supported file format. and: gdalwrap --formats lists 88 formats including a few from esri, but no shapefile. hint: check the output of ogrinfo --formats ( gdal is a library of tools that handle raster data [4]. ogr tools are for vector stuff [5]. ) Good luck, Nikos --- [1] http://grass.osgeo.org/intro/firsttime.php [2] http://www.gnu.org/philosophy/categories.html [3] http://www.dwheeler.com/oss_fs_why.html [4] http://www.gdal.org/ and http://www.gdal.org/gdal_utilities.html [5] http://www.gdal.org/ogr/ and http://www.gdal.org/ogr_utilities.html ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
RE: [GRASS-user] Import, project [SEC=PERSONAL]
Nikos Alexandris wrote: If I am not wrong even under @rc-gis the .prj is required to work properly. No, the .prj is not required but without it the dataset's coordinate system is undefined. The .prj file for a shapefile is in WKT (well known text) format, and generally the coordinate system details should be easily identifiable. - These thoughts are mine alone! - Andrew MacIntyre Operations Branch tel: +61 2 6219 5356 Communications Infrastructure Division fax: +61 2 6253 3277 Australian Communications Media Authority email: andrew.macint...@acma.gov.au http://www.acma.gov.au/ -Original Message- From: grass-user-boun...@lists.osgeo.org [mailto:grass-user- boun...@lists.osgeo.org] On Behalf Of Nikos Alexandris Sent: Friday, 18 June 2010 10:39 AM To: grass-user@lists.osgeo.org Subject: Re: [GRASS-user] Import, project (Apologies for the interference...) Hamish: you have to create a GRASS Location for each source map projection, then pull them all into the target Location with r.proj or v.proj. But in my (apparently very naive) view I this is completely not the point. If I have to use esri anyway then why bother taking data into grass ?? There are several reasons why one can/should use grass. Long discussion. To make the long story short, there are links which might be of your interest [1] [2][3]. If you are convinced that F(L)OSS is the way to go, then you have a *STRONG* reason to stick with grass and/or other open geo-spatial tools. What I would think is this: If I can find out the projection/coordinates etc of the shapefile by any manual means then this info MUST BE included in the shapefile itself. Along with the actual geodata. I think these infos are not integrated in the file. More so the import-program within grass cannot import even a single byte without thorough knowledge of the imported format, but i seems that it can only read objects but not their coordinate-system. grass-gis (in its entirety) is strict and clean, an honest friend which you can rely on, discuss, learn and find the way. So: If all the info is already in the shapefile there then why 1) do I have to manually find it by some way outside grass and 2) why doesn't the import-program simply read that info from the file, read the coordinates and projection from the current location and the call the appropriate projection-program to reproject the imported file to fit the current location. All the infos (proj/coord/bounds/etc) of import and target are there (says the naive man :-) It would useful/helpful to feed the list with the actual information (filenames for example) that are beforehand. If those are there (as separate files, which is the way they should exist) then it should fairly easy and strait to import the data clean(ly) in grass' database. , the sequence of operations is completely obvious and always exactly the same and yet everything has to be done manually. If I want to recode a moviefile to another format I tell the encoder what I want to have as an output and the encoder then looks by itself what format the original has. What is different about geodata ? I don't really mind doing that for one map. But somehow I expect lots more maps from different sources being added later and each one causing lots of work. What is it I don't understand here? 3) how to export an ascii/excel/csv-list of every raster-point with a) the corresponding scalar and b) the administrative region and c) the coordinates lat/long of the raster-point r.out.xyz, or r.to.vect + v.out.ascii maybe with some other custom magic along the way. Thanks, that sounds promising. I will try ASAP. from the command line GDAL's ogr2ogr and gdalwarp can reproject shapefiles and GeoTiffs etc directly. Tried that (on ubuntu) : u...@nb ~ $ gdalwarp file1.shp file1.out ERROR 4: `file1.shp' not recognised as a supported file format. and: gdalwrap --formats lists 88 formats including a few from esri, but no shapefile. hint: check the output of ogrinfo --formats ( gdal is a library of tools that handle raster data [4]. ogr tools are for vector stuff [5]. ) Good luck, Nikos --- [1] http://grass.osgeo.org/intro/firsttime.php [2] http://www.gnu.org/philosophy/categories.html [3] http://www.dwheeler.com/oss_fs_why.html [4] http://www.gdal.org/ and http://www.gdal.org/gdal_utilities.html [5] http://www.gdal.org/ogr/ and http://www.gdal.org/ogr_utilities.html ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user If you have received this email in error, please notify the sender immediately and erase all copies of the email and any attachments to it. The information contained in this email and any attachments
Re: [GRASS-user] Import, project
As others have said, a shapefile is composed of several other files (.shp, .shx, .dbf, .prj), each containing some different info. So, even though the polygons and points coordinates are inside the .shp file, you need to know the projection in order to know what those coordinates represent (lat/long, meters, yards etc...). Unfortunately, ESRI products will tolerate shapefiles without a specific projection description (.prj file). So, if you don't have the .prj file you can try some different approaches: 1) ask the data provider for the info 2) load the data against some other map with know projection. Here, I believe QGis will allow you to load shapefiles even if you don't have the prj file. So you will have to compare the data visually. Of course the values of the coordinates can give you some hints as to if you are working with UTM, lat/long etc... Cheers daniel On Thu, Jun 17, 2010 at 6:00 PM, stn stneum...@web.de wrote: 2010/6/17 Hamish hamis...@yahoo.com you have to create a GRASS Location for each source map projection, then pull them all into the target Location with r.proj or v.proj. Hi Hamish, thanks for the infos. Here is one thing I can't get into my head. First there is the problem that I do not know the coordinates and projection etc of the two files mentioned. Of course I can go to someone with esri-software and ask him to check that for me. But in my (apparently very naive) view I this is completely not the point. If I have to use esri anyway then why bother taking data into grass ?? What I would think is this: If I can find out the projection/coordinates etc of the shapefile by any manual means then this info MUST BE included in the shapefile itself. Along with the actual geodata. More so the import-program within grass cannot import even a single byte without thorough knowledge of the imported format, but i seems that it can only read objects but not their coordinate-system. So: If all the info is already in the shapefile there then why 1) do I have to manually find it by some way outside grass and 2) why doesn't the import-program simply read that info from the file, read the coordinates and projection from the current location and the call the appropriate projection-program to reproject the imported file to fit the current location. All the infos (proj/coord/bounds/etc) of import and target are there (says the naive man :-) , the sequence of operations is completely obvious and always exactly the same and yet everything has to be done manually. If I want to recode a moviefile to another format I tell the encoder what I want to have as an output and the encoder then looks by itself what format the original has. What is different about geodata ? I don't really mind doing that for one map. But somehow I expect lots more maps from different sources being added later and each one causing lots of work. What is it I don't understand here? 3) how to export an ascii/excel/csv-list of every raster-point with a) the corresponding scalar and b) the administrative region and c) the coordinates lat/long of the raster-point r.out.xyz, or r.to.vect + v.out.ascii maybe with some other custom magic along the way. Thanks, that sounds promising. I will try ASAP. from the command line GDAL's ogr2ogr and gdalwarp can reproject shapefiles and GeoTiffs etc directly. Tried that (on ubuntu) : u...@nb ~ $ gdalwarp file1.shp file1.out ERROR 4: `file1.shp' not recognised as a supported file format. and: gdalwrap --formats lists 88 formats including a few from esri, but no shapefile. stn ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Import, project [SEC=PERSONAL]
Nikos Alexandris wrote: If I am not wrong even under @rc-gis the .prj is required to work properly. On Friday 18 of June 2010 02:48:02 Andrew MacIntyre wrote: No, the .prj is not required but without it the dataset's coordinate system is undefined. The .prj file for a shapefile is in WKT (well known text) format, and generally the coordinate system details should be easily identifiable. Thanks for the correction. It's been some time that I have read the white paper about the Shapefile [1]. Cheers, Nikos --- [1] http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf Nice overview also at http://en.wikipedia.org/wiki/Shapefile ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Import, project
[...] On Friday 18 of June 2010 03:47:25 Daniel Victoria wrote: Of course the values of the coordinates can give you some hints as to if you are working with UTM, lat/long etc... --8--- For example, what is the output of ogrinfo Shapefile.shp -al -ro -so? Nikos ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Re: how to get raster region corresponding to vector polygon region?
Marcello wrote: There is probably a better way to do that (and I would like to hear it very much, specially if there is a single command to do this), but for now, I think the code below does the job: g.region vect=your_vector v.extract input=your_vector output=selected_polygon type=area where=cat=desired_cat v.to.rast input=selected_polygon output=polygon_rasterized use=val type=area r.mask input=polygon_rasterized another way (probably there are many), v.to.rast then a loop using r.reclass to make a temporary MASK map of each category, then g.region rast=rasterized_vect g.region zoom=rasterized_vect r.reclass are tiny virtual maps (ie very quick to create+remove), g.region zoom= starts at the current region and shrinks inward until it hits a non-NULL cell. Hamish ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user