Václav Řehák | 2 Jun 2010 15:02
Picon

Re: problems installing adahabitat under win Seven and HR QGIS plugin error

> > Error in writeOGR(khr.polygons, dir, name, "ESRI Shapefile") :
> > 	GDAL Error 1: Invalid index : -1
> >
> > when using any method other than MCP.
>
> I suspect rgdal - but it's only a gut feeling, will look at this asap.

H Anne,

have you already had a chance to look at this? I encountered exactly
the same problem with two installations on Windows XP.

If you cannot reproduce the problem, I'll be happy to help debugging
it but as I don't have any experience with R programming and I didn't
find a way to e.g. insert debug prints into the R code and see them in
QGIS, I didn't obtain more detailed symptoms of the problem (the
commented-out code in HRplugin_dialog.py:213 doesn't work and I did
not have time to make it work).

Thanks for help,

Vaclav
Abdi, Abdulhakim | 3 Jun 2010 16:18
Favicon

Adehabitat: creating MCPs every two weeks for 32 different animals

Dear List,

 

I’m trying to detect patterns in the movements of a nomadic gazelle species during the breeding season. Basically, I would like to create MCPs (minimum convex polygons representing home ranges) for each of the 32 gazelles every two weeks starting on September 4th 2007. I have satellite tracking points from September 2007 to January 2010. The point of this exercise is to see whether the animals converge at particular areas during the breeding season or whether the site selection is random.

 

Before going into the date loop procedure I attempted to create MCPs for the animals without regard for the two-week interval:

 

Here is what my data.frame looks like:

 

> head(all.frame)

   Name    Status       X       Y       Date

1 76792   capture 1356206 2196167 2007-09-04

2 76795   capture 1354434 2209845 2007-09-04

3 76797   capture 1354434 2209845 2007-09-04

 

And here is the output of the command, as you can see I get an error statement:

 

> all.xy = all.frame[,c("X","Y")]

> all.id = all.frame$Name

> all.mcp = mcp(all.xy, all.id, percent=95)

Error in mcp(all.xy, all.id, percent = 95) :

  At least 5 relocations are required to fit an home range

 

Next, I ran MCPs for the “puechabon$loc” data.frame that comes with Adehabitat and it worked without producing any errors, so I compared my data.frame with puechabon$loc.

 

> head(puechabon$loc)

   Name Age Sex      X       Y   Date

1 Brock   2   1 699889 3161559 930701

2 Brock   2   1 700046 3161541 930703

3 Brock   2   1 698840 3161033 930706

 

Looking at the structure of both, my dataset has the date set to class ‘Date’ while in the Puechabon dataset it’s set to ‘Integer’ and the dates are concatenated as “yymmdd”:

 

> str(all.frame)

'data.frame':   5059 obs. of  5 variables:

 $ Name  : Factor w/ 32 levels "76790","76792",..: 2 5 7 7 1 3 5 8 7 7 ...

 $ Status: Factor w/ 3 levels "argos","capture",..: 2 2 2 3 2 2 1 2 3 3 ...

 $ X     : int  1356206 1354434 1354434 1349773 1362802 1362802 1357468 1362802 1345648 1345387 ...

 $ Y     : int  2196167 2209845 2209845 2211725 2216920 2216920 2176051 2216920 2213362 2213572 ...

 $ Date  :Class 'Date'  num [1:5059] 13760 13760 13760 13761 13761 ...

 

> str(puechabon$loc)

'data.frame':   119 obs. of  6 variables:

 $ Name: Factor w/ 4 levels "Brock","Calou",..: 1 1 1 1 1 1 1 1 1 1 ...

 $ Age : int  2 2 2 2 2 2 2 2 2 2 ...

 $ Sex : int  1 1 1 1 1 1 1 1 1 1 ...

 $ X   : int  699889 700046 698840 699809 698627 698719 698991 698626 698879 699756 ...

 $ Y   : int  3161559 3161541 3161033 3161496 3160941 3160989 3161015 3160768 3160964 3161449 ...

 $ Date: int  930701 930703 930706 930707 930708 930709 930713 930714 930715 930720 ...

 

I tried to convert my dates to the “yymmdd” format, without any luck as the new column came out exactly the same as the original one:

 

> all.frame$Date2 = as.Date(all.frame$Date, format="%y/%m%/d")

> head(all.frame)

   Name    Status       X       Y       Date      Date2

1 76792   capture 1356206 2196167 2007-09-04 2007-09-04

2 76795   capture 1354434 2209845 2007-09-04 2007-09-04

3 76797   capture 1354434 2209845 2007-09-04 2007-09-04

 

So, I have three questions: is it only a date format issue or am I missing something else? If it is a date format issue, then, how would it be possible to convert my dates in “YYyy-mm-dd” into “yymmdd”? and finally what loop functions or steps could I take to create MCPs for the animals every two weeks.

 

Any help is greatly appreciated.

 

Regards,

 

Hakim Abdi

 

_________________________________

Abdulhakim Abdi, M.Sc.

Research Intern

 

Conservation GIS/Remote Sensing Lab

Smithsonian Conservation Biology Institute

1500 Remount Road

Front Royal, VA

phone: +1-540-635-6578

fax: +1-540-635-6506

email: abdia-1Qnjj5vVSdU@public.gmane.org

 

_______________________________________________
AniMov mailing list
AniMov@...
http://lists.faunalia.it/cgi-bin/mailman/listinfo/animov
Milton Cezar Ribeiro | 3 Jun 2010 16:35
Picon
Favicon

RES: Adehabitat: creating MCPs every two weeks for 32 different animals

Hi Abdi,

 

How many points you get per id with table(all.id)?

 

Cheers

milton

 

 

De: animov-bounces-h12OV65+u/41GQ1Ptb7lUw@public.gmane.org [mailto:animov-bounces-h12OV65+u/41GQ1Ptb7lUw@public.gmane.org] Em nome de Abdi, Abdulhakim
Enviada em: Thursday, June 03, 2010 11:19 AM
Para: AniMov-h12OV65+u/41GQ1Ptb7lUw@public.gmane.org
Assunto: [AniMov] Adehabitat: creating MCPs every two weeks for 32 different animals

 

Dear List,

 

I’m trying to detect patterns in the movements of a nomadic gazelle species during the breeding season. Basically, I would like to create MCPs (minimum convex polygons representing home ranges) for each of the 32 gazelles every two weeks starting on September 4th 2007. I have satellite tracking points from September 2007 to January 2010. The point of this exercise is to see whether the animals converge at particular areas during the breeding season or whether the site selection is random.

 

Before going into the date loop procedure I attempted to create MCPs for the animals without regard for the two-week interval:

 

Here is what my data.frame looks like:

 

> head(all.frame)

   Name    Status       X       Y       Date

1 76792   capture 1356206 2196167 2007-09-04

2 76795   capture 1354434 2209845 2007-09-04

3 76797   capture 1354434 2209845 2007-09-04

 

And here is the output of the command, as you can see I get an error statement:

 

> all.xy = all.frame[,c("X","Y")]

> all.id = all.frame$Name

> all.mcp = mcp(all.xy, all.id, percent=95)

Error in mcp(all.xy, all.id, percent = 95) :

  At least 5 relocations are required to fit an home range

 

Next, I ran MCPs for the “puechabon$loc” data.frame that comes with Adehabitat and it worked without producing any errors, so I compared my data.frame with puechabon$loc.

 

> head(puechabon$loc)

   Name Age Sex      X       Y   Date

1 Brock   2   1 699889 3161559 930701

2 Brock   2   1 700046 3161541 930703

3 Brock   2   1 698840 3161033 930706

 

Looking at the structure of both, my dataset has the date set to class ‘Date’ while in the Puechabon dataset it’s set to ‘Integer’ and the dates are concatenated as “yymmdd”:

 

> str(all.frame)

'data.frame':   5059 obs. of  5 variables:

 $ Name  : Factor w/ 32 levels "76790","76792",..: 2 5 7 7 1 3 5 8 7 7 ...

 $ Status: Factor w/ 3 levels "argos","capture",..: 2 2 2 3 2 2 1 2 3 3 ...

 $ X     : int  1356206 1354434 1354434 1349773 1362802 1362802 1357468 1362802 1345648 1345387 ...

 $ Y     : int  2196167 2209845 2209845 2211725 2216920 2216920 2176051 2216920 2213362 2213572 ...

 $ Date  :Class 'Date'  num [1:5059] 13760 13760 13760 13761 13761 ...

 

> str(puechabon$loc)

'data.frame':   119 obs. of  6 variables:

 $ Name: Factor w/ 4 levels "Brock","Calou",..: 1 1 1 1 1 1 1 1 1 1 ...

 $ Age : int  2 2 2 2 2 2 2 2 2 2 ...

 $ Sex : int  1 1 1 1 1 1 1 1 1 1 ...

 $ X   : int  699889 700046 698840 699809 698627 698719 698991 698626 698879 699756 ...

 $ Y   : int  3161559 3161541 3161033 3161496 3160941 3160989 3161015 3160768 3160964 3161449 ...

 $ Date: int  930701 930703 930706 930707 930708 930709 930713 930714 930715 930720 ...

 

I tried to convert my dates to the “yymmdd” format, without any luck as the new column came out exactly the same as the original one:

 

> all.frame$Date2 = as.Date(all.frame$Date, format="%y/%m%/d")

> head(all.frame)

   Name    Status       X       Y       Date      Date2

1 76792   capture 1356206 2196167 2007-09-04 2007-09-04

2 76795   capture 1354434 2209845 2007-09-04 2007-09-04

3 76797   capture 1354434 2209845 2007-09-04 2007-09-04

 

So, I have three questions: is it only a date format issue or am I missing something else? If it is a date format issue, then, how would it be possible to convert my dates in “YYyy-mm-dd” into “yymmdd”? and finally what loop functions or steps could I take to create MCPs for the animals every two weeks.

 

Any help is greatly appreciated.

 

Regards,

 

Hakim Abdi

 

_________________________________

Abdulhakim Abdi, M.Sc.

Research Intern

 

Conservation GIS/Remote Sensing Lab

Smithsonian Conservation Biology Institute

1500 Remount Road

Front Royal, VA

phone: +1-540-635-6578

fax: +1-540-635-6506

email: abdia-1Qnjj5vVSdU@public.gmane.org

 

_______________________________________________
AniMov mailing list
AniMov@...
http://lists.faunalia.it/cgi-bin/mailman/listinfo/animov
Abdi, Abdulhakim | 3 Jun 2010 16:39
Favicon

Re: RES: Adehabitat: creating MCPs every two weeks for 32 different animals

Hi Milton,

 

all.id produces all 5000+ points of the 32 animals

 

H

 

From: animov-bounces-h12OV65+u/41GQ1Ptb7lUw@public.gmane.org [mailto:animov-bounces-h12OV65+u/41GQ1Ptb7lUw@public.gmane.org] On Behalf Of Milton Cezar Ribeiro
Sent: Thursday, June 03, 2010 10:35 AM
To: 'Animal Movement'
Subject: [AniMov] RES: Adehabitat: creating MCPs every two weeks for 32 different animals

 

Hi Abdi,

 

How many points you get per id with table(all.id)?

 

Cheers

milton

 

 

De: animov-bounces-h12OV65+u/41GQ1Ptb7lUw@public.gmane.org [mailto:animov-bounces-h12OV65+u/41GQ1Ptb7lUw@public.gmane.org] Em nome de Abdi, Abdulhakim
Enviada em: Thursday, June 03, 2010 11:19 AM
Para: AniMov-h12OV65+u/41GQ1Ptb7lUw@public.gmane.org
Assunto: [AniMov] Adehabitat: creating MCPs every two weeks for 32 different animals

 

Dear List,

 

I’m trying to detect patterns in the movements of a nomadic gazelle species during the breeding season. Basically, I would like to create MCPs (minimum convex polygons representing home ranges) for each of the 32 gazelles every two weeks starting on September 4th 2007. I have satellite tracking points from September 2007 to January 2010. The point of this exercise is to see whether the animals converge at particular areas during the breeding season or whether the site selection is random.

 

Before going into the date loop procedure I attempted to create MCPs for the animals without regard for the two-week interval:

 

Here is what my data.frame looks like:

 

> head(all.frame)

   Name    Status       X       Y       Date

1 76792   capture 1356206 2196167 2007-09-04

2 76795   capture 1354434 2209845 2007-09-04

3 76797   capture 1354434 2209845 2007-09-04

 

And here is the output of the command, as you can see I get an error statement:

 

> all.xy = all.frame[,c("X","Y")]

> all.id = all.frame$Name

> all.mcp = mcp(all.xy, all.id, percent=95)

Error in mcp(all.xy, all.id, percent = 95) :

  At least 5 relocations are required to fit an home range

 

Next, I ran MCPs for the “puechabon$loc” data.frame that comes with Adehabitat and it worked without producing any errors, so I compared my data.frame with puechabon$loc.

 

> head(puechabon$loc)

   Name Age Sex      X       Y   Date

1 Brock   2   1 699889 3161559 930701

2 Brock   2   1 700046 3161541 930703

3 Brock   2   1 698840 3161033 930706

 

Looking at the structure of both, my dataset has the date set to class ‘Date’ while in the Puechabon dataset it’s set to ‘Integer’ and the dates are concatenated as “yymmdd”:

 

> str(all.frame)

'data.frame':   5059 obs. of  5 variables:

 $ Name  : Factor w/ 32 levels "76790","76792",..: 2 5 7 7 1 3 5 8 7 7 ...

 $ Status: Factor w/ 3 levels "argos","capture",..: 2 2 2 3 2 2 1 2 3 3 ...

 $ X     : int  1356206 1354434 1354434 1349773 1362802 1362802 1357468 1362802 1345648 1345387 ...

 $ Y     : int  2196167 2209845 2209845 2211725 2216920 2216920 2176051 2216920 2213362 2213572 ...

 $ Date  :Class 'Date'  num [1:5059] 13760 13760 13760 13761 13761 ...

 

> str(puechabon$loc)

'data.frame':   119 obs. of  6 variables:

 $ Name: Factor w/ 4 levels "Brock","Calou",..: 1 1 1 1 1 1 1 1 1 1 ...

 $ Age : int  2 2 2 2 2 2 2 2 2 2 ...

 $ Sex : int  1 1 1 1 1 1 1 1 1 1 ...

 $ X   : int  699889 700046 698840 699809 698627 698719 698991 698626 698879 699756 ...

 $ Y   : int  3161559 3161541 3161033 3161496 3160941 3160989 3161015 3160768 3160964 3161449 ...

 $ Date: int  930701 930703 930706 930707 930708 930709 930713 930714 930715 930720 ...

 

I tried to convert my dates to the “yymmdd” format, without any luck as the new column came out exactly the same as the original one:

 

> all.frame$Date2 = as.Date(all.frame$Date, format="%y/%m%/d")

> head(all.frame)

   Name    Status       X       Y       Date      Date2

1 76792   capture 1356206 2196167 2007-09-04 2007-09-04

2 76795   capture 1354434 2209845 2007-09-04 2007-09-04

3 76797   capture 1354434 2209845 2007-09-04 2007-09-04

 

So, I have three questions: is it only a date format issue or am I missing something else? If it is a date format issue, then, how would it be possible to convert my dates in “YYyy-mm-dd” into “yymmdd”? and finally what loop functions or steps could I take to create MCPs for the animals every two weeks.

 

Any help is greatly appreciated.

 

Regards,

 

Hakim Abdi

 

_________________________________

Abdulhakim Abdi, M.Sc.

Research Intern

 

Conservation GIS/Remote Sensing Lab

Smithsonian Conservation Biology Institute

1500 Remount Road

Front Royal, VA

phone: +1-540-635-6578

fax: +1-540-635-6506

email: abdia-1Qnjj5vVSdU@public.gmane.org

 

_______________________________________________
AniMov mailing list
AniMov@...
http://lists.faunalia.it/cgi-bin/mailman/listinfo/animov
Clément Calenge | 3 Jun 2010 17:00
Picon
Favicon

Re: Adehabitat: creating MCPs every two weeks for 32 different animals


>So, I have three questions: is it only a date format issue or am I missing something else? If it is a date format issue, then, >how would it be possible to convert my dates in “YYyy-mm-dd” into “yymmdd”? and finally what loop functions or steps > could I take to create MCPs for the animals every two weeks.


The error is not a date format issue, as the date is not required for the calculation of the mcp. As the error message indicates, you need five relocations or more to compute a minimum convex polygon. That is, if you type:

any(table(all.id)<5)

If it returns TRUE, this means that for some animals, you have less than 5 relocations, and so you cannot compute a MCP. To identify the animals that are characterized by 5 relocations or more, try:

ta <- table(all.id)<5
ta[ta<5]

And so, you can remove these animals, if you want to calculate a MCP for each one:

out <- names(ta[ta<5])
pc <- mcp(all.xy[!(all.id%in%out),], factor(all.id[!(all.id%in%out)])
plot(pc)

Now concerning the loop every two weeks, it is hard to describe you what to do without any data or precision on what you expect exactly... What are the limits of the "pairs of weeks"? are they the same for all animals? are you able to build a variable indicating the id of the "pairs of weeks" for each relocation (e.g. "2007-09-04" is in the "pair" 1, etc.)? We need more details...
HTH,


Clément Calenge
--
Clément CALENGE Cellule d'appui à l'analyse de données Office national de la chasse et de la faune sauvage Saint Benoist - 78610 Auffargis tel. (33) 01.30.46.54.14
_______________________________________________
AniMov mailing list
AniMov@...
http://lists.faunalia.it/cgi-bin/mailman/listinfo/animov
Clément Calenge | 3 Jun 2010 17:00
Picon
Favicon

Re: Adehabitat: creating MCPs every two weeks for 32 different animals


>So, I have three questions: is it only a date format issue or am I missing something else? If it is a date format issue, then, >how would it be possible to convert my dates in “YYyy-mm-dd” into “yymmdd”? and finally what loop functions or steps > could I take to create MCPs for the animals every two weeks.


The error is not a date format issue, as the date is not required for the calculation of the mcp. As the error message indicates, you need five relocations or more to compute a minimum convex polygon. That is, if you type:

any(table(all.id)<5)

If it returns TRUE, this means that for some animals, you have less than 5 relocations, and so you cannot compute a MCP. To identify the animals that are characterized by 5 relocations or more, try:

ta <- table(all.id)<5
ta[ta<5]

And so, you can remove these animals, if you want to calculate a MCP for each one:

out <- names(ta[ta<5])
pc <- mcp(all.xy[!(all.id%in%out),], factor(all.id[!(all.id%in%out)])
plot(pc)

Now concerning the loop every two weeks, it is hard to describe you what to do without any data or precision on what you expect exactly... What are the limits of the "pairs of weeks"? are they the same for all animals? are you able to build a variable indicating the id of the "pairs of weeks" for each relocation (e.g. "2007-09-04" is in the "pair" 1, etc.)? We need more details...
HTH,


Clément Calenge
--
Clément CALENGE Cellule d'appui à l'analyse de données Office national de la chasse et de la faune sauvage Saint Benoist - 78610 Auffargis tel. (33) 01.30.46.54.14
_______________________________________________
AniMov mailing list
AniMov@...
http://lists.faunalia.it/cgi-bin/mailman/listinfo/animov
Damiano G. Preatoni | 4 Jun 2010 08:15
Picon

Re: Adehabitat: creating MCPs every two weeks for 32 different animals

In un messaggio del Thursday 03 June 2010, Clément Calenge ha scritto:
> >So, I have three questions: is it only a date format issue or am I missing
> >something else? If it is a date format issue, then, >how would it be
> >possible to convert my dates in “YYyy-mm-dd” into “yymmdd”? and finally
> >what loop functions or steps > could I take to create MCPs for the
> >animals every two weeks.
> 
> The error is not a date format issue, as the date is not required for the
> calculation of the mcp. As the error message indicates, you need five
> relocations or more to compute a minimum convex polygon. That is, if you
> type:
> 
> any(table(all.id)<5)
> 
> If it returns TRUE, this means that for some animals, you have less than 5
> relocations, and so you cannot compute a MCP. To identify the animals that
> are characterized by 5 relocations or more, try:
> 
> ta <- table(all.id)<5
> ta[ta<5]
> 
> And so, you can remove these animals, if you want to calculate a MCP for
> each one:
> 
> out <- names(ta[ta<5])
> pc <- mcp(all.xy[!(all.id%in%out),], factor(all.id[!(all.id%in%out)])
> plot(pc)
> 
> Now concerning the loop every two weeks, it is hard to describe you what to
> do without any data or precision on what you expect exactly... What are
> the limits of the "pairs of weeks"? are they the same for all animals? are
> you able to build a variable indicating the id of the "pairs of weeks" for
> each relocation (e.g. "2007-09-04" is in the "pair" 1, etc.)? We need more
> details... HTH,

Hi Abdi, list
we made something similar to calculate "sesaonal" (see below) kernels for 
snowshoe hare.

As Clément pointed out, the main issue is not "technical" (I mean, on the R 
side), but biological.
Your "two weeks" timespan are probably not determined just on the base of a 
date but are in some way individual-dependant.

Anyway, once you've determined the _exact_ date ranges that define each time 
interval (per animal or not) you can create a new column in your dataframe 
pasting together animal ID and a "fortnight ID". Using that new column as 
animal ID, any adehabitat homerange calculation can be done.

Just to give the idea: for snowshoe hare we defined "sesaons" on an annual 
biological cycle basis (moult, breeding season, summer, winter moult, winter, 
etc), and then recoded (car::recode is rather handy here) a new variable 
called "period" (numbered from 1 to 5). The new ID was then assembled using 
animal ID and period, so that kernelUD was used to calculate separate home 
ranger per animal _and_ period.

Again, problem is how those "two weeks" are defined.

If you're interested in a detailed example I can dig out the script from our 
archive.

HTH

-- 
"Microwave oven?  Whaddya mean, it's a microwave oven?  I've been watching
Channel 4 on the thing for two weeks."
-----------------------------------------------------------
Damiano G. Preatoni, PhD

Unità di Analisi e Gestione delle Risorse Ambientali
Dipartimento Ambiente-Salute-Sicurezza
Università degli Studi dell'Insubria
Via J.H. Dunant, 3 - 21100 Varese (ITALY)

tel +39 0332421538 fax +39 0332421446
http://biocenosi.dipbsf.uninsubria.it/
ICQ: 78690321 jabber: prea@... skype: prea.net
-----------------------------------------------------------
Please consider the environment before printing this email
Please do not send attachments in proprietary formats
http://www.gnu.org/philosophy/no-word-attachments.html
Use the UNI CEI Standard ISO/IEC 26300:2006
-----------------------------------------------------------
O< stop html mail - http://www.asciiribbon.org
_______________________________________________
AniMov mailing list
AniMov@...
http://lists.faunalia.it/cgi-bin/mailman/listinfo/animov
Paolo Cavallini | 21 Jun 2010 13:44
Picon
Favicon
Gravatar

Fwd: Papers on GPS telemetry

Very interesting!
All the best.

-------- Messaggio originale --------
Dear friends,
until the end of July, all the papers of the special issue
"'Challenges and opportunities of using GPS-based location data in
animal ecology" published on "Philosophical Transactions B" are freely
available at
http://rstb.royalsocietypublishing.org/content/current/
I think that there are many relevant contributes and I guess you can
be interested in some of them.
To whom is concerned with GPS data management, I strongly suggest
"Wildlife tracking data management: a new vision" :)

Ciao
Ferdinando
Giovanni Manghi | 27 Jun 2010 14:35
Picon
Gravatar

Re: HR QGIS plugin error

Hi Anne, list

I see the message

[1] "Kernel hadj calculation..."
[1] "Done."
Error in writeOGR(khr.polygons, dir, name, "ESRI Shapefile") : 

GDAL Error 1: Invalid index : -1
In addition: Warning message:
In writeOGR(khr.polygons, dir, name, "ESRI Shapefile") : 
Non-fatal GDAL Error 6: Normalized/laundered field name: 'ha_percent_95'
to 'ha_percent'

in any installation of the plugin I made recently, both on Windows (xp
and Seven) and Linux (Ubuntu).

The shapes are correctly created but nothing is written in it.

I removed also any other plugin in order to be sure that was not some
kind of conflict with other tools.

Cheers!

-- Giovanni --

> > > I have also a problem testing the HR plugin under Windows (both XP and
> > > Seven, using the sample dataset and qgis trunk from osgeo4w) as it
> > > returns always this message
> > > 
> > > Error in writeOGR(khr.polygons, dir, name, "ESRI Shapefile") : 
> > > 	GDAL Error 1: Invalid index : -1
> > > 
> > > when using any method other than MCP.
> > 
> > I suspect rgdal - but it's only a gut feeling, will look at this asap.
> 
> 
> thanks for the feedback!
> 
> I have just seen this also under Linux, in a fresh Ubuntu 10.04 install,
> using packages from the ubuntugis repository and qgis trunk self
> compiled.
> 
> The strange thing is that in another ubuntu 10.04 machine I succesfully
> used the plugin yesterday.
> 
> I always used the sample dataset.
Anne Ghisla | 28 Jun 2010 15:05
Picon
Gravatar

Re: HR QGIS plugin error

On Sun, 2010-06-27 at 18:29 +0100, Giovanni Manghi wrote:
> Hi again,
>
> for what it is worth I tested also the qgis standalone installer (the
> other tests were made using osgeo4w) and the same error still pop up.

Hi Giovanni, all,

this is my [r]gdal installation on Debian testing, and it works. The
shapefile is correct, only the "ha_percent" column name is trimmed - as
Non-fatal Error 6 mentioned in previous mail warned.
Some questions:
- Which version of [r]gdal are you using?
- Is anything much different from the working configurations listed in
the plugin's wikipage?
- Last, is manageR working fine?

BTW the error has been mentioned by Agustin Lobo on R-sig-geo [0]

This is my working configuration:
======================================================================

> require(rgdal)
Loading required package: rgdal
Loading required package: sp
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 1.6.3, released 2009/11/19
Path to GDAL shared files: /usr/share/gdal16
Loaded PROJ.4 runtime: Rel. 4.7.1, 23 September 2009
Path to PROJ.4 shared files: (autodetected)

> packageDescription("rgdal")
Package: rgdal
Title: Bindings for the Geospatial Data Abstraction Library
Version: 0.6-27
Date: 2010-05-11
Depends: R (>= 2.10.0), methods, sp (>= 0.9-60)
LinkingTo: sp
LazyLoad: yes
Description: Provides bindings to Frank Warmerdam's Geospatial Data
        Abstraction Library (GDAL) (>= 1.3.1) and access to
        projection/transformation operations from the PROJ.4 library.
        The GDAL and PROJ.4 libraries are external to the package, and,
        when installing the package from source, must be correctly
        installed first. Both GDAL raster and OGR vector map data can
        be imported into R, and GDAL raster data and OGR vector data
        exported. Use is made of classes defined in the sp package.
        rgdal binaries for Win64 and OSX are available from the CRAN
        (extras) repository.
Author: Timothy H. Keitt <tkeitt@...>, Roger Bivand
        <Roger.Bivand@...>, Edzer Pebesma
        <edzer.pebesma@...>, Barry Rowlingson
Maintainer: Roger Bivand <Roger.Bivand@...>
License: GPL (>= 2)
URL: http://www.gdal.org, http://sourceforge.net/projects/rgdal/
SystemRequirements: for building from source: GDAL >= 1.3.1 library
        from http://trac.osgeo.org/gdal/wiki/DownloadSource and PROJ.4
        (proj >= 4.4.9) from http://trac.osgeo.org/proj/; GDAL OSX
        frameworks built by William Kyngesburye at
        http://www.kyngchaos.com/ may be used for source installs on
        OSX.
Packaged: 2010-05-12 16:10:18 UTC; rsb
Repository: CRAN
Date/Publication: 2010-05-16 16:21:00
Built: R 2.11.0; i486-pc-linux-gnu; 2010-06-11 11:30:28 UTC; unix

=================================================================

looking forward to fix this problem,

Anne

[0] http://r-sig-geo.2731867.n2.nabble.com/writeOGR-error-problem-with-GDAL-libgdal1-1-7-0-td5082811.html

> cheers!
>
> -- Giovanni --
>
>
> On Sun, 2010-06-27 at 13:35 +0100, Giovanni Manghi wrote:
> > Hi Anne, list
> >
> > I see the message
> >
> > [1] "Kernel hadj calculation..."
> > [1] "Done."
> > Error in writeOGR(khr.polygons, dir, name, "ESRI Shapefile") :
> >
> > GDAL Error 1: Invalid index : -1
> > In addition: Warning message:
> > In writeOGR(khr.polygons, dir, name, "ESRI Shapefile") :
> > Non-fatal GDAL Error 6: Normalized/laundered field name: 'ha_percent_95'
> > to 'ha_percent'
> >
> > in any installation of the plugin I made recently, both on Windows (xp
> > and Seven) and Linux (Ubuntu).
> >
> > The shapes are correctly created but nothing is written in it.
> >
> > I removed also any other plugin in order to be sure that was not some
> > kind of conflict with other tools.
> >
> >
> > Cheers!
> >
> > -- Giovanni --
> >
> >
> >
> >
> >
> >
> > > > > I have also a problem testing the HR plugin under Windows (both XP and
> > > > > Seven, using the sample dataset and qgis trunk from osgeo4w) as it
> > > > > returns always this message
> > > > >
> > > > > Error in writeOGR(khr.polygons, dir, name, "ESRI Shapefile") :
> > > > >       GDAL Error 1: Invalid index : -1
> > > > >
> > > > > when using any method other than MCP.
> > > >
> > > > I suspect rgdal - but it's only a gut feeling, will look at this asap.
> > >
> > >
> > > thanks for the feedback!
> > >
> > > I have just seen this also under Linux, in a fresh Ubuntu 10.04 install,
> > > using packages from the ubuntugis repository and qgis trunk self
> > > compiled.
> > >
> > > The strange thing is that in another ubuntu 10.04 machine I succesfully
> > > used the plugin yesterday.
> > >
> > > I always used the sample dataset.
>

Gmane