|
POST
|
Hi I have radar tracks of flightpaths as shapefiles (exported from a CAD-application) and I need to select only the part below a certain height. Anyone out there having some tips or tricks how to do this? Rgds, Thomas Hi, Start creating a TIN (Create TIN (3D Analyst)). Use a polygon of the study area, and use the fixed value ("certain height") to create the surface. Use the Intersect 3D Line With Surface (3D Analyst) tool to intersect the flight paths. The result will be the segmented flight paths optionally the points of where the flight path is cut. The output will have two columns SURF_FROM and SURF_TO which will have the same value for all the features except the first and last feature. In case you use more surfaces this will have more meaning. You can however use the calculate geometry to calculate the Z coordinate of the midpoint of the line segment and select those parts of the line where this value is below the "certain height". Kind regards, Xander
... View more
11-05-2013
11:12 PM
|
0
|
0
|
1165
|
|
POST
|
My goal is to create a 3D map showing underground pipes at a location. I have the LiDAR data, aerial photo, and underground pipes (with their depths). I have generated a 3D surface and draped an aerial photo on top of it. The next step is to generate an underground map showing the pipes under this surface. I have a small polyline feature class, named PIPES, with a depth field. It is a small feature class with 12 features. My question is can 3D Analyst be used to show underground pipes? any thoughts on this? Hi Timothy, Yes you can visualize the pipes in 3D under the surface. Load the data into ArcScene or ArcGlobe. In the layer properties of the pipes, activate the "Base Heights" tab and either use the elevation from features (in case of PolylineZ) or use a constant value or expression: (if your data contains depth, then multiply it by -1) [ATTACH=CONFIG]28890[/ATTACH] To give the lines a 3D aspect, you can use a 3D Simple Line Symbol: [ATTACH=CONFIG]28891[/ATTACH] Use the navigation buttons to "look" underneath the surface: [ATTACH=CONFIG]28892[/ATTACH] For more ideas on 3D cartography have a look at this video: http://video.esri.com/watch/2626/3d-cartography If you are more interested in analyzing the tubes underneath the surface you could use: Intersect 3D Line With Surface (3D Analyst) Kind regards, Xander
... View more
11-05-2013
10:40 PM
|
0
|
0
|
2465
|
|
POST
|
Hello, apologies if this has been discussed before, but I wasn't sure how to find what I needed with searches... First, the stats: -Novice user (little to no python experience, but been using basic functions of ArcGIS for several years) -ArcMap 10.0 or 10.1 Okay, I have a couple shapefiles, one that is a uniform grid (with row/col's), and another shapefile that has farm fields and the crop being grown on that field. I want to be able to figure out which crop type is the "dominate" crop for each of the grid cells. The crop fields vary is size, shape, etc... and many times overlap into other grid cells. There are hundreds of grid cells. Here's a quick image (hope it comes through). You can see the colored crop polygons with the uniform grid on top. [ATTACH=CONFIG]28870[/ATTACH] I did a Union of the two shapefiles (above image), I'm just not sure how to go to the next step(s) and calculate the dominate field "type" for each grid cell. Any help would be appreciated. Thanks! Hi Justin, A Union is indeed the first step. What I understand from your image is that several parcels with the same crop may occur within a single grid. In this case it is not a matter of simply determining the largest crop polygon within grid polygon. You will have to sum up the area of the same crop within each grid polygon. To do this you can follow these steps: Add a new TEXT column Fill this column with the ID of the grid polygons and the Crop (description or ID) like this: [gridID] & "#" & [crop] (this creates a unique text for each crop and grid combination. the "#" should be a characters that is not used in either columns. Add an area column to you table if you don't have one yet (in case of shapefiles) Next you summarize your data based on this new column, in which you want to determine the SUM of the area column This table should be joined back to your Union data (based on the combined column you created). Use a select statement to select those records where the joined SUM area equals the individual area. Those records hold the predominant crop. This type of analysis could be carried out in raster format as well (requires Spatial Analyst) using the Zonal Statistics (using MAJORITY as statistics type). The outcome is less accurate (depending on the cell size you use). The other alternative would be using Python. You can loop through the union data and build a dictionary holding the grid#crop as key and the (summed) area as value. In the second loop you determine the largest area for each grid polygon which could be joined back using a cursor to the original grid polygons. Kind regards, Xander
... View more
11-05-2013
09:24 PM
|
0
|
0
|
599
|
|
POST
|
Basically my code is the same as yours except that I used cursor = arcpy.da.UpdateCursor(fc, fields) instead of with arcpy.da.UpdateCursor(fc, fields) as cursor: Would that make a difference? Hi Adam, In the Help is states: Using a with statement will guarantee close and release of database locks and reset iteration. It is better using the with statement when working with data access cursors. It is also not necessary to delete the cursor afterwards. Also, I should point out that the field I am working with is a CVD. Could you explain to me what you mean with "CVD"? Xander
... View more
11-05-2013
06:30 AM
|
0
|
0
|
1781
|
|
POST
|
Hi Yvo, If you think the answer was helpful you can use the "arrow" button in order to help other members find useful information: More info here: http://resources.arcgis.com/en/help/forums-mvp/ Kind regards, Xander
... View more
11-05-2013
03:06 AM
|
0
|
0
|
1982
|
|
POST
|
We haven't tried 10.2 yet - can anyone verify this is still a problem? I presume from the (lack of) status update that it is. Hi Malcolm, Using 10.2 the problem seems to be solved: fc = 'name of fc in TOC'
cur = arcpy.da.SearchCursor(fc,["GlobalID"])
row = cur.next()
print row[0] returns: {24CBF943-A07F-463E-AFFA-EB1AD760E29E} Kind regards, Xander
... View more
11-05-2013
03:02 AM
|
0
|
0
|
2254
|
|
POST
|
Hi Yvo, Try this: import arcpy targetLayer = r'C:\Project\_Forums\multipart\test.gdb\myPolylineZ_multipart' shapeFieldName = 'SHAPE' cursor = arcpy.UpdateCursor(targetLayer) for row in cursor: geom = row.getValue(shapeFieldName) geomArr = arcpy.Array() for part in geom: partArr = arcpy.Array() for pnt in part: if pnt != None: pntOut = arcpy.Point(pnt.X, pnt.Y, 9999) partArr.add(pntOut) geomArr.add(partArr) polyline = arcpy.Polyline(geomArr) row.setValue(shapeFieldName, polyline) cursor.updateRow(row) del row del cursor Kind regards, Xander
... View more
11-05-2013
02:35 AM
|
0
|
0
|
1982
|
|
POST
|
Hi all, Hope you can help me. i'm doing the online course intro to spatial analyst in ArcMap 10.1. I have the spatial analyst toolbox installed and active trough the customize windows. However, when I try to use a command in the python window, e.g. slope, the command is not recognized and I receive an error message. So probably I should load or activate something. however, this is not explained in the intro excercise so I'm rather stuck and could not find anything in the help files. probably a silly easy question but i hope something is willing to help me out Hi Willem, In order to use the "Slope" command you can either write: arcpy.sa.Slope(in_raster, {output_measurement}, {z_factor}) # using the Slope function from Spatial Analyst or: arcpy.Slope_3d(in_raster, out_raster, {output_measurement}, {z_factor}) # using the Slope function from 3D Analyst ...or import the sa (Spatial Analyst) module and call the Slope function directly: from arcpy.sa import * Slope(in_raster, {output_measurement}, {z_factor}) Kind regards, Xander
... View more
11-05-2013
02:11 AM
|
0
|
0
|
509
|
|
POST
|
Dear list I try to set the Z values of all vertex of individual lines by a fixed value / attribute. All vertex of a single geometry are getting the same value. Somehow I tried to set the values through the geometry object I retrieve from the cursor. But the values are not written back to the geodatabase.
updateRows = arcpy.UpdateCursor(targetLayer)
for updateRow in updateRows:
shapeObj = updateRow.getValue(shapeFieldName)
# Multipart geometries.
for partObj in shapeObj:
for pointObj in partObj:
# Only valid points.
if (pointObj != None):
# Setting the values of the z cooridnates to a fixed value.
pointObj.Z = 9999
updateRow.setValue(shapeFieldName, shapeObj)
updateRows.updateRow(updateRow) I don't understand why the changed geometries are not written to the database. What would be the correct way to do it? I am looking forward to any hint and ideas. Best regards, Yvo Hi Yvo, The 3D Analyst extension comes with a tool to convert features to 3D by attribute: "Feature To 3D By Attribute (3D Analyst)". If the featureclass you are updating isn't "Z-aware" you will not be able to write the Z-values to a feature. The alternative is to create a new featureclass through "Create Feature Class (Data Management)" and set the has_z to "ENABLED" and write your feature to the new feature class. Use a search cursor on your input features and an insert cursor on your output features. Kind regards, Xander
... View more
11-04-2013
11:20 PM
|
0
|
0
|
1982
|
|
POST
|
Hi Adam, Not sure why the update cursor doesn't change the values, but the 2nd sample you provide is not making use of the arcpy.da.UpdateCursor. Furthermore the update statement should be "cursor.updateRow(row)": fields = ["HorizontalAlignment", "VerticalAlignment", "HorzAlign2", "VertAlign2"]
with arcpy.da.UpdateCursor(fc, fields) as cursor:
for row in cursor:
row[0]= row[2]
row[1] = row[3]
cursor.updateRow(row)
del row Kind regards, Xander
... View more
11-04-2013
11:10 PM
|
0
|
0
|
1781
|
|
POST
|
Xander, Thanks for the help! I have 10 years worth of data. Also, after reading the OLS link you provided, I noticed it said that it is not recommended for predicting binary outcomes. My dependent variable is just that: presence (1) or absence (0) of a species. Should I continue to use OLS? What is the best tool in ArcGIS for predicting binary outcomes? Thanks a million! Hi Robert, Do you think there is a relationship between the occurence of a specie and the other data your have (I believe you had rainfall and temperature?). What happens if you plot the rainfall vs the temperature for all polygons where species occur and you also plot this for those polygons where the species don't occur. Do you see any relationship? Can you convert the binary data of the occurrences into richer data (count)? I came across this presentation on Models for binary data: Logit and Probit by Kenneth Benoit, but I don't know if it's useful. Kind regards, Xander
... View more
11-04-2013
10:09 PM
|
0
|
0
|
533
|
|
POST
|
Hi Teresa, I looked at your data and noticed that the TIFF is stored in WGS geographic coordinates, while the point source is projected. If you first project the TIFF to the same projected coordinate system as the source, then reclassify the raster and calculate the cost distance it will be centered in the middle. [ATTACH=CONFIG]28865[/ATTACH] The black circle is at a 10km distance of the source. Please note that if you specify the optional "Maximum distance", it refers to the cost and is not a 10km Euclidean distance from the source... Kind regards, Xander
... View more
11-04-2013
09:51 PM
|
0
|
0
|
1660
|
|
POST
|
Hi Kate, If it's possible to do this when exporting your data to XYZ, it might be the easiest way. If not you could write some Python code to apply "Euler�??Rodrigues formula". There is a nice example on Stack Overflow based on numpy (which come with the ArcGIS Python installation), see post on Stack Overflow: "Python - Rotation of 3D vector" import numpy as np
def rotation_matrix(axis,theta):
axis = axis/np.sqrt(np.dot(axis,axis))
a = np.cos(theta/2)
b,c,d = -axis*np.sin(theta/2)
return np.array([[a*a+b*b-c*c-d*d, 2*(b*c-a*d), 2*(b*d+a*c)],
[2*(b*c+a*d), a*a+c*c-b*b-d*d, 2*(c*d-a*b)],
[2*(b*d-a*c), 2*(c*d+a*b), a*a+d*d-b*b-c*c]])
v = np.array([3,5,0])
axis = np.array([4,4,1])
theta = 1.2
print(np.dot(rotation_matrix(axis,theta),v))
# [ 2.74911638 4.77180932 1.91629719]
The hardest part will probably be defining the axis and theta of the rotation... Once you have those it's a matter of looping through the data and write the rotated data to a new dataset. Another option may be using MATLAB... Kind regards, Xander
... View more
11-04-2013
05:39 AM
|
0
|
0
|
729
|
|
POST
|
Hi Elanor, For this size of data it's better to use LAS files. In order to be able to use LAS files in ArcGIS your text files should be translated to LAS. This can be done using the LAStools tool called "txt2las.exe". Many parts of LAStools are now available under LGPL license. The command that translates your input text file to a output las file would be: txt2las -i input.txt -parse xyz skip 1 -o output.las -set_version 1.2 The skip 1 refers to skipping the first line for being a header. If your text file doesn't have a header just omit the "skip 1" in the command. (txt2las readme file) After creating the LAS file(s), you can "Create a LAS dataset (Data Management)". Once you have a LAS dataset you can use "LAS Dataset To Raster (Conversion)" to convert your XYZ points to raster. Some more reading: Creating raster DEMs and DSMs from large lidar point collections More on LAStools: http://rapidlasso.com/ Kind regards, Xander
... View more
11-04-2013
03:35 AM
|
0
|
0
|
1511
|
|
POST
|
Hello, I work on a place name entity class with a table containing a field "ABBREVIATION" and another field "FULL_NAME". example The "ABBREVIATION" contains 'Ch.' The fields "FULL_NAME" contains 'Church ' I will receive regular updates. In what way (python script), I know if new entries appear on my table update! Look at the diagram attached. Thanks Hi Pierre, I guess the "Table Compare (Data Management)" could be an option for you. The link contains some Python snippets. Maybe it's better to use some python code to do this. Jason Scheirer and Chris Snyder posted some nice examples a few days ago in this thread. If you combine their suggestions you end up with: import arcpy
set_one = set(r[0] for r in arcpy.da.SearchCursor("Table1", "ABBREVIATION"))
set_two = set(r[0] for r in arcpy.da.SearchCursor("Table2", "ABBREVIATION"))
print "Set2 difference set1: {0}".format(set_two.difference(set_one))
This will print out: Set2 difference set1: set([u'Mon.', u'Foot.']) This set contains a list of the items in the second table which are not in the first table. What you need to know too, is that it will only check for the abbreviation and not the "full name". If the full name of an abbreviation has changed this code will not find it. To do that you will need to use dictionaries (which a collections of key, value pairs). Then loop through these and check both the abbreviation and full name. Kind regards, Xander
... View more
11-03-2013
10:06 PM
|
0
|
0
|
473
|
| Title | Kudos | Posted |
|---|---|---|
| 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 | |
| 1 | 05-29-2019 02:45 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-26-2025
02:43 PM
|