Convert a SHP file set to a categorised (categorized) ASC raster with Qgis?

45 views
Skip to first unread message

Steve Research

unread,
Jun 17, 2016, 10:26:26 AM6/17/16
to Maxent

I have a shapefile with regolith (soil) data that I would like to use as a categorised (categorized) raster (say 007_1ASC) in Maxent.


The regolith data is in the following files:

007_1.cpg

007_1.dbf

007_1.prj

007_1.sbn

007_1.sbx

007_1.shp

007_1.shx


Using Qgis, how can I get this into an ASC file with categorised data?

Dimitris Poursanidis

unread,
Jun 17, 2016, 10:39:47 AM6/17/16
to max...@googlegroups.com

You have to convert to raster in the desired resolution - to be matched with the one of the other raster files.

--
You received this message because you are subscribed to the Google Groups "Maxent" group.
To unsubscribe from this group and stop receiving emails from it, 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.

Steve Research

unread,
Jun 17, 2016, 12:22:38 PM6/17/16
to max...@googlegroups.com
When I look at the attribute table the columns are labelled:

gid, regid, regcode, narrative

The regcode is the value that I need to be reflected in my categorised data.

When I I go into the 'rasterize' dialogue I can select 'Attribute field' set to 'gid' or 'regid'.

How can I select 'regcode'?
Cheers,
Steve



Sent from my iPhone

Dimitris Poursanidis

unread,
Jun 17, 2016, 2:27:38 PM6/17/16
to max...@googlegroups.com
You need a field with "numerical character".
Make a new column and assign different number to each different soil type
Then make it raster and use it in maxent as categorical

-------------------------------------------------
Dimitris Poursanidis
PhDc. Marine Ecology
My pubs @ Google Scholar

Steve Research

unread,
Jun 17, 2016, 5:48:28 PM6/17/16
to Maxent
Is there an easy way to populate a new column with values as follows:

Where I have attribute name (not in table), value in table now, numerical value for new column:

alluvium, A, 1
coastal, B, 2
colluvium, C, 3
calcrete, calcrete, 4
lacustrine, L, 5
residual, R, 6
sandplain, S, 7
tidal, T, 8
exposed, X, 9

Is there a way to script that (33,000 lines!)
Steve

Michael Treglia

unread,
Jun 17, 2016, 10:19:38 PM6/17/16
to max...@googlegroups.com
I always feel like soils are tricky, because while they are typically listed as discrete, categorical types, what is often biologically meaningful (from my understanding), is the composition - for example, % sand/silt/clay, pH, etc.

If you're working with US soil data, these attributes are associated with the STATSGO and SSURGO soil databases, but in a complex way - you can get the percentages through some R code presented here: http://casoilresource.lawr.ucdavis.edu/software/r-advanced-statistical-package/aggregating-ssurgo-data-r/ - then join the resulting table back to the shapefile, and rasterize by the percentages. (if I recall correctly, the final result is the weighted average characteristics based on depth of the soil horizons)

An easier approach (in some ways), is this - there is a gridded soil dataset, with 8 different horizons, for the entire world: http://globalchange.bnu.edu.cn/research/soilw - the US portion is derived from the STATSGO data, so that is good. The complication is that those data are made available as netCDF format, which usually takes some learning in your favorite GIS package.

Not sure that helps with your direct question, but might be useful to think about.
mike
Reply all
Reply to author
Forward
0 new messages