SWD Format

1,711 views
Skip to first unread message

Katherine Siegel

unread,
Aug 22, 2014, 10:40:15 AM8/22/14
to max...@googlegroups.com
Hello,

I am new to MaxEnt and have a question about the SWD format for sample files. My Samples file is in CSV format and my environmental layers are also in a CSV file, with environmental data for grids. Each grid also has geographic information for its boundaries in the file. When I try to run MaxEnt, I get an error message that says "Samples need to be in SWD format when background data is in SWD format." I am not really clear on what SWD format is and how to convert my files to it. I tried to follow the directions in the tutorial but did not have any success. Does anyone know how to do this? If not, do you have any suggestions for how to input my data so that I do not have this problem?

Thanks!
Katherine

Oliver Burdekin

unread,
Aug 23, 2014, 5:03:02 AM8/23/14
to max...@googlegroups.com
Hi Katherine,

SWD format stands for sample with data.  Ordinarily in MaxEnt your csv for samples will only have three columns: species, longitude, latitude.  Samples with data (SWD files) will have extra columns for the environmental factors associated with each species presence location. 

It sounds as though your specific problem is with your environmental layers.  These should not be in csv format but instead in ascii format.  Were you running MaxEnt with chosen background samples then these would need to be in csv format and your samples file would need to be in csv format as an swd.  However, for regular runs convert your environmental layers to ascii.

I hope that helps,

Oliver

Katherine Siegel

unread,
Aug 24, 2014, 10:36:10 AM8/24/14
to max...@googlegroups.com
Hi Oliver,

Thanks a lot!

Best,
Katherine


Author

unread,
Nov 17, 2016, 2:36:19 AM11/17/16
to Maxent
How do i convert csv to ascii format for the maxent to accept it as environmental layers?

Oliver Burdekin

unread,
Nov 17, 2016, 4:04:13 AM11/17/16
to Maxent
Hi,

What do you have in csv to convert to ascii? It is a little unusual to have raster data in csv format. Are you able to send / attach a sample of your data and explain further what you are trying to do?

A csv is really just a text file with "fields" separated by commas. Therefore you could open it in notepad or similar and save it as an .asc that way. The problem arises that the aciis for Maxent require certain header information to describe the spatial attributes of the data. For example:

NCOLS 33
NROWS 20
XLLCORNER -88.3916666666667
YLLCORNER 15.4416666666667
CELLSIZE 0.0083333333333335
NODATA_value -2147483647

Without this header information (which is unlikely to be in your csv) Maxent will not know where in the world the environmental layer is supposed to be.

Cheers,

Oliver

Author

unread,
Nov 17, 2016, 6:25:31 AM11/17/16
to Maxent
I have temperature, precipitation, tea and altitude in the csv file. Am working on a project and the environmental layers part is giving me some trouble. The header infor mentioned is what i cannot get out of the data, if converted to ascii format.

I've tried doing it in QGIS, ARCGIS, DIVAGIS but i still cannot figure it out.

Oliver Burdekin

unread,
Nov 17, 2016, 6:27:55 AM11/17/16
to max...@googlegroups.com
Okay, where did you get the data from and can you attach a copy of one of the datasets (eg precipitation) so I can take a look at it?

Cheers,

Oliver

Please help spread the word and like our facebook page!

photo
Oliver Burdekin
Spatial Analyst, burdGIS
  

--
You received this message because you are subscribed to a topic in the Google Groups "Maxent" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/maxent/0YUT1_BB6N4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to maxent+unsubscribe@googlegroups.com.
To post to this group, send email to max...@googlegroups.com.
Visit this group at https://groups.google.com/group/maxent.
For more options, visit https://groups.google.com/d/optout.

Author

unread,
Nov 17, 2016, 6:39:27 AM11/17/16
to Maxent
I have data for around 14 stations, all containing ppt, temp, tea and am yet to include altitude. That is just for one station.
I got it from various sources, GPCC for ppt and MERRA for temperature
To unsubscribe from this group and all its topics, send an email to maxent+un...@googlegroups.com.
Bomet Data.csv

Oliver Burdekin

unread,
Nov 17, 2016, 6:59:20 AM11/17/16
to max...@googlegroups.com
Okay that makes more sense. This format will not work as an environmental layer for MaxEnt. These are point sources. So if you were to map them you would have a point with a value attached.

For environmental layers MaxEnt expects a continuous surface also known as a raster. If you imagine a chess board with equal sized squares this is akin to a raster file. Each square has a value associated with it. So the precipitation raster (chessboard) would have a precipitation value in each square or cell.

For an example of environmental data in this format you can download data from http://worldclim.org/

So environmental layers should be in this continuous format. Your species presence records will be in the point format discussed earlier. IF you wanted to use the SWD format you would need values for all your environmental layers at each species presence point. Again these could be derived from the world clim data (or similar data).

I hope that helps,

Oliver 

Please help spread the word and like our facebook page!

photo
Oliver Burdekin
Spatial Analyst, burdGIS
  

To unsubscribe from this group and all its topics, send an email to maxent+unsubscribe@googlegroups.com.

KENYA METEOROLOGICAL SOCIETY

unread,
Nov 17, 2016, 7:06:34 AM11/17/16
to max...@googlegroups.com
Thank you Oliver. How do i access data from worldclim? it takes me to a login page, no creating an account.

Author
--
Kenya Meteorological Society
P.O. BOX 41959-00100,
Nairobi
Tel: 020-2147770
Email: in...@kms.or.ke
website: www.kms.or.ke

Oliver Burdekin

unread,
Nov 17, 2016, 7:12:24 AM11/17/16
to max...@googlegroups.com
There should be no login page. The data is freely accessible to anyone who would like to use it. Try the link below:

http://www.worldclim.org/current

Please help spread the word and like our facebook page!

photo
Oliver Burdekin
Spatial Analyst, burdGIS
  

KENYA METEOROLOGICAL SOCIETY

unread,
Nov 17, 2016, 7:14:42 AM11/17/16
to max...@googlegroups.com

Oliver Burdekin

unread,
Nov 17, 2016, 7:17:15 AM11/17/16
to max...@googlegroups.com
Then I would suggest a google search for "worldclim". If you are trying to access it from a computer in your organisation the site may be blocked for some reason in which case you will need to speak with your IT department.


Please help spread the word and like our facebook page!

photo
Oliver Burdekin
Spatial Analyst, burdGIS
  

KENYA METEOROLOGICAL SOCIETY

unread,
Nov 17, 2016, 8:16:54 AM11/17/16
to max...@googlegroups.com
hi oliver, can you kindly interpret the below infor for me?

NCOLS 33
NROWS 20
XLLCORNER -88.3916666666667
YLLCORNER 15.4416666666667
CELLSIZE 0.0083333333333335
NODATA_value -2147483647

Assuming am to create such a file with notepad
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Maxent" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/maxent/0YUT1_BB6N4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> maxent+un...@googlegroups.com.
> To post to this group, send email to max...@googlegroups.com.
> Visit this group at https://groups.google.com/group/maxent.
> For more options, visit https://groups.google.com/d/optout.



--

Oliver Burdekin

unread,
Nov 17, 2016, 8:26:40 AM11/17/16
to max...@googlegroups.com
NCOLS = number of columns
NROWS = number of rows
XLLCORNER = X axis lower left corner (coordinate)
YLLCORNER = Y axis lower left corner (coordinate)
CELLSIZE = size of each cell
NODATA_value = the arbitrary value assigned to cells with no data.

Again think of the chess board analogy. When working with rasters this is the geospatial information. If you know the coordinate of the corner of the lower left cell on the chess board and the size of each cell plus the number of cells in each column and row you can draw the grid.



Please help spread the word and like our facebook page!

photo
Oliver Burdekin
Spatial Analyst, burdGIS
  


> To post to this group, send email to max...@googlegroups.com.
> Visit this group at https://groups.google.com/group/maxent.
> For more options, visit https://groups.google.com/d/optout.



--
Kenya Meteorological Society
P.O. BOX 41959-00100,
Nairobi
Tel: 020-2147770
Email: in...@kms.or.ke
website: www.kms.or.ke

--
You received this message because you are subscribed to a topic in the Google Groups "Maxent" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/maxent/0YUT1_BB6N4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to maxent+unsubscribe@googlegroups.com.

KENYA METEOROLOGICAL SOCIETY

unread,
Nov 18, 2016, 12:02:54 AM11/18/16
to max...@googlegroups.com
hi oliver, thanks for the great tips. I managed to make them using DIVAGIS, i think its a better and faster way of creating them.

Author

Oliver Burdekin

unread,
Nov 18, 2016, 12:31:07 AM11/18/16
to max...@googlegroups.com
No problem. Feel free to get in touch if you need any further help. It's what I do ;)

http://www.burdgis.com

Please help spread the word and like our facebook page!

photo
Oliver Burdekin
Spatial Analyst, burdGIS
  

Reply all
Reply to author
Forward
0 new messages