Skip to main content
I have this workspace:

 

read LAS ->PointCloudCoercer->RasterDEMGenerator

 

 

I also have read into the workspace a raster (ECW)

 

 

In the parameters of the RasterDEMGenerator, I have defined the resolution of the output as:

 

Output DEM X Cell Spacing: $(SourceDataset_ECW)

 

Output DEM Y Cell Spacing: $(SourceDataset_ECW)

 

 

This fails with the error:

 

RasterDEMGenerator(SurfaceModelFactory): Fail to process the SAMPLE_SPACING clause because it contains an invalid entry or it contains an invalid number of entries.

 

 

The ECW file is very much not corrputed, and reads fine in Data Inpector.

 

 

How should I be referencing  the properties of an already existing raster with the RasterDEMGenerator?

 

 

The overall goal here is of course to output a raster from a point cloud that has the exact resolution of an already existing raster and is also "snapped" to it.

 

 

 

 

 

Hi,

 

 

The RasterPropertiesExtractor can be used to extract raster properties including spacing x, y (called _spacing_x, _spacing_y). You can then merge the attributes to the LAS feature with the FeatureMerger, and specify them to the parameters of the RasterDEMGenerator.

 

The RasterPropertiesExtractor extracts many properties. It's better to remove attributes except spacing x, y before merging to save memory usage.

 

 

Takashi
Hi Takashi,

 

 

I tried using the RasterPropertiesExtactor before, and I just did it again with your advice about using the FeatureMerger. Unfortunatly, I cant get the _spacing_x and _spacing_y to show up as an attribute value option in the RasterDEMGenerator parameters. I only can get the variables under User Parameter. 

 

 

As a test, I tried using the NumericRasterizer (not really what I want), and with this transformer, I could get the spacing attributes read in as a parameter - but then I get the error: NumericRasterizer(VectorToRasterFactory): Cannot convert 'X_CELL_SIZE' value of ''

 

 

Below is a picture of my workspace, along with the parameters of the RasterDEMGenerator (and the lack of access to the x and y spacing attributes). 

 

 

 


Also - Im unclear how defining the same raster spacing / cell size would guarantee that the cells would overlap with a pre-existing raster? Does that guarantee require still another transformer?


Ah, I was wrong. "Output DEM X/Y Spacing" cannot be specified as attribute value...

 

A workaround I can think of is:

 

Define published user parameters to recieve x, y spacings (e.g. X_SPACING, Y_SPACING). Specify them to parameters of the RasterDEMGenerator.

 

Create a 2nd workspace to extract x, y spacings from the ECW. In the workspace, use a WorkspaceRunner to pass the spacing values to the main workspace.

 

Run the 2nd workspace.
Yup, the attribute value limitation is a bit of hindrance here.

 

 

Eitehr workspace runner schem, like Takashi suggest or maybe use scripted parameter.

 

 


Hey Takashi / Gio. Seems like this questions is taking me down an unexpected path! I am going to try the workspace runner method, as it seems simpler - though I still have some basic questions about it:

 

 

Takashi, following your advice on the first workspace, could you give some clarification? How do I pass the x_spacing and y_spacing that comes from RasterPropertiesExtractor to a user parameter and have that be the "output" of an entire workspace? 

 

 

The way I tried was to setup a workspace ECW>RasterPropertyExtractor, then on the Navigator tab, under UserParameters>Published Parameters, I right clicked that pressed "Add parameter", but when I try to link the default value to the Attribute Value of the the RasterPropertyExtractor I only have "User Parameter" as an option. Am I taking the wrong approach?

 

 

 

 


After posting the above, I realized I need an "AttributeCreator" to expose the x and y spacing publicly (called xx and yy in the below picture). Just want to confirm this is the correct approach? 

 

 


As for the second part of the solution - I tried working with WorkspaceRunner, but I am obvioulsy missing something. Do I need a special transformer to fetch a public parameter from the first workspace? Here is a screen shot showing where I expected I might have access to the parameters in the other workspace via workspace runner:

 

 

 


Sorry, my previous post was not clear. The WorkspaceRunner should be added in the 2nd workspace. My intention is as the following images.

 

 

1st (main) workspace

 

 

 

2nd (runner) workspace

 

 


Hi Takashi,

 

 

Thanks for the additional tips - however, having never used this approach before, I am struggling to figure out how I can "use a WorkspaceRunner to pass the spacing values" as you show in your second picture. Is this done through the Navigator window, a transformer, the parameters of the workspacerunner...?
You can pass appropriate values to published parameters of the 1st workspace through parameter settings in the WorkspaceRunner.

 

 


Thanks - got it working! 

Reply