Skip to main content
Hi There,

 

 

Currently my workspace runs a number of calculations (such as legth and counts) on all shapefiles contained within a selected folder, and then writes them all to an Excel spreadsheet. There are also two additional parameters to define:

 

 

1. Selecting a shapefile

 

2. Selecting an Attribute (The list of attributes comes from the folder selected earlier)

 

 

And for this individually selected shapefile, additional, seperate calculations are done.

 

 

The Problem I have though, is that every thing seems to work perfectly, and my calculations for the parameter defined attribute seems okay... But, I have no way of extracting this value, or turning the parameter value back in to a attribute to populate in the spreadsheet.

 

 

Example:

 

Step1 - Folder is selected containing all shapefiles

 

Parameter: FOLDER - (ROADS.shp, RIVERS.shp, LANDUSE.shp, etc...)

 

Step 2 - Additional single file (within that folder)  is selected to run extra tests on

 

Parameter: FILE - ROADS.shp is selected

 

Step 3 - Attribute is selected for for extra tests to be sorted by.

 

Parameter ATTRIBUTE - FILED ROADS.shp - LEVEL is selected attribute. Output will be sorted by this attribute

 

 

So my standard output for all the other files in that folder looks something like this

 

 

Feature | Counts | Length

 

ROADS | 23          | 208km

 

RIVERS| 17          | 314km

 

  And so on...

 

Then, for the Parameter selected feature, and the paramter selected Attribute, an additional tab is created, that SHOULD look like follows:

 

 

Note: The ROAD.shp has values from 1-4 in the LEVEL attribute

 

 

attribute | Counts | Length

 

1             | 3            | 53km

 

2             | 7            | 47km

 

3             | 5            | 38km

 

4             | 8            | 70km

 

 

Unfortunatley, every thing goes fine up untill the point after all the calculations, where the attributes in the additional tab needs to be populated and written. I've tried using a ParameterFetcher on the ATTRIBUTE parameter, and then create a target attribute named just "attribute", but then I get the following:

 

 

attribute | Counts | Length

 

LEVEL   | 23           | 208km

 

LEVEL   | 23           | 208km

 

LEVEL   | 23           | 208km

 

LEVEL   | 23           | 208km

 

 

And that's just not right. So it seems to retrieve the value selected in the paramter, instead of the actual value of level. However, the fact that there are still 4 records comming through, gives me some hope, seeing as there are 4 unique LEVEL values.

 

 

I appologise beforehand for any confusion, as this kind of question is very difficult to explain. Any Kind of help would be greatly appreciated.

 

 

Kind Regards,
Hi,

 

 

not sure I understood everything, but could it be that you're looking for the AttributeDereferencer?

 

 

David
Hi David,

 

 

I just tried AttributeDeferencer, and unfortunatley, no luck...

 

 

I still get this result:

 

 

attribute | Counts | Length

 

LEVEL   | 23           | 208km

 

LEVEL   | 23           | 208km

 

LEVEL   | 23           | 208km

 

LEVEL   | 23           | 208km

 

 

Instead of:

 

attribute | Counts | Length

 

1             | 3            | 53km

 

2             | 7            | 47km

 

3             | 5            | 38km

 

4             | 8            | 70km

 

 

This means that the AttributeDereferencer still just populates the "attribute" field with the name of the attribute selected, instead of it's value.

 

 

The aim of these parameters are for a user to be able to select a specific feature, and a spesific attribute. The additional tab then created should show the total counts and total lengths of each unique value of the paramater selected attribute. So thats why I want it to show (for the feature roads, and it's attribute level for example) "there are 7 level 2 roads features, and 5 level 3 features, in addition to their lenghts.

 

 

To give a second example, if I were to choose other values:

 

Feature Selected in paramter: RIVERS

 

Attribute selected in paramter: COLOR (present is Brown; Blue; Green)

 

 

So what I want is:

 

attribute | Counts | Length

 

Blue       | 3            | 53km

 

Brown    | 7            | 47km

 

Green    | 5            | 38km

 

 

Instead, what I currently get is:

 

attribute | Counts | Length

 

COLOR | 15           | 138km

 

COLOR | 15           | 138km

 

COLOR | 15           | 138km

 

 

 

I hope this adds some more perspective.

 

 

Thanks and Regards,
Hi,

 

 

I don't grasp your situation perfectly, but from those wrong results you posted, I guess the point of the problem may be concerned with something like the issue discussed in this article.

 

 

Takashi
Hi Takashi,

 

 

Ahh yes, this was exactly what I was looking for, thanks a million. Sometimes it's hard to find something without being sure what you're looking for :)

 

 

 

Kind Regards,

Reply