Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Using: QGIS 2.0.1

I am trying to separate a large fauna point .shp file into many shapefiles based on each species' unique name attribute (i.e. by "SCI_NAME" field)???

I am currently using "Split vector layer by attribute" from the toolbox but am unable to name the resulting .shp files with the attribute name (It is currently naming them with say: "SCI_NAME_1", "SCI_NAME_2" ...)

The correct naming issue is the main concern. Unless a different methodology is suggested.

I have seen this post:

The SAGA algorithm has been removed and there is a native one implemented as an example script in SEXTANTE. It is called "Split vector layer by attribute".

answered Jan 28 at 17:32 Victor Olaya

The resulting files are named, appending a number. You you edit the script and edit the following line: outputFile = output + "_" + str(len(writers)) + ".shp" to suit your needs in case you want a differnt naming – Victor Olaya Jan 28 at 17:35

... but have been unable to work out how to "edit the script".

(hehe: have not ventured into the world of scripting/programming {or whatever all that text means} yet)

... but will be able to work out copy/paste if you transcribe(?) how it should look.

Cheers.

EDIT: i have been informed how to change a line in the script to this:

outputFile = output + "_" + str(clazz) + ".shp"

which get's the attribute value into the filename, however, it leaves the field/column title in the front of the filename which is not good for organising/searching my .shp files.

when i simply remove this part (in bold): outputFile = output + "_" + str(clazz) + ".shp" the script no longer runs (or no longer produces output files).

can anyone help me overcome this problem?

(i.e. how to hide the field/column heading presence in the filename)

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.