Limit to character length: Geoprocessing Inputs

156
2
Jump to solution
10-21-2013 05:34 AM
KeaganAllan
New Contributor III
Good day all,

I was hoping to get clarity on an issue I am having with the use of Geoprocessing tools in VB.NET.

Essentially I have an Add-In that draws in a number of Geoprocessing Operations.

I am using the GP.Execute(Geprocessor Name, Nothing) way of conducting the whole thing.
The inputs for this need to be the path of the shapefiles i.e. C:\Directory\Test.shp

I am getting stuck when trying to use data sitting on the server.
The GP.Execute simply will not work.

If I do the process manually, it works - so I do not think its a server rights issue.
Which leads me to believe its a Character Limit - is there a character limit to inputs / outputs in a geoprocessor?

If I keep the data on my C:\ and use short directory names, everything works 100%.

Any ideas / solutions will be welcomed!

Many thanks

K
0 Kudos
1 Solution

Accepted Solutions
KeaganAllan
New Contributor III
Final Update:

It appears that the code does not like spaces in the Directory Path.
some of my project folders contained spaces and Murphy's Law, those were the ones I was testing in.

Moral of the story: Avoid having spaces in filenames and paths.

View solution in original post

0 Kudos
2 Replies
KeaganAllan
New Contributor III
Good day all,

I was hoping to get clarity on an issue I am having with the use of Geoprocessing tools in VB.NET.

Essentially I have an Add-In that draws in a number of Geoprocessing Operations.

I am using the GP.Execute(Geprocessor Name, Nothing) way of conducting the whole thing.
The inputs for this need to be the path of the shapefiles i.e. C:\Directory\Test.shp

I am getting stuck when trying to use data sitting on the server.
The GP.Execute simply will not work.

If I do the process manually, it works - so I do not think its a server rights issue.
Which leads me to believe its a Character Limit - is there a character limit to inputs / outputs in a geoprocessor?

If I keep the data on my C:\ and use short directory names, everything works 100%.

Any ideas / solutions will be welcomed!

Many thanks

K



Ok an update.
I have since tried creating a nightmare of a directory tree, trying to max out the number characters used in the input and outputs of the GP.
No errors.

I am now guessing that although I can do the process manually to our network drive, trying to do it from ArcMap using the VB Add-In may be causing the issue.
I have READ and WRITE access to this drive.
Is there something I need to call in order to allow me to use the network information?
Please find my Code Below

Thanks

K


    Public Function VS()
       ' ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop)
        Dim gp As New Geoprocessor

        Dim VSh As ESRI.ArcGIS.Analyst3DTools.Viewshed = New ESRI.ArcGIS.Analyst3DTools.Viewshed
        Dim out As String
        out = Label1.Text


        VSh.in_observer_features = Label3.Text  ' reads this from a label populated with the full path to the input feature
        VSh.in_raster = Label2.Text             ' reads this from a label populated with the full path to the raster feature
        VSh.out_raster = Label4.Text            ' reads this from a label populated with the full path to the output raster
       
        VS = gp.Execute(VSh, Nothing)           ' if the label text above points to my C:\ this works, if it points to the network drive (G:\ ; H:\ ; Q:\) it all fails
        gp = Nothing

    End Function
0 Kudos
KeaganAllan
New Contributor III
Final Update:

It appears that the code does not like spaces in the Directory Path.
some of my project folders contained spaces and Murphy's Law, those were the ones I was testing in.

Moral of the story: Avoid having spaces in filenames and paths.

View solution in original post

0 Kudos