POST
|
no, it is a single raster. I have to put it in a loop later, but now i am trying one step
... View more
03-25-2017
08:23 AM
|
0
|
0
|
815
|
POST
|
Hello, I have a shapefile with fields: x y z u v V where the first 3 fields are point coordinates, u and v velocity in x and y direction, V velocity magnitude. I want to show the velocity vector field. So i converted fields u and v to raster (feature to raster tool), then changed symbology. The direction is correct, but i cannot see magnitude. So i added to the shapefile another field, angle: atan(v/u), with the velocity direction. I converted this field to raster (direction), as well as field V (magnitude). I applied the symbology to the raster magnitude as in the picture and the size changes but they all point to the same direction. What could be the problem? I also tried to change field type of angle in the shapefile to direction. Thank you
... View more
03-25-2017
05:31 AM
|
0
|
0
|
1430
|
POST
|
Thank you for your reply. The whole code is too long but i can add a few lines in the script above. Does your code work with shapefiles, rasters, TIN and layerfiles? I can manage only with shp
... View more
03-21-2017
09:25 AM
|
0
|
2
|
815
|
POST
|
i did not realize, thank you! i cannot delete it, though. how to?
... View more
03-21-2017
09:20 AM
|
0
|
0
|
335
|
POST
|
Hello! I am trying to update the symbology of a raste layer using an existing layer file with 2 different functions: - update layer - apply symbology from layer The same function works with shapefiles, though. Nothing happens, still the code runs till the end with no error message, which makes it pretty difficult to find the error. import arcpy
arcpy.env.overwriteOutput = True
workDir = 'C:/0.STUDY PROJECT/Maps/'
mxd = arcpy.mapping.MapDocument(template)
dfs = arcpy.mapping.ListDataFrames(mxd)
df = dfs[0]
# clip is obtained interpolating a point shapefile with natural neighbours method and clipped with a polygon shapefile
clip = "C:\\0.STUDY PROJECT\\MapsKulmbach\\processed_data\\clip"
depth_data = arcpy.mapping.Layer(clip)
arcpy.mapping.AddLayer(df, depth_data)
srcLay = workDir + "depthSymbology.lyr"
srcLayObj = arcpy.mapping.Layer(srcLay)
# try function 1
arcpy.mapping.UpdateLayer(df, depth_data, srcLayObj, True)
# try function 2
arcpy.ApplySymbologyFromLayer_management (depth_data, srcLayObj)
mxd.save()
arcpy.RefreshActiveView() Do you know what a reason could be? Thank you
... View more
03-21-2017
07:57 AM
|
0
|
4
|
2129
|
POST
|
Hello! I am trying to update the symbology of a raste layer using an existing layer file with 2 different functions: - update layer - apply symbology from layer The same function works with shapefiles, though. Nothing happens, still the code runs till the end with no error message, which makes it pretty difficult to find the error. data = arcpy.mapping.Layer(raster) # raster path defined above
arcpy.mapping.AddLayer(df, depth_data) # data frame defined above
srcLay = workDir + "Symbology.lyr" # working directory defined above
srcLayObj = arcpy.mapping.Layer(srcLay)
# this function:
arcpy.mapping.UpdateLayer(df, data, srcLayObj, True)
# or alternatively:
# arcpy.ApplySymbologyFromLayer_management (data, srcLayObj) Do you know what a reason could be? Thank you
... View more
03-21-2017
07:55 AM
|
0
|
2
|
632
|
POST
|
Hello! the following commands works with shapefiles and rasters, but i cannot manage with a TIN. Do you know the reason? tin = C:\PROJECT\mytin
arcpy.CreateTin_3d(tin, CoordSys, Input_Features) # coord sys and input defined above
mylayer = arcpy.mapping.Layer('{0}'.format(tin)) I get an error: invalid data source. So i tried to save the TIN as a .lyr files first with arcpy.SaveToLayerFile_management(tin), but i get the same error. With rasters and shapefiles i just give in input the full path of the file, but about the tin? Thank you!
... View more
03-16-2017
08:42 AM
|
0
|
1
|
876
|
POST
|
Dear Ian, Thanks very much for advice! I am new to Python and the community... I update my question according to this. i will try with the snippets , but i am sure i should not use commas there because there are no commas in the desktopHelp example. The example has unfortunately only one feature as input... If you have more suggestion i am always happy to read Have a nice day! martina 2017-03-15 17:04 GMT+01:00 Ian Murray <geonet@esri.com>: GeoNet <https://community.esri.com/?et=watches.email.thread> Re: CreateTIN with arcpy using more input feautures reply from Ian Murray <https://community.esri.com/people/iamurray?et=watches.email.thread> in *ArcGIS API for Python* - View the full discussion <https://community.esri.com/message/673042-re-createtin-with-arcpy-using-more-input-feautures?commentID=673042&et=watches.email.thread#comment-673042>
... View more
03-15-2017
09:20 AM
|
0
|
3
|
585
|
POST
|
Hello! I am writing a Python code and the function createTIN does not work if i use 2 input features but i need both of them. This is the code (the workspace is defined before): area = 'Model_Area.shp' # a polygon to clip the TIN
data = 'IST_HQ100_Depth.shp' # the .shp with the height field i need
dField = 'Field4'
TIN = output + "tin" # the folder is specified above
Input_Features = "{0} {1} Mass_Points <None>".format(data, dField)
inArea = "{0} <None> Soft_Clip <None>".format(area)
arcpy.CreateTin_3d(TIN, CoordSys, [Input_Features, inArea]) The syntax in the DesktopHelp fore more inputs has squared brackets and comma like i did. If i give only one input (which is the example in the DesktopHelp) it works, but the output is wrong. With both inputs in the ArcMap GUI it works with no problem (picture) and result is correct. I really need to code it because I will put data and dField in a for loop for many data. Does anybody know what the mistake could be? Pleeease help me if you can I am using Python 2.7 and ArcMap 10.3, which should be compatible
... View more
03-15-2017
08:42 AM
|
0
|
5
|
1938
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|