POST
|
Hello, I have a feature class with polylines that represent pipes. Each polyline feature is single-part and generally only has small number of vertices (generally 2 - 5). In some cases I need to update the starting and/or ending node/vertex to a new location, without moving the other vertices. I want to do this in Python either through field calculator or a separate script/tool. I was planning on getting the geometry of the feature, creating an array with vertex points, updating first and/or last point, in the array, and then updating the feature geometry. However, I am having a difficult time figuring out the syntax. If I use a arcpy.da cursor, I can get the feature geometry (I think), but cant seem to pull the geometry properties. Below is quick syntax I used in Python window in ArcMap. Once I get to the row (feature), I thought I would be able to access polyline geometry properties to get the verticies, but keep getting message that data is tuple and is not callable. Any advise would be greatly appreciated! Thanks Neal >>> with arcpy.da.SearchCursor(fc,'SHAPE@') as cursor: ... for row in cursor: ... print(row) ... (<Polyline object at 0x45afe4b0[0x276eb760]>,)
... View more
03-19-2018
07:11 AM
|
0
|
4
|
2553
|
POST
|
Great – thanks for letting me know. If you find out a fix/resolution, please share Thanks! Neal
... View more
08-07-2017
08:30 AM
|
0
|
0
|
526
|
POST
|
Hello, We have created a survey in Survey123 Connect. Everything in the actual Survey123 and Survey123 Connect seems to be working fine. However, when we access the same survey from the Survey123 website and try to view surveys (under 'Data' tab), we are having issues with map extents. The overall map zooms to the extents of the features which is fine. However, when I click on an individual record the smaller map under 'Individual Response' zooms over California. All of our points are in North Carolina. Below is a screenshot. Survey was created using Survey123 Connect 2.3.24 (latest version). Any idea if there is a way to change this behavior if just a bug? Thanks! Neal
... View more
08-07-2017
08:10 AM
|
0
|
4
|
775
|
POST
|
Hello, I am new to Attribute Assistant and having problem using 'Generate_ID_By_Intersect' for seemingly very simple test case as described below. Editing feature class : kmepnt Editing feature class ID that I am trying to populate: UnqID Grid Layer that I am trying to intersect: Basins Grid Layer Field I am trying to use in UnqID: BasinNm GenerateID Table Sequence Name: kmepnt_ID Dynamic Table Value Info Expression: Basins|BasinNm|kmepnt_ID Im simply trying to add a point to 'kmepnt' layer and have it automatically populate the 'UnqID' field with 'BasinNm' and then sequence number. In my case basin name is 3 character string (e.g. "GOO"), so if I add points in GOO watershed they UnqID would be populated with "GOO1", "GOO2", etc. When I add the point, the UnqID does not populate (is null). I made sure that Attribute Assistant is "On". I was able to successfully use the basic 'Generate_ID' with sequences and static string formats, so dont see what I am missing here. All layers and tables are in the same test file geodatabase. Below is screenshot showing layer/table setup Any help would be appreciated Thanks! Neal
... View more
08-06-2017
06:50 AM
|
0
|
0
|
432
|
POST
|
Morning Phil, I really appreciate you looking into my issue and even taking the time to give other recommendations. Hopefully this will be something that is addressed in an upcoming release, since would be really useful. I did look into the choice filter, but didnt quite work since some structure types can have variable materials while others cannot. Ill check out your other recommendations too. Again, many thanks on your help and support! Neal
... View more
07-17-2017
03:44 AM
|
1
|
0
|
2379
|
POST
|
Hi Philip, I think what you are suggesting is what I initially tried. I added a separate row with question type of 'calculate', did the IF expression and then referenced that question in the calculate field of the material question that I am trying to auto-populate. However, when I did that it seems to mess up the other questions in the same group. Ill upload my survey. Its got a bunch of other groups, questions, etc. by just trying to get the Structure1_Material thing to work
... View more
07-16-2017
04:22 PM
|
0
|
2
|
2379
|
POST
|
Hello, I have an annoying issue in Survey123 that seem should be basic. I am trying to populate the default "answer" (value) of one question based on an answer to a previous question. In my case the first question (Q1) is "Structure1_Type", which is a 'select_one' question. The second question (Q2) that I am trying to populate default answer based on answer given to first question is "Structure1_Material", which is also a 'select_one' question. Both questions are in a nested group named "Structure 1". Basically, if user selects the a type="ABC" in Q1, I want default answer for Q2 to be "Metal", otherwise I want it to be "Concrete". The conditional expression I am using is: if(${Structure1_Type}='ABC', 'Metal', 'Concrete') Initially I tried putting that expression into the 'Calculation'. It does not give an error, but most of the questions in the Structure 1 group (i.e. Q1 and Q2 are no longer on the form). If I put the expression in the default field, instead of showing the answer in Q2, it shows a greyed out copy of my expression with a line through it (suggestion expression is invalid). I even tried adding a separate note field named "kmeMaterial" and putting the calculation there first and then referencing it in the default field of Q2. Interestingly, the value populates correctly in "kmeMaterial" but it gives the same greyed out expression with line in Q2 (where I want to actually store the permanent answer). Attached is a screenshot that shows how the last trial looks in Survey123 Connect. As you can see, "kmeMaterial" correctly shows an answer of 'Metal', however, the "Structure 1: Material" (i.e. Q2) has the issue. I want to use similar logic in multiple places in my form, so this issue is hampering thing quite a bit. Any help/suggestions would be greatly appreciated! Thanks Neal
... View more
07-16-2017
06:10 AM
|
0
|
7
|
5416
|
POST
|
That makes sense now - thank you for the prompt and insightful replies!
... View more
06-26-2017
06:19 PM
|
0
|
0
|
1992
|
POST
|
Yes! I had overlooked the format part, but now see is same idea. Still not totally clear what the value/benefit of doing things this way are, but this helps understand. Many thanks!
... View more
06-26-2017
04:00 PM
|
0
|
3
|
1992
|
POST
|
Ok - thank you Rebecca and Dan for explanation - that helps with use of curly brackets when coupled with formatting. But looks like it may also have another use (where not coupled with formatting) in the example. Below is an excerpt from same 'AddFeatureClasstoTerrain' tool where curly brackets may have another meaning/use? This tool accepts multi-variable parameter (i.e. more than one feature class can be added to terrain). Maybe it is just a row index or something, but not clear why it is used or if it is necessary. Any additional thoughts would be greatly appreciated inFeatures = "{0} Shape softclip 1 0 10 true false boundary_embed <None> "\ "false; {1} Shape masspoints 1 0 50 true false points_embed "\ "<None> false; {2} Shape softline 1 0 25 false false lines_embed "\ "<None> false".format(boundary, masspoints, breaklines) Thanks again! Neal
... View more
06-26-2017
03:41 PM
|
0
|
5
|
1992
|
POST
|
Hello - in a number of P Stand Alone Python examples associated with a number of geoprocessing tools (e.g. Add Feature Class to Terrain), there is some syntax that uses curly brackets that I dont understand and dont see documentation. In general Python I understand curly brackets are used to define "dictionaries", however use in geoprocessing tools with ArcPy seems different. Can anyone explain their use or point me to documentation? Below is example from a tool example that uses curly brackets Thanks Neal Add Feature Class To Terrain (3D Analyst) # Create the file gdb that will store the feature dataset
arcpy.management.CreateFileGDB(gdbLocation, gdbName)
gdb = '{0}/{1}'.format(gdbLocation, gdbName)
# Obtain spatial reference from TIN
SR = arcpy.Describe(tin).spatialReference
# Create the feature dataset that will store the terrain
arcpy.management.CreateFeatureDataset(gdb, fdName, SR)
fd = '{0}/{1}'.format(gdb, fdName)
(...)
... View more
06-26-2017
01:45 PM
|
0
|
10
|
3539
|
POST
|
I have been having increasing issues model builder that utilizes model parameters as inputs and feature layers in an existing ArcMap table of contents. I models run successfully for a while, but then if I change the underlying input layers at all (even if if has no impact on the model process), it acts flaky. For example, I have a simple model that simply calculates three fields in an existing feature class that I have loaded in ArcMap. The input feature layer is exposed as parameter, but I have a default value set. It worked fine may times, but now when I run it, I get a message that there are no records in the table (even though there are). To make it work now, instead of using default or picking from list of ArcMap TOC items, I have to point the input to the feature class by loading the feature class directly in the tool interface (i.e. hitting the little folder icon and navigating to the where feature class is stored). If I do that it works fine. he attached images show the simple model, model interface, and message I am getting. This is happening in other cases where I have more complex models that have input as parameters, and that have pick lists of fields based on the selected feature class. Im finding if I add fields to a certain layer and then run the model and pick the feature class, it does see the new fields. It seems like something about the models is storing memory of previous runs related to feature layers loaded in the ArcMap document. I have tried closing out ArcMap sessions, cleaning temporary file locations, using MXD doctor, and similar. Any input on what may be happening would be greatly appreciated! Thanks Neal
... View more
10-12-2016
05:02 AM
|
1
|
6
|
3711
|
POST
|
I am creating a TIN of flood elevations from a polyline feature class that has elevations along a stream network (i.e. cross sections) and and stream corridor polygon feature class to clip the TIN (i.e. clip polygon). I am using cross sections as "hard lines" and clip polygon as "hard clip". I have done this for projects many times. Most of the time, the resulting TIN is what I am expecting, but occasionally it has these mysterious gaps that I cannot figure out why they happen. The attached graphic show an example. Does anyone know what may be causing this? Ive already check that the cross sections all have elevations are single part features, and that boundary is single part features. A couple interesting observations: - When I create small TINS of just those areas the resulting TIN is fine (no gap) - If I create the TIN with just the cross sections, and then use edit TIN to add the clip polygon, that usually solves all or most of the gaps - no idea why these would give different results Thanks for any insight! Neal
... View more
09-26-2016
11:38 AM
|
0
|
0
|
1108
|
POST
|
I have a model processes some raster datasets. It runs fine if I run it within the ModelBuilder environment, but I get syntax errors if I run it directly from a toolbox. The model has several raster calculator processes with somewhat complex map algebra statements with inline variable substitution. Seems like some python interpretor issue in raster calculator that is handled differently between ModelBuilding and direct toolbox Attached are the model and the error. In the error screenshot, you can see the expression Im trying to use. Any insight or suggestions would be greatly appreciated! Thanks Neal
... View more
09-23-2016
05:02 AM
|
0
|
1
|
1418
|
Title | Kudos | Posted |
---|---|---|
3 | 09-10-2022 07:03 AM | |
1 | 07-29-2019 05:38 PM | |
1 | 07-29-2019 06:23 PM | |
1 | 06-15-2020 11:58 AM | |
1 | 09-12-2022 04:05 AM |
Online Status |
Offline
|
Date Last Visited |
02-13-2024
11:20 AM
|