0

I am developing tool on ArcGIS ArcMap 10.0 with .NET and Python technology.

In TOPOTORASTER tool , I give a line feature class. the line feature class path something like this:

inputOne = "C:\Users\DELL\AppData\Local\Temp\tmpA378\tmpA379.gdb\PerpendicularLine"

inPointElevations = inputOne
print os.path.dirname(inputOne)
pathAfterJoin = os.path.join(inputOne)

arcpy.TopoToRaster_3d(inPointElevations,"D:\\Temp\\topo1234")

but in python IDE (pycharm) I have seen that feature class path is not valid. feature class path is broken and it becomes like:...C:\Users\DELL\AppData\Local\Temp mpA378 mpA379.gdb ....

space is taken tempA378 folder ...

How to efficiently give input feature class path ??

I am trying like :

arcpy.TopoToRaster_3d(r'inPointElevations',"D:\\Temp\\topo1234")

but not work..

closed as unclear what you're asking by PolyGeo Feb 10 '16 at 6:11

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 4
    you missed the r"" in the first path-strings? inputOne = r"C:\Users\DELL\AppData\Local\Temp\tmpA378\tmpA379.gdb\PerpendicularLine" – Andreas Müller Feb 8 '16 at 12:20
  • 3
    This is a common error in Python path usage. You must either prefix strings with backslahes with "r" or escape backslashes with an additional backslash or use a forward slash instead – Vince Feb 8 '16 at 12:21
  • 1
    Alternatively you can use os.path.join and Python will handle the insertion of forward/backward slashes depending on the OS the code is ececuted on. – Kersten Feb 8 '16 at 12:45
  • 1
    Your question is confusing. In the title you talk about a "shapefile directory" but in your question body you seem to be using a file geodatabase. You say "I am developing tool on ArcGIS ArcMap 10.0 with .NET and Python" but make no other reference to .NET, so that statement seems to just be a distraction from any ArcPy/Python issue you may be encountering. Please take the tour to learn how the site works and use the edit button to make your question clearer. – PolyGeo Feb 10 '16 at 6:11
2

You seem to have misinterpreted a suggestion offered in a comment.

Instead of:

inputOne = "C:\Users\DELL\AppData\Local\Temp\tmpA378\tmpA379.gdb\PerpendicularLine"

inPointElevations = inputOne
print os.path.dirname(inputOne)
pathAfterJoin = os.path.join(inputOne)

arcpy.TopoToRaster_3d(inPointElevations,"D:\\Temp\\topo1234")

try using:

inputOne = r"C:\Users\DELL\AppData\Local\Temp\tmpA378\tmpA379.gdb\PerpendicularLine"

inPointElevations = inputOne
print os.path.dirname(inputOne)
pathAfterJoin = os.path.join(inputOne)

arcpy.TopoToRaster_3d(inPointElevations,"D:\\Temp\\topo1234")

and if it does not work then include the exact error message from running exactly this code in your question.

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