Re: [GRASS-user] GRASS sites file

2010-05-18 Thread Hamish
Luisa wrote:
> What is a GRASS sites file? How can I obtain this?


a sites file is what vector points maps were called in earlier versions
of GRASS.

grass-addons/imagery/i.pr/TODO:
"""
This module set was developed for GRASS 5.

TODO:
- change to ANSI prototypes
- follow SUBMITTING rules
- change sites to vector
"""

There is a "cheap" coding option which supports the old sites API while
using new vector points maps. I don't know if these modules use that
or not. The real solution is to make them use the new vector API (not
so hard, documented into the wiki somewhere?).


Hamish



___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Problem importing vector

2010-05-18 Thread Kurt Springs
OKay,

That solved the problem

Thanks.

Kurt
On May 18, 2010, at 4:32 AM, Markus Metz wrote:

> Kurt Springs wrote:
>> I am having a problem importing a vector from a shape file.
>> 
>> I am am running:
>> 
>> v.in.ogr -o -e dsn=/Users/kurtsprings/grassdata/NED/03604870/03604870.shp 
>> output=steam_water min_area=0.0001 snap=-1 --overwrite
>> 
>> The message I get is:
>> 
>> Over-riding projection check
>> DBMI-SQLite driver error:
>> Unable to open database: unable to open database file
>> Unable to open database 
>>  by driver 
>> 
>> Unable open database  
>> by driver 
> 
>  is a
> directory, not a file. For sqlite, the database must be a file, e.g.
> sqlite.db. For dbf, the database must be a directory, e.g. dbf/
> 
> db.connect driver=sqlite database="$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite.db"
> 
> should fix it, check with db.connect -p, the result should be
> driver:sqlite
> database:$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite.db
> 
> Markus M
> 
>> 
>> Layer: 03604870
>> 
>> I switched the database driver to sqlite after I created the location and 
>> mapset, before I started importing anything.  Any ideas as to what the 
>> problem might be?
>> 
>> Kurt
>> ___
>> 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] US states and county layers?

2010-05-18 Thread Markus Neteler
On Tue, May 18, 2010 at 12:17 AM, Matthew Mulbrandon
 wrote:
> Hello,
>
> I was looking for grass layer with US states and US counties. Can't find
> using google but it must be around somewhere. Does anyone know where I can
> download this info or is it back to converting shp files.

I guess that you can get them here:
 http://www.nationalatlas.gov/atlasftp.html
as SHAPE files and then import with v.in.ogr into a location in
Lambert Azimuthal Equal-Area projection as I understand from here:
 http://www.nationalatlas.gov/articles/mapping/a_projections.html

Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Importing Landsat images with different coordinates

2010-05-18 Thread Micha Silver

Jenny Turner wrote:


Greetings
Firman, but imagine that I have rasters in UTM for differente zones 
(e.g. huge countries like USA, etc). How can I produce an automatic 
importing tool that uses gdalwarp to project an image to WGS84 and 
import to GRASS?
Using gdalwarp you don't have to specify the source coordinate system, 
*if* the originals have the correct projection defined in their headers. 
For Landsat images, this is most likely the case, so you should be able 
to get away with just setting the -t_srs option of gdalwarp and each 
tile will be re-projected to the WGS84 geographic CRS.



Thanks for your help
Best regards,
Jenny

On Mon, May 17, 2010 at 11:10 PM, Firman Hadi > wrote:


Hi,

As far as I know you must define the source coordinate system.
I think it is pretty straightforward when you are using gdalwarp.
If there are so many images, maybe you can create a shell script
to run the process.

Cheers,

>

Firman Hadi
Center for Remote Sensing - ITB
Jl. Ganesha No. 10,
Labtek IX-C, 3rd Floor
Bandung - 40132
INDONESIA
Phone: +62-22-2530701
Fax: +62-22-2530702
Website : http://crs.itb.ac.id ; www.sigro.org 
Blog : http://jalmiburung.wordpress.com
JepratJepret: http://jalmiburung.fotografer.net











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://www.surfaces.co.il


___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-dev] RE: [GRASS-user] Question with Python-SWIG example [SEC=UNCLASSIFIED]

2010-05-18 Thread Martin Landa
Hi,

2010/5/18 Glynn Clements :
> Odd. Can you try it under GDB and check what arguments
> G_find_raster2() is getting?
>
> Also, are you calling G_gisinit() first?

sample script below

---
#!/usr/bin/env python
import os, sys
from grass.lib import grass, raster
from ctypes import *

input = sys.argv[1]

grass.G_gisinit(sys.argv[0])

mapset = grass.G_find_raster2(input, "")
print mapset
---

Running

python example.py elevation

I get

D1/5: G_find_raster2(): name=�  ��� mapset=elevation
WARNING: Illegal filename <� ���>. Character <� not allowed.
�

Martin

-- 
Martin Landa  * http://gama.fsv.cvut.cz/~landa
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-dev] RE: [GRASS-user] Question with Python-SWIG example [SEC=UNCLASSIFIED]

2010-05-18 Thread Glynn Clements

Martin Landa wrote:

> > I've already replaced the SWIG bindings in 7.0 with the ctypesgen
> > version.
> 
> trying ctypesgen version I have problem with G_find_raster2()
> 
> mapset = grass.G_find_raster2("elevation", "")
> print mapset
> 
> WARNING: Illegal filename <�pT�>. Character <> not allowed.

Odd. Can you try it under GDB and check what arguments
G_find_raster2() is getting?

Also, are you calling G_gisinit() first?

-- 
Glynn Clements 
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Creation and managing Location/Mapset

2010-05-18 Thread Nikos Alexandris
Luisa Peña:
> I still have a few issues regarding this:
> 1- How can a region not to be a Square? If I have to set
> North/South/East/West boundaries?

By using a MASK will limit raster operations (within the MASK).

> 2- In my case, my mask is a Vectorial. Can I use a vectorial as a mask?

v.to.rast in=VectorMap out=RasterisedVectorMap use=value
r.mapcalc "MASK=RasterisedVectorMap"

Nikos
[...]
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] GRASS sites file

2010-05-18 Thread Luisa Peña
Greetings

I'm a ORFEO TOolbox user and I realized, through a few messages from Antonio
and Hamish, that GRASS has an addon module, called i.pr, that performs a few
classification methodologies.

The i.pr.training uses a interactive (based on Xterminals) and a
non-interactive based on (citing Description)
The second option for generating the training sample file can be done
non-interactively. This is done by specifying a GRASS sites file. This file
should represent the locations of training samples and ought to have been
previously generated either by digitising
(*v.digit
*) or else by 
*v.in.ascii
*. Features will be extracted for these locations in a similar fashion as
previously described. The class will be assigned to the examples based on
the information stored in the sites file.


What is a GRASS sites file? How can I obtain this?

Thanks

best regards,
Luisa
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] Adding a addon to the WinGRASS-OSGEO

2010-05-18 Thread Luisa Peña
Greetings
I'm using GRASS6.4 in OSGEO and I would like to add a GRASS'Addon to my
GRASS6.4. How can I do that?

Best regards,
Luisa
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-dev] RE: [GRASS-user] Question with Python-SWIG example [SEC=UNCLASSIFIED]

2010-05-18 Thread Martin Landa
Hi,

2010/5/16 Glynn Clements :
> I've already replaced the SWIG bindings in 7.0 with the ctypesgen
> version.

trying ctypesgen version I have problem with G_find_raster2()

mapset = grass.G_find_raster2("elevation", "")
print mapset

WARNING: Illegal filename <�pT�>. Character <> not allowed.
�

Martin

-- 
Martin Landa  * http://gama.fsv.cvut.cz/~landa
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] GRASS Script for importing data with different source_coordinates/projection

2010-05-18 Thread Hamish
Jenny wrote:
> This almost a follow-up from a previous message that I sent regarding
> Landsat-7 image importing.
> I need to develop a script to import images from
> multi-SOURCE_COORDINATE_SYSTEM to defined target_COORDINATE_SYSTEM
> (WGS84). Since my input images come from different UTM zones it won't be
> possible to import images using a pre-defined gdalwarp command to convert
> coordinate/projection systems, since source coordinates are more than one.
> Firman made suggestion of using a GRASS Script to read header and get 
> coordinate system.Has anyone developed something similar to this?

It is my understanding that gdalwarp will use the embedded source SRS
if it is present, and so all you need to specify is the -t_srs option
which does not change. -s_srs is only used if the source coord ref.
system either doesn't exist in the data or if you want to override it.

Is this not the case?


Hamish


  
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] GRASS Script for importing data with different source_coordinates/projection

2010-05-18 Thread Jenny Turner
Greetings

This almost a follow-up from a previous message that I sent regarding
Landsat-7 image importing.

I need to develop a script to import images from
multi-SOURCE_COORDINATE_SYSTEM to defined target_COORDINATE_SYSTEM (WGS84).
Since my input images come from different UTM zones it won't be possible to
import images using a pre-defined gdalwarp command to convert
coordinate/projection systems, since source coordinates are more than one.
Firman made suggestion of using a GRASS Script to read header and get
coordinate system.
Has anyone developed something similar to this?

Thyank you
Best regards,
Jenny
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Re: r.lake - starting from shell problem

2010-05-18 Thread Annalisa Minelli
An update:
Thanks to Glynn Clements, switching from 64 to 65 solved all my problems and
now my python script works fine on win XP too giving the command:

python "complete_path_to_the_script"+options

from the command line of the layer manager.
Otherwise I was unable to use the 70 GRASS version because of a strange
error at the end of the installation process:
I attach an image of my desktop.. maybe this is useful for devs.

http://img299.imageshack.us/img299/484/imagewx.png

Yours, Annalisa

2010/5/12 Annalisa Minelli 

> Many thanks Daniel,
> I gave a look at that thread few days ago but I didn't found an answer..
> maybe because I would like (if it's possible) not to build grass on windows
> and I supposed the 6.4 version was more "stable" than 7.
> But when I found that a similar problem on linux (and I know for sure
> problems on linux can be solved..) I had a hope to solve the same on win
> too.
>
> However, many thanks for the hints.
> I'll update you if I obtain something good.
>
> Yours, Annalisa.
>
>
> 2010/5/12 LeeDaniel 
>
>
>> Hey there,
>>
>> Sorry I don't have an answer, but maybe it contributes to the
>> understanding
>> of the problem:
>>
>> I've also had this exact same error message when trying to run my own
>> python
>> scripts from shell under Windows. The scripts seem to be fine, but GRASS
>> was
>> unable to use them. Somebody posted what I believe might be a solution, if
>> the problem's python-based, but I haven't tried it because I rewrote it as
>> a
>> shell script using Linux.
>>
>> Here's the thread:
>>
>> http://osgeo-org.1803224.n2.nabble.com/Problem-with-running-Python-script-in-GRASS-td5007296.html#a5007296
>>
>> -Daniel
>> --
>> View this message in context:
>> http://osgeo-org.1803224.n2.nabble.com/r-lake-starting-from-shell-problem-tp5035268p5040119.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 mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Importing Landsat images with different coordinates

2010-05-18 Thread Firman Hadi
Dear Jenny,

Yes, I am agree that will be such a huge work :D.
Actually I am not familiar with shell script but maybe I can imagine the 
workflow 
and perhaps someone in this list can help.

I think the algorithm of such script is:
1. Put all the imageries in one folder
2. Use gdalinfo command to read coordinate system on each file (looping command)
3. Rename each file according to its coordinate system (EPSG code)
4. Use gdalwarp command to convert each file (with specific naming convention) 
to WGS84

I don't know this will help :D

Regards,

Firman.
On 18 May 2010, at 15:29, Jenny Turner wrote:

> Greetings
> Firman, but imagine that I have rasters in UTM for differente zones (e.g. 
> huge countries like USA, etc). How can I produce an automatic importing tool 
> that uses gdalwarp to project an image to WGS84 and import to GRASS?
> Thanks for your help
> Best regards,
> Jenny
> 
> On Mon, May 17, 2010 at 11:10 PM, Firman Hadi  wrote:
> Hi,
> 
> As far as I know you must define the source coordinate system.
> I think it is pretty straightforward when you are using gdalwarp.
> If there are so many images, maybe you can create a shell script to run the 
> process.
> 
> Cheers,
> 
>> 
> 
> Firman Hadi
> Center for Remote Sensing - ITB
> Jl. Ganesha No. 10,
> Labtek IX-C, 3rd Floor
> Bandung - 40132
> INDONESIA
> Phone: +62-22-2530701
> Fax: +62-22-2530702
> Website : http://crs.itb.ac.id ; www.sigro.org
> Blog : http://jalmiburung.wordpress.com
> JepratJepret: http://jalmiburung.fotografer.net
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Problem importing vector

2010-05-18 Thread Markus Metz
Kurt Springs wrote:
> I am having a problem importing a vector from a shape file.
>
> I am am running:
>
> v.in.ogr -o -e dsn=/Users/kurtsprings/grassdata/NED/03604870/03604870.shp 
> output=steam_water min_area=0.0001 snap=-1 --overwrite
>
> The message I get is:
>
> Over-riding projection check
> DBMI-SQLite driver error:
> Unable to open database: unable to open database file
> Unable to open database 
>  by driver 
>
> Unable open database  
> by driver 

 is a
directory, not a file. For sqlite, the database must be a file, e.g.
sqlite.db. For dbf, the database must be a directory, e.g. dbf/

db.connect driver=sqlite database="$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite.db"

should fix it, check with db.connect -p, the result should be
driver:sqlite
database:$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite.db

Markus M

>
> Layer: 03604870
>
> I switched the database driver to sqlite after I created the location and 
> mapset, before I started importing anything.  Any ideas as to what the 
> problem might be?
>
> Kurt
> ___
> 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] Importing Landsat images with different coordinates

2010-05-18 Thread Jenny Turner
Greetings
Firman, but imagine that I have rasters in UTM for differente zones (e.g.
huge countries like USA, etc). How can I produce an automatic importing tool
that uses gdalwarp to project an image to WGS84 and import to GRASS?
Thanks for your help
Best regards,
Jenny

On Mon, May 17, 2010 at 11:10 PM, Firman Hadi  wrote:

> Hi,
>
> As far as I know you must define the source coordinate system.
> I think it is pretty straightforward when you are using gdalwarp.
> If there are so many images, maybe you can create a shell script to run the
> process.
>
> Cheers,
>
> >
>
> Firman Hadi
> Center for Remote Sensing - ITB
> Jl. Ganesha No. 10,
> Labtek IX-C, 3rd Floor
> Bandung - 40132
> INDONESIA
> Phone: +62-22-2530701
> Fax: +62-22-2530702
> Website : http://crs.itb.ac.id ; www.sigro.org
> Blog : http://jalmiburung.wordpress.com
> JepratJepret: http://jalmiburung.fotografer.net
>
>
>
>
>
>
>
>
>
>
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Creation and managing Location/Mapset

2010-05-18 Thread Luisa Peña
Hi Nikos and Luis
Thanks for your replies
I still have a few issues regarding this:
1- How can a region not to be a Square? If I have to set
North/South/East/West boundaries?
2- In my case, my mask is a Vectorial. Can I use a vectorial as a mask?

Thank you once again

No dia 17 de Maio de 2010 23:44, Nikos Alexandris <
nikos.alexand...@felis.uni-freiburg.de> escreveu:

> Luisa Peña:
> > > 1- Should I create 1 Location with 4 different mapsets (for each of
> > > the considered scales)? Or should I use 1 location, one mapset and 4
> > > different regions?
>
> Luís Ferreira wrote:
> > one location if all the analysis will be done with one coordinate system
> > one mapset = one region, one resolution
>
> Of course you can work with material of different geospatial
> extent/resolution
> on the same mapset. It's just that you have to pay attention when it comes
> to
> raster computations.
>
> Note also that most vector modules are _not_ limited by the
> extent/resolution
> of the _computational_ region.
>
> > so, perhaps, is better you to use four different mapsets (four levels)
>
> I would think of using several map sets based on "what" is the question to
> be
> answered. Something like a thematic sorting. For example an ndvi mapset.
> Combine your "questions to be answered" with your "scale" levels (if you
> want
> to _not_ think all the time about the extent and the resolution) and you
> could
> go for, let's say "ndvi_local" , "ndvi_national", "indexA_local",
> "indexA_national", etc.
>
> Finally an export mapset could be useful to drag-in all the maps you want
> to
> export (at a single step using some script for example?).
>
> > > 2- How can I define a region that is not a perfect square' Because in
> > > "Set Region" we have North, South, East and West Boundaries. And my
> > > regions are not perfect squares.
>
> > A region don't need to be square. And you can use an analysis mask.
> > Raster > Mask, or r.mask.
>
> Or "r.mapcalc". I remember at least one occasion where "r.mask" did not
> work
> as expected. Don't know if this has been fixed.
>
> Note that there might be some modules that ignore the MASK!
>
> Cheers, Nikos
>
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user