Workbook SDM using QGIS- Exercise 1: Presence/Absence

266 views
Skip to first unread message

Hannah K

unread,
Jan 9, 2020, 6:51:55 AM1/9/20
to GIS In Ecology Forum
Hi all,

I am working through exercise 1 in the workbook: Introduction to SDM using QGIS

I am stuck at Step 4 - Rasterize (Vector to Raster). I've created a new field for PRESENCE in the harbour porpoise vector layer and it is visible in the attribute table but when I go to select PRESENCE under the ATTRIBUTE FIELD in the Rasterize window, PRESENCE is not an option, only the other fields, i.e. number, latitude, longitude ..

I've deleted the presence field and created new ones a few times, but presence is never an option in the rasterize window. I've saved the project, exited and opened Q again.
Any ideas?

Thank you,

Screenshot 2019-12-29 16.25.28.png
Screenshot 2019-12-29 16.25.46.png

Alex Nguepkap

unread,
Jan 9, 2020, 7:03:45 AM1/9/20
to gis-in-eco...@googlegroups.com
Hi Hannah, 

May be you need to check the field property either string or number...

let me known

Le jeu. 9 janv. 2020 à 12:52, Hannah K <hanm...@gmail.com> a écrit :
EXTERNAL EMAIL - Please Use Caution

Hi all,

--
-- ======================================================================
You received this message because you are subscribed to the "GIS In Ecology Forum" discussion group (http://www.gisinecology.com/GIS_in_Ecology_forum.htm).
 
To control how often you get emails from this group, go to http://groups.google.com/group/gis-in-ecology-forum/subscribe (you will need to log on to get to this page).
 
To post to this group, either log onto the group's home page or send an email to
gis-in-eco...@googlegroups.com.
 
The rules for posting to this group can be found here: http://groups.google.com/group/gis-in-ecology-forum/browse_thread/thread/df31a0822742203f#.
 
To unsubscribe from this group, email:
gis-in-ecology-f...@googlegroups.com
 
All information on this forum is provided on an 'as is' basis. GIS In Ecology is not responsible for checking the accuracy or suitability of any posting or response.
======================================================================
---
You received this message because you are subscribed to the Google Groups "GIS In Ecology Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gis-in-ecology-f...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gis-in-ecology-forum/e7f11f8e-9043-4355-a7b3-5a16aff1dbd4%40googlegroups.com.


--

……………..

    Alex Nguepkap

     GIS Officer

    Wildlife Conservation Society (WCS)

    Cameroon Program

    Tel: (+237) 676 163 774 / 698 610 926

    E: angu...@wcs.org

    S: christianlemegne

    Web: http://cameroon.wcs.org 

GIS in Ecology

unread,
Jan 9, 2020, 7:03:45 AM1/9/20
to GIS In Ecology Forum
HI Hannah,

Sorry to take so long to respond to this. The most obvious possibility here is that when you've created the PRESENCE field, it has been created as a string field rather than as a whole number (integer) field, so this would be the first thing I would check. If the field has been added as a while number (integer) field, the next thing to check is that the edit you made when you added the new field as been saved (if  you don't save this edit to your data layer, the field won't be available as a field in the RASTERIZE tool).

Double-check these two possibilities, and if this doesn't solve this problem, just reply back on this thread and I'll see what else I can suggest to get this sorted for you.

All the best,

Colin

Hanmwah X

unread,
Jan 14, 2020, 6:47:33 AM1/14/20
to gis-in-eco...@googlegroups.com
Thanks Alex and Colin for your replies.

I went back and changed the field to integer and this worked, but before I did this though I was able to select PRESENCE through TOOLBOX - GDAL CONVERSION - RASTERIZE (VECTOR TO RASTER) and this worked.

Two further questions on this topic if that's ok..
1) Can I add the PRESENCE field in a column in excel instead of creating a new field in the data layer in Q? I am attempting pseudo-absence modelling, modelling the presence of one species off another (we talked about this in a previous thread).

2) Should I make one data layer for each species of interest individually, i.e. numbering PRESENCE = 1 and then all other species as 0, in the same layer?
Or should I make two data layers, one for the particular species and one for all other species (instead of survey effort), so thus two raster layers are created? similar to that of exercise 1 in Introduction to SDM using QGIS?

Thank you for your time, I appreciate it.

Hannah

--
-- ======================================================================
You received this message because you are subscribed to the "GIS In Ecology Forum" discussion group (http://www.gisinecology.com/GIS_in_Ecology_forum.htm).
 
To control how often you get emails from this group, go to http://groups.google.com/group/gis-in-ecology-forum/subscribe (you will need to log on to get to this page).
 
To post to this group, either log onto the group's home page or send an email to
gis-in-eco...@googlegroups.com.
 
The rules for posting to this group can be found here: http://groups.google.com/group/gis-in-ecology-forum/browse_thread/thread/df31a0822742203f#.
 
To unsubscribe from this group, email:
gis-in-ecology-f...@googlegroups.com
 
All information on this forum is provided on an 'as is' basis. GIS In Ecology is not responsible for checking the accuracy or suitability of any posting or response.
======================================================================
---
You received this message because you are subscribed to the Google Groups "GIS In Ecology Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gis-in-ecology-f...@googlegroups.com.

GIS in Ecology

unread,
Jan 23, 2020, 7:05:56 AM1/23/20
to GIS In Ecology Forum
HI Hannah,

Glad that that worked as a solution for you. In answer to your two further questions. 

Firstly, you can add the PRESENCE field using any suitable software pakcage, so you could easily add it with Excel or another spreadsheet software programme.

Secondly, if you wish to run a pseudo-absence analysis, as you say, you would make a presence layer based on the locations where your main tagrte species was recorded. However, for your 'survey effort' data latyer, you would need to include all the locaitons where you recorded any species (including your target species) as zeros. This is because the effort raster data layer will need to include all the locaitons surveyed and not just the absence points. If this isn't the case, you won't be able to use it in a raster calculator to calculated a presence-absence raster data layer.

I hope this helps, and if you need any further advice or if anything isn't clear, just post back on this thread.

All the best,

Colin
 
The rules for posting to this group can be found here: http://groups.google.com/group/gis-in-ecology-forum/browse_thread/thread/df31a0822742203f#.
 
To unsubscribe from this group, email:

 
All information on this forum is provided on an 'as is' basis. GIS In Ecology is not responsible for checking the accuracy or suitability of any posting or response.
======================================================================
---
You received this message because you are subscribed to the Google Groups "GIS In Ecology Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gis-in-ecology-forum+unsub...@googlegroups.com.

Hanmwah X

unread,
Feb 3, 2020, 8:17:51 AM2/3/20
to gis-in-eco...@googlegroups.com
Hi Colin,

Unfortunately I am having problems with selecting the Presence option in the Attribute Field in the Rasterize window again. So I added a Presence column to the original CSV file but it doesn't show up as a selection, I tried all the different formats for the cell but no joy. So I created a new column in QGIS, following the instructions in workbook 4 (using whole interger), but this did not work. So I refactored the Presence attribute field in QGIS to Double, and that allowed me to select Presence. Would using a double field property matter?

Now I'm trying to choose the study area. (XMIN YMIN XMAX YMAX). I've added my coordinates to the end of the code and -burn 1 but am getting the following error 'ERROR 6 One and only one of -3d, -burn or -a is required.' See print screens attached.

Also can I add XMIN etc. as decimal degrees instead of km/m ?

Thanks for your time, I really appreciate it.

Hannah


 
The rules for posting to this group can be found here: http://groups.google.com/group/gis-in-ecology-forum/browse_thread/thread/df31a0822742203f#.
 
To unsubscribe from this group, email:

 
All information on this forum is provided on an 'as is' basis. GIS In Ecology is not responsible for checking the accuracy or suitability of any posting or response.
======================================================================
---
You received this message because you are subscribed to the Google Groups "GIS In Ecology Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gis-in-ecology-f...@googlegroups.com.

--
-- ======================================================================
You received this message because you are subscribed to the "GIS In Ecology Forum" discussion group (http://www.gisinecology.com/GIS_in_Ecology_forum.htm).
 
To control how often you get emails from this group, go to http://groups.google.com/group/gis-in-ecology-forum/subscribe (you will need to log on to get to this page).
 
To post to this group, either log onto the group's home page or send an email to
 
The rules for posting to this group can be found here: http://groups.google.com/group/gis-in-ecology-forum/browse_thread/thread/df31a0822742203f#.
 
To unsubscribe from this group, email:

 
All information on this forum is provided on an 'as is' basis. GIS In Ecology is not responsible for checking the accuracy or suitability of any posting or response.
======================================================================
---
You received this message because you are subscribed to the Google Groups "GIS In Ecology Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gis-in-ecology-f...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gis-in-ecology-forum/8e26df1c-be1a-4561-acc8-7b1139f6faea%40googlegroups.com.
Screenshot 2020-02-03 04.59.33.png
Screenshot 2020-02-03 05.00.00.png

GIS in Ecology

unread,
Feb 7, 2020, 5:26:03 AM2/7/20
to GIS In Ecology Forum
HI Hannah,

Thanks for posting again, and sorry to hear you are still having problems with the presence field,. Looking at your screenshots, I see that you are using QGIS 2.18. This issue of not recognising new field and integer fields in general is a known bug with QGIS 2.18. In general, we recommend using QGIS 2.8.3 for workign through our workbooks as it is very stable and it known to work with the instructions provided, and it doesn't have this bug.  You can download QGIS 2.8.3 from www.GISforBiologists.com or from the GIS For Biologists page on www.GISinEcology.com.

In terms of whether it matters whether your presence field is an integer or a double field, this should make no difference to the final ratser data layers.

Finally, in terms of the problems with the RASTERIZE tool, I've not come across thie before and it may also be a bug in 2.18. I would suggest running it without the -burn 1 argument and see if you get an appropriate presence data later (with values of either 1 or 0). If you get numbers greater that 1 for the presence, you will need to use a different solution. One alternative you can try is using the v.to.rast.attrib tool which you can find in GRASS TOOLS> VECTORS. This provides you with an alternative way to convert your point data layer into the required raster data layer, although the settings are slightly different. 

Hope thie helps, and post back in this thread if you need any more help with this.

All the best,

Colin
 
The rules for posting to this group can be found here: http://groups.google.com/group/gis-in-ecology-forum/browse_thread/thread/df31a0822742203f#.
 
To unsubscribe from this group, email:

 
All information on this forum is provided on an 'as is' basis. GIS In Ecology is not responsible for checking the accuracy or suitability of any posting or response.
======================================================================
---
You received this message because you are subscribed to the Google Groups "GIS In Ecology Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gis-in-ecology-forum+unsub...@googlegroups.com.

--
-- ======================================================================
You received this message because you are subscribed to the "GIS In Ecology Forum" discussion group (http://www.gisinecology.com/GIS_in_Ecology_forum.htm).
 
To control how often you get emails from this group, go to http://groups.google.com/group/gis-in-ecology-forum/subscribe (you will need to log on to get to this page).
 
To post to this group, either log onto the group's home page or send an email to
 
The rules for posting to this group can be found here: http://groups.google.com/group/gis-in-ecology-forum/browse_thread/thread/df31a0822742203f#.
 
To unsubscribe from this group, email:

 
All information on this forum is provided on an 'as is' basis. GIS In Ecology is not responsible for checking the accuracy or suitability of any posting or response.
======================================================================
---
You received this message because you are subscribed to the Google Groups "GIS In Ecology Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gis-in-ecology-forum+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages