|
POST
|
There's as well a identation error at line 14. I thought with line 15 I could do a for loop through each part of the geometrie?
... View more
01-31-2020
06:28 AM
|
0
|
0
|
3136
|
|
POST
|
Maybe it is helpful to create a point feature class of firstPoint == lastPoint places? You could try this script? import arcpy
arcpy.env.overwriteOutput = True
inFc = r"Yourpath...\Problem Data.gdb\problem_road_isolated"
inFcS = r"Yourpath...\Problem Data.gdb\problem_road_isolated_single"
outPoint = r"Yourpath...\Problem Data.gdb\\ClosedRing"
arcpy.MultipartToSinglepart_management(inFc, inFcS)
CoordList = list()
with arcpy.da.SearchCursor (inFcS, "SHAPE@") as sCurs:
for geom, in sCurs:
for i in range(geom.partCount):
part = geom.getPart(i)
if geom.lastPoint.X == geom.firstPoint.X:
CoordList.append("{}; {}".format(geom.lastPoint.X, geom.lastPoint.Y))
pt = arcpy.Point()
ptGeoms = []
spatial_reference = arcpy.SpatialReference(3111)
for p in CoordList:
coord = p.split(";")
pt.X = coord[0]
print(coord[0])
pt.Y = coord[1]
print(coord[1])
ptGeoms.append(arcpy.PointGeometry(pt, spatial_reference))
arcpy.CopyFeatures_management(ptGeoms, outPoint)
arcpy.AddXY_management(outPoint)
... View more
01-31-2020
06:09 AM
|
1
|
2
|
3136
|
|
POST
|
Could this be helpful? Value Error when adding adding a layer in ArcGIS Pro arcpy script - Geographic Information Systems Stack Exchange
... View more
12-11-2019
02:25 AM
|
0
|
0
|
2128
|
|
POST
|
Sometimes a small hint helps, glad you get it to work.
... View more
12-10-2019
06:17 AM
|
0
|
0
|
1592
|
|
POST
|
Did you try one of these codes? Deleting first and last vertices using ArcPy of ArcGIS Pro? - Geographic Information Systems Stack Exchange
... View more
12-10-2019
04:36 AM
|
1
|
2
|
1592
|
|
POST
|
Could this be a solution for you? import glob, os, shutil
from shutil import copyfile
inPath = r"yourPath"
outPath = r"yourPath"
for file in glob.glob(os.path.join(inPath, "*.pdf")):
outFolder = os.path.basename(file[:-4])
if os.path.isdir(os.path.join(outPath, outFolder)):
shutil.rmtree(os.path.join(outPath, outFolder))
else:
pass
outDir = os.mkdir(os.path.join(outPath, outFolder))
outDir1 = os.path.join(outPath, outFolder)
outFile = os.path.join(outDir1, os.path.basename(file))
copyfile(file, outFile)
... View more
12-09-2019
06:16 AM
|
1
|
0
|
957
|
|
POST
|
I don't know how to do this in the model builder - but with python maybe you could define your input data and output with the following code? It's from: datetime - Iterating through a range of dates in Python - Stack Overflow from datetime import timedelta, date
def daterange(start_date, end_date):
for n in range(int ((end_date - start_date).days)):
yield start_date + timedelta(n)
start_date = date(2009, 12, 31)
end_date = date(2010, 12, 31)
for single_date in daterange(start_date, end_date):
d = single_date.strftime("%Y%m%d")
d1 = single_date+timedelta(days=1)
d2 = d1.strftime("%Y%m%d")
input1 = "DSLR_CHIRPS_{}.tif".format(d)
input2 = "CHIRPS_{}.tif".format(d2)
output = "DSLR_CHIRPS_{}.tif".format(d2)
print("{} - {} - {}".format(input1, input2, output))
... View more
12-05-2019
02:37 AM
|
0
|
1
|
1400
|
|
POST
|
Maybe this could be helpful as well - there are models to download? Building models for automatic landslide-susceptibility analysis, mapping and validation in ArcGIS | SpringerLink
... View more
12-02-2019
05:17 AM
|
1
|
0
|
1051
|
|
POST
|
Don't forget to backup before ... This code can be used to rename your raster data to MOD60, MOD61. Hopefully. Without terra and aqua, don't know why you want this? import arcpy, os, re
workspace = r"yourpath"
walk = arcpy.da.Walk(workspace, topdown=True, datatype="RasterDataset")
for dirpath, dirnames, filenames in walk:
for filename in filenames:
rasterE = os.path.join(dirpath, filename)
filename1 = re.sub("04_3K.A20190", "", filename)
filename2 = filename1[:5]
print filename2
rasterRename = os.path.join(dirpath, filename2)
arcpy.Rename_management(rasterE, rasterRename)
... View more
11-28-2019
06:01 AM
|
1
|
2
|
1387
|
|
POST
|
After line 13 you could insert: prefix1 = prefix1.replace("O", "Y")
Python String replace() Method - Tutorialspoint
... View more
11-28-2019
04:12 AM
|
0
|
5
|
1387
|
|
POST
|
It can't work because you use different prefix. MOD60_ is not the same as MYD60_. So you could rename MYD60_ to MOD60_ etc. and it should find the rasterdata? Or use replace() in you script?
... View more
11-28-2019
02:23 AM
|
1
|
3
|
1458
|
|
POST
|
Could you post the code you use like this? https://community.esri.com/docs/DOC-8691-posting-code-with-syntax-highlighting-on-geonet
... View more
11-28-2019
01:31 AM
|
1
|
7
|
1458
|
|
POST
|
Don't know if it could be the reason, you are using spaces in your paths: ...\final 2\... . What if you use ...\final_2\... ?
... View more
11-27-2019
05:06 AM
|
0
|
9
|
1458
|
|
POST
|
I ofter can't find self intersections with the Check Geometry Tool, it is a bit unreliable especially with very small mistakes. I can offer several shapes with self intersections not found by Check Geometry Tool (10.4.1) - unfortunately I don't have pro.
... View more
11-21-2019
07:31 AM
|
0
|
1
|
1252
|
|
POST
|
A working possibility could be to convert to numpy array, then use pandas to convert the array to excel? import arcpy
import pandas as pd
arcpy.env.overwriteOutput = True
inTable = r"yourpath\Export_Output.shp"
outTable1 = r"yourpath\export.xls"
fieldNames = ["OBJECTID", "PARCEL_NO", "OwnerName", "Address", "City", "State", "ZipCode"]
arr = arcpy.da.FeatureClassToNumPyArray(inTable, fieldNames)
df = pd.DataFrame(arr)
df1 = df.to_excel(outTable1, index=False)
... View more
11-19-2019
04:51 AM
|
0
|
0
|
998
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-10-2025 08:08 AM | |
| 1 | 05-13-2025 05:05 AM | |
| 1 | 04-28-2025 03:40 AM | |
| 4 | 08-13-2024 10:49 PM | |
| 1 | 08-13-2024 09:52 PM |
| Online Status |
Offline
|
| Date Last Visited |
2 weeks ago
|