1

Having a problem with the inline variable structure of %Name%. Attached is my model builder program. I want to be able to take the Name of the file (which is produced as a variable in the iterate raster loop) and use it to name the final output of the model. The main idea is that I want to retain the final name. The naming structure within my work space is the date on which the raster was made (satellite imagery). I wrote a few batch files to eliminate erroneous characters in the file name leaving a YYYYMMDD schema. I want to be able to insert the final work space of rasters into a raster catalog in order to show time (using the Name as the temporal discriminator). I just need to name the final output like the input file.

enter image description here

When I use the output name E:\ArcGIS\GIS_Data\Kuwait_Clipped_Normalized.gdb\%Name% I get an error.

error

Not sure why I can not reference %Name% as the file name as the Reclass by Table output.

I have even tried a few other options, but they did not work. I used the Parse Path on the Raster output and referenced %Value% as the file name (instead of %Name%). I also calculated a field as well, with no success.

Or, Is there a way I can carry over the file name attribute with the raster? I just need to retain the file name variable to preserve the time series.

  • Do any of your rasters have spaces in their names, e.g. "20130101 DATA"? – nmpeterson Apr 29 '15 at 18:35
  • No it will just be 20130101 as the file name – Andrew Desrosiers Apr 29 '15 at 18:37
1

Geodatabase feature class (and raster, etc.) naming rules:

  • Names must begin with a letter, not a number or special character such as an asterisk (*) or percent sign (%).
  • Names should not contain spaces. If you have a two-part name for your table or feature class, connect the words with an underscore (_), for example, garbage_routes.
  • Names should not contain reserved words, such as select or add. Consult your DBMS documentation for additional reserved words.
  • The length of feature class and table names depends on the underlying database. The maximum name length for file geodatabase feature classes is 160 characters. Be sure to consult your DBMS documentation for maximum name lengths.

Source

  • Thought about that as well...I just ran it with an output name of R_%Name% still failed with the same error. – Andrew Desrosiers Apr 29 '15 at 18:42
  • Both parts of the error, or just "No spatial reference exists"? – nmpeterson Apr 29 '15 at 19:44
1

Although it's been a while since this was asked: I have found oftentimes that any underscore (_) in the layer name will trip an error. Try removing those as well (you may need to recreate said layers, as the name of the file where they are saved is what is read by the model) and examine the output result (incl. any error messages) in the execution console.

0

nmperterson is correct with the naming rules. Names must begin with a letter, not a number or special character such as an asterisk (*) or percent sign (%).

However, this was not the full solution to the problem. What was done to carry over the Name 20130101 to the output file in my case was utilizing the Parse Path Function and outputting a new Variable (Value).

What nmpeterson said, now comes into effect. I named the output file XX_%Value% where XX is any string of valid characters. I do not want these characters in my file name, but there was a way around the file name to time delineation attribute.

Upon running the model for several days worth of HDF satellite data, a raster was created with the above file name. I needed to collect all of these rasters into a raster catalog in order to impose the temporal aspect to this data. Since the file name contains the date time stamp. I added a new field in the raster catalog and ran a field calculation on that field: Replace([Name], "XX_", "")

This resulted in the time stamp 20130101.

I was able to enable time on the map and loop of a 1 day increment and create a video.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.