|
POST
|
I have posted a simple script in this thread: https://community.esri.com/thread/118781#445572
... View more
01-14-2015
10:11 AM
|
0
|
0
|
8267
|
|
POST
|
Upgrade to a more recent version is good idea. The da cursor were introduced at version 10.1 SP1 (if I'm correct) and provide a big performance boost.
... View more
01-14-2015
09:04 AM
|
1
|
0
|
1706
|
|
POST
|
You can do something with a Stacked bar in ArcMap: But this is only posible if for each point the soils have the same order, and there is a column for each soil type and it contains the thickness of the layer. Since that is not realistic, you could do this with extrusión, but it requires multiple points on the same location containing data on soilt ype, depth from and depth to. Something similar as in slide 11 of this presentation (in Dutch, sorry): Bodemdaling model Provincie Utrecht - Grontmij . I created a featureclass with points for every grid cell and extracted all the values and created a related table holding the soil layer for each point.
... View more
01-14-2015
06:56 AM
|
0
|
1
|
1287
|
|
POST
|
If it is a matter of speeding up the copy process of large files, you may want to look at this article: Faster Python File Copy - Blumetech's Tech Blog If you want to record the time it took to copy the file, you can record the current time just before and just after and determine the timedelta or read the post by Owen Earley: https://community.esri.com/thread/119781#448946
... View more
01-14-2015
06:34 AM
|
0
|
1
|
5124
|
|
POST
|
If it is visibly, you can use a point and extrude the point: ArcGIS Help (10.2, 10.2.1, and 10.2.2) In case you want to extract the values from the different soil layers (is it GeoTop?), then you can use the tool Extract Multi Values to Points (Spatial Analyst) ArcGIS Help (10.2, 10.2.1, and 10.2.2)
... View more
01-14-2015
06:06 AM
|
0
|
3
|
1287
|
|
POST
|
Why don't you just you the expression below? There is no need to divide the expression into small parts and then concatenate it. The raster [slope] should not be in between quotes. Con([slope] > 0, [slope], 0.000001)
... View more
01-14-2015
04:28 AM
|
0
|
0
|
563
|
|
POST
|
Can you show what you specified for lines 3 and 4 (your input and output featureclass)? Did you try Dan Patterson suggestion?
... View more
01-14-2015
04:07 AM
|
0
|
7
|
4848
|
|
POST
|
From the documentation: shutil.copyfile(src, dst) Copy the contents (no metadata) of the file named src to a file named dst. dst must be the complete target file name; look at copy() for a copy that accepts a target directory path.
... View more
01-14-2015
04:01 AM
|
0
|
3
|
5124
|
|
POST
|
The parameter is probably defined as output, thus may not exist or will be overwritten. It may not sound very logical to you, but change the direction to input of the folder parameter.
... View more
01-14-2015
03:50 AM
|
2
|
0
|
1706
|
|
POST
|
Here you have an example of using the da cursor (insert and search nested) to read and write geometry. The da cursor area available for 10.1 (SP1?) and higher: https://community.esri.com/thread/119916#449508 You can first create the insert cursor, next the search cursor and then start to loop the features using the search cursor. Don't put the insert cursor inside the loop through the search cursor.
... View more
01-13-2015
07:31 PM
|
0
|
0
|
1722
|
|
POST
|
Why not reclassify the LULC raster (holding the 14 integer values) using ReclassByASCIIFile with a ASCII file that has the relation between the input and output values like this: 1 : 0.4 2 : 0.4 3 : 0.4 4 : 0.4 5 : 0.4 6 : 0.3 7 : 0.3 8 : 0.3 9 : 0.3 10 : 0.3 11 : 0 12 : 0.3 13 : 0 14 : 0.3 ... and then multiply the reclassified raster by the Simard raster.
... View more
01-13-2015
07:25 PM
|
0
|
0
|
1299
|
|
POST
|
Tim is right, you can have a raster dataset, in which you obviously won't find any featureclasses. You could try this: import arcpy
# reference to you database
arcpy.env.workspace = r""
dataList = arcpy.ListTables()
dataList += arcpy.ListRasters()
fds = arcpy.ListDatasets(feature_type="Feature")
fds.append("")
for fd in fds:
dataList += arcpy.ListFeatureClasses(feature_dataset=fd)
arcpy.ReconcileVersions_management(workspace,"ALL_VERSIONS","SDE.Default",verList,"NO_LOCK_ACQUIRED","NO_ABORT","BY_ATTRIBUTE","FAVOR_TARGET_VERSION","NO_POST","KEEP_VERSION")
... View more
01-13-2015
03:34 PM
|
0
|
0
|
1558
|
|
POST
|
You can use some python to obtain the points you want: import arcpy, os
fc_in = r"C:\Forum\Pasture\gdb\Contours.gdb\contours2"
fc_out = r"C:\Forum\Pasture\gdb\Contours.gdb\contour_pnts03"
fld_contour = "Contour"
interval = 1
# create empty output featureclass
sr = arcpy.Describe(fc_in).spatialReference
out_ws, out_name = os.path.split(fc_out)
arcpy.CreateFeatureclass_management(out_ws, out_name, "POINT", fc_in, "DISABLED", "DISABLED", sr)
# add field with contour value to output fc
arcpy.AddField_management(fc_out, fld_contour, "DOUBLE")
cnt = 0
with arcpy.da.InsertCursor(fc_out, ("SHAPE@", fld_contour)) as curs_out:
with arcpy.da.SearchCursor(fc_in, ("SHAPE@", fld_contour)) as curs_in:
for row_in in curs_in:
polyline = row_in[0]
contour = row_in[1]
max_len = polyline.length
d = 0
while d < max_len:
pnt = polyline.positionAlongLine(d, False)
curs_out.insertRow((pnt.firstPoint, contour, ))
cnt += 1
if cnt % 100 == 0:
print "Processing point: {0}".format(cnt)
# pnt.firstPoint
d += interval
curs_out.insertRow((polyline.lastPoint, contour, ))
cnt += 1 Change the lines 3 and 4 to point to your input featureclass and the output you want to create.
... View more
01-13-2015
03:14 PM
|
1
|
14
|
4848
|
|
POST
|
Die Attributwerte der Eingabe-Feature-Classes werden in die Ausgabe-Feature-Class kopiert. Wenn es sich bei der Eingabe jedoch um Layer handelt, die mit dem Werkzeug Feature-Layer erstellen erstellt wurden, und die Option Verhältnismethode verwenden eines Feldes aktiviert ist, wird ein Verhältnis zum Eingabe-Attributwert berechnet. Ist die Option Verhältnismethode verwenden aktiviert, stellen die Attribute des resultierenden Features bei jeder Teilung eines Features in einem Überlagerungsvorgang ein Verhältnis des Attributwertes des Eingabe-Features dar. Der Ausgabewert basiert auf dem Verhältnis, in dem die Eingabe-Feature-Geometrie geteilt wurde. Falls die Geometrie z. B. in gleiche Teile geteilt wurde, wird dem Attributwert jedes neuen Features der halbe Wert des Attributwertes des Eingabe-Features zugewiesen. Verhältnismethode verwenden gilt nur für numerische Feldtypen. Vereinigen (Union) (Analyse)
... View more
01-13-2015
05:26 AM
|
0
|
0
|
1165
|
|
POST
|
... and if you want to create an output that contains the attributes of the input, you can try this: import arcpy, os
def main():
arcpy.env.overwriteOutput = True
# inputs
fc_in = r'D:\Xander\EPM\Datos pruebas\gdb\datos erase.gdb\points03'
width = 0.005 # with of the output rectangle
height = 0.005 # height of the output rectangle
# output
fc_out = r'D:\Xander\EPM\Datos pruebas\gdb\datos erase.gdb\rectangles3'
# create empty output featureclass
sr = arcpy.Describe(fc_in).spatialReference
out_ws, out_name = os.path.split(fc_out)
arcpy.CreateFeatureclass_management(out_ws, out_name, "POLYGON", fc_in, "DISABLED", "DISABLED", sr)
# make fields list
flds_use = correctFieldList(arcpy.ListFields(fc_in))
# create insert cursor
with arcpy.da.InsertCursor(fc_out, flds_use) as curs_out:
# loop through input features
with arcpy.da.SearchCursor(fc_in, flds_use) as curs_in:
for row_in in curs_in:
polygon = createRectangleFromPoint(row_in[0].firstPoint, width, height, sr)
row_out = buildRow(row_in, flds_use, polygon)
curs_out.insertRow(row_out)
def createRectangleFromPoint(pnt, width, height, sr):
arrPnts = arcpy.Array()
pnt2 = arcpy.Point(pnt.X - width, pnt.Y - height)
arrPnts.add(pnt2)
pnt2 = arcpy.Point(pnt.X - width, pnt.Y + height)
arrPnts.add(pnt2)
pnt2 = arcpy.Point(pnt.X + width, pnt.Y + height)
arrPnts.add(pnt2)
pnt2 = arcpy.Point(pnt.X + width, pnt.Y - height)
arrPnts.add(pnt2)
pnt2 = arcpy.Point(pnt.X - width, pnt.Y - height)
arrPnts.add(pnt2)
return arcpy.Polygon(arrPnts, sr)
def correctFieldList(flds):
flds_use = ['Shape@']
fldtypes_not = ['Geometry', 'Guid', 'OID']
for fld in flds:
if not fld.type in fldtypes_not:
flds_use.append(fld.name)
return flds_use
def buildRow(row_in, flds_use, polygon):
try:
lst_in = list(row_in)
lst_in[0] = polygon
return tuple(lst_in)
except Exception, e:
print("buildRow exception: {0}".format(e))
return None
if __name__ == '__main__':
main()
... View more
01-13-2015
04:31 AM
|
1
|
0
|
5702
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-09-2020 09:26 AM | |
| 6 | 12-20-2019 08:41 AM | |
| 1 | 01-21-2020 07:21 AM | |
| 2 | 01-30-2020 12:46 PM | |
| 1 | 05-30-2019 08:24 AM |
| Online Status |
Offline
|
| Date Last Visited |
2 weeks ago
|