|
POST
|
thanks! confirmed. If I create a new feat. dataset with smaller tolerance, (0.0000000089 degrees) then import the feat. classes, no self intersections are found. Too bad you can't set tolerances; going to have to recreate thousands of feat. datasets; then import the feat. classes.
... View more
06-08-2011
05:21 AM
|
0
|
0
|
9235
|
|
POST
|
more info.... If I create a new feat. dataset, then import the feat. class that contains self intersections, and re-run check geometry; no errors are reported! Could someone explain?
... View more
06-07-2011
09:30 AM
|
0
|
0
|
9235
|
|
POST
|
Several thousand polygon feat. classes contain geometry problems, almost all self intersections. I need to repair the self intersections for a variety of reasons: 1. negative area calculations 2. I need to remove all arc segments from all features; to do so with only an ArcView license, I have to run shape_density.cal, (/www.ian-ko.com) on shape field. With geom. issues this does not run correctly. 3. Oracle database that features are being loaded into checks for geom. issues After a self intersection(s) is identified, the repair geom. tool is ran. However, the resulting features differs significantly from the original feature. I understand the self intersections polys are dissolved...any way to correct this? i.e. repair geometry but not significantly alter the feature? I attached an image of the original feature and after the geom. had been repaired. thanks
... View more
06-07-2011
09:07 AM
|
0
|
7
|
16845
|
|
POST
|
thanks Jake. Yeah, unfortunately, most of the feat. classes I need to check are polygons
... View more
06-06-2011
05:18 AM
|
0
|
0
|
2494
|
|
POST
|
not the most elegant solution, but to calc. geometries of an unprojected feat. class, I ended up: projecting feat. class - output to temp.gdb calculated geometry of temp feat. class make feat. layer of temp feat. class join temp feat. layer "OBJECTID" ----- with ----- original feat. class "OBJECTID" calc field of orig. feat. class with the calculated geometries
... View more
06-03-2011
01:00 PM
|
0
|
0
|
675
|
|
POST
|
depending on how many gdb's you have, this can be done in ArcMap...manually. 1. Start with a new ArcMap document, then double click on 'layers' in the table of contents 2. in data frame properties, go to coordinate system tab/ predefined/ geographic coor system/world/wgs84 3. hit "ok, then "yes" on the warning 4. add your feat classes 5. create 2 new fields, named 'lat' and 'long' 6. right click on the field and choose 'calc geometry' 7. select 'y coordinate of a point' then select 'use coordinate system of the dataframe' units 'decimal degrees' 8. you now have a column of latitude coordinates. 9. do the same for 'long' field. remember, x measures distance E/W of Prime Meridian, y measures N/S of equator
... View more
06-03-2011
12:53 PM
|
1
|
0
|
4357
|
|
POST
|
humm, created 2 polygons inside a feat. class. OBJECTID = 1 was created using the "end arc point segment tool" and OBJECTID = 2 was created using the "straight line segment" tool. Ran this script: fclist = gp.listfeatureclasses("arc_test*")
for fc in fclist:
rows = gp.searchcursor(fc)
row = rows.next()
while row:
typ = row.Shape
geom = str(typ.centroid.X)
print row.getvalue("OBJECTID"), geom
truegeom = str(typ.truecentroid.X)
print row.getvalue("OBJECTID"), truegeom
row = rows.next() Here is the output: 1 -93.0638463269 1 -93.0638463269 2 -93.0635589449 2 -93.0635589449 both geom & truegeom are the same, for both polygons, even though 1 of them contains an arc segment??
... View more
06-03-2011
09:36 AM
|
0
|
0
|
2494
|
|
POST
|
In python, how would one go about identifying feat. classes that contain arc segments? Client's oracle system wont' load feat. classes containing arcs, and I don't have ArcInfo to run generalize command! So, best I can do is identify feat. classes, then manually fix them in ArcMap...thanks.
... View more
06-03-2011
08:11 AM
|
0
|
6
|
4496
|
|
POST
|
this should get ya going. I didn't see the need for the .describe since your end goal is to loop through datasets/features anyway. Take note of the "*" wildcards in the listdatasets and listfeatureclasses methods. You could enter "utilities*" to only loop through all feat. datasets that begin with "utilities". dsList = arcpy.ListDatasets("*", "Feature")
for dataset in dsList:
arcpy.env.workspace = sde + "\\" + dataset
fcList = arcpy.ListFeatureClasses("*")
for feature in fcList:
arcpy.env.workspace = dataset + "\\" + feature
featout = output + dataset + "\\" feature
print featout
arcpy.Project_management(feature, featout, outCS, transformation, inCS)
... View more
05-25-2011
01:47 PM
|
0
|
0
|
788
|
|
POST
|
Hi everyone, I have a gdb (v9.3) with several feat. datasets. All the feat. datasets are unprojected, coor. system set to WGS1984. I can calc. coord_x and coord_y fields of the point feat. classes fine using the below code, all is well. Once the script hits a polygon feat. class, I would like to calc. the area_size field to area - acres. At present, the code doesn't calculate anything, even with the polyref pointing to a projected, .prj file. At the bottom, in the 'polygon' section, you'll see a commented out section: #expression = "!shape.area@acres!"
#gp.CalculateField_management(fc, fn, expression, "PYTHON_9.3") When this is uncommented, (and the updatecursor method commented out) it calculates area just fine, but of course, since the feat. class is unprojected, it calc.s area_size to 1.4857433E-06, which obiv. is in WGS84 DD. Any thoughts? thanks! # Import system modules
import arcgisscripting, os
gp = arcgisscripting.create(9.3)
# Load required toolboxes...
#gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")
gp.AddToolbox("C:/Program Files/ArcGIS/Desktop10.0/ArcToolbox/Toolboxes/Data Management Tools.tbx")
#gp.workspace = r"G:\\63D RRC GIS Data\\63D_RSC_GDB"
gp.workspace = r"C:\\temp\\python"
#gp.workspace = r"G:\\63D RRC GIS Data"
pathwrksp = gp.workspace
# print pathwrksp
PointRef = r"C:\\Program Files\\ArcGIS\\Desktop10.0\\Coordinate Systems\\Geographic Coordinate Systems\\World\\WGS 1984.prj"
PolyRef = r"C:\\Program Files\\ArcGIS\\Desktop10.0\\Coordinate Systems\\Projected Coordinate Systems\\Continental\\North America\\USA Contiguous Albers Equal Area Conic USGS.prj"
path2wrksps = gp.ListWorkspaces("OK002*")
for path2wrksp in path2wrksps:
#print "... " + path2wrksp
gp.workspace = path2wrksp
facil_id = str(path2wrksp[34:39])
instln_id = "06510"
#print facil_id
wrksps3 = gp.ListWorkspaces("*", "FileGDB")
for wrksp3 in wrksps3:
gp.workspace = wrksp3
print "...... " + gp.workspace
datasets = gp.ListDatasets("cad*")
for dataset in datasets:
gp.workspace = wrksp3 + "\\" + dataset
#print dataset
FcList = gp.ListFeatureClasses("*","Point")
for fc in FcList:
gp.workspace = dataset + "\\" + fc
if fc <> "soil_map_unit_area":
if fc <> "wetland_area":
if fc <> "flood_zone_area":
print fc
#if gp.exists("vehicle_parking_area"):
rows = gp.UpdateCursor(fc, "", PointRef)
for row in rows:
allFields = gp.listfields(fc)
print fc
for field in allFields:
fn = field.name
if fn == "coord_x":
feat = row.shape
coord = feat.getPart()
lon = coord.X
row.coord_x = lon
rows.updateRow(row)
print fc, fn + " calculated to long"
elif fn == "coord_y":
feat = row.shape
coord = feat.getPart()
lat = coord.Y
row.coord_y = lat
rows.updateRow(row)
print fc, fn + " calculated to lat"
FcList = gp.ListFeatureClasses("*","Polygon")
for fc in FcList:
gp.workspace = dataset + "\\" + fc
if fc <> "soil_map_unit_area":
if fc <> "wetland_area":
if fc <> "flood_zone_area":
print fc
rows = gp.UpdateCursor(fc, "", PolyRef)
for row in rows:
allFields = gp.listfields(fc)
print fc
for field in allFields:
fn = field.name
if fn == "area_size":
feat = row.getValue("SHAPE")
cent = feat.area
rows.updateRow(row)
#expression = "!shape.area@acres!"
#gp.CalculateField_management(fc, fn, expression, "PYTHON_9.3")
print fc, fn + " calculated to area"
... View more
03-30-2011
05:31 AM
|
0
|
0
|
4357
|
|
POST
|
You sir are a gentlemen and a scholar. That's exactly what I was looking for. If anyone is interested, here's my updated code for a script tool with a multivalue parameter.
import arcpy
latLonRef = "Coordinate Systems\Geographic Coordinate Systems\World\WGS 1984.prj"
featureClasses = arcpy.GetParameterAsText(0)
featureClassesList = featureClasses.split(";")
for featureClass in featureClassesList:
arcpy.AddMessage("Calculating XY coordinates for: " + featureClass)
arcpy.AddField_management(featureClass, "LAT", "DOUBLE")
arcpy.AddField_management(featureClass, "LON", "DOUBLE")
rows = arcpy.UpdateCursor(featureClass, "", latLonRef)
for row in rows:
feat = row.shape
coord = feat.getPart()
lon = coord.X
lat = coord.Y
row.LAT = lat
row.LON = lon
rows.updateRow(row)
#arcpy.AddMessage(str(lat) + ", " + str(lon)) this is great; how would one modify to calc. area? thanks!
... View more
03-29-2011
01:28 PM
|
0
|
0
|
4357
|
|
POST
|
Hello, I have two IMG rasters 8bit unsigned, 1 band, discrete. When I do "mosaic to new raster" I always get 3 band RGB, even when I select 1 band (no matter if it is TIFF, ESRI GRID, IMG). Is there any other setting so that I can mosaic 1 band rasters into 1 band raster as it worked in previous 9.3.1 version? regards, Jan I have this exact problem when using mosaic to new raster. Any update to this problem? thanks,
... View more
03-01-2011
03:17 AM
|
0
|
0
|
2942
|
|
POST
|
I was able to fix the problem by installing .NET Framework 2.0 SDK and adding the .dlls to the GAC using gacutil.exe /i "C:\Program Files\Microsoft.NET\SDK\v2.0\Bin\gacutil.exe" /i "C:\Program Files\ArcGIS\Desktop10.0\Bin\GpMetadataFunctions.dll" "C:\Program Files\Microsoft.NET\SDK\v2.0\Bin\gacutil.exe" /i "C:\Program Files\ArcGIS\Desktop10.0\Bin\MetadataTranslator.dll" thanks for the info! I have an 'export metadata' python script written using 9.3 module and when running it on a ArcGIS 10.0 box it would always cause python to crash. Installed .NET SDK then added the above 2 .dll's to the GAC and the script works perfectly now...just had to change all the ref's from 9.3 tools/meta translators to the v10 paths and all is well. Sure wish the install dir's were the same with v9.3 and v10; sure makes using old scripts on v10 a hassle. thanks again
... View more
02-17-2011
05:32 AM
|
1
|
0
|
4017
|
|
POST
|
Using ArcGIS 10 SP1 I have this exact same problem with file geodatabases, (disappearing features). This happens on both pre-existing features and also features that were just digitized. I've also added several features and/or attributes, all the while continually saving my edits, only to open the feat. class a day later and everything be gone. I somewhat narrowed this problem to having ONLY arcmap open while editing, and completely closing ArcCatalog. We only use 9.x file gdb's for backwards compatibility with clients who are still using ArcGIS 9. I have a notion this is something to do with it; v9.x gdb's being edited/viewed in ArcGIS v10. Interested to see if other's having these problems are using shapefiles or gdb's; if the latter, what version of gdb?
... View more
12-21-2010
07:12 AM
|
0
|
0
|
2745
|
|
POST
|
after an hour of messing around w/ version number syntax, I found this thread! Was nice to output all layers as .lyr, but not much help when the client who will receive all the .lyr files is still using 9.3... one step forward, two steps back.
... View more
10-07-2010
09:11 AM
|
0
|
0
|
1463
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | a month ago | |
| 2 | 06-19-2026 05:33 AM | |
| 1 | 05-02-2024 04:44 PM | |
| 1 | 11-04-2025 11:45 AM | |
| 1 | 10-31-2025 06:53 AM |
| Online Status |
Offline
|
| Date Last Visited |
2 weeks ago
|