|
POST
|
Hello I have a simple question that is hard to explain. I have drawn a little picture to help explain. [ATTACH=CONFIG]26206[/ATTACH] https://www.dropbox.com/s/t0ncq91l6wgl3ja/IMG_20130725_104657.jpg Basically I have table 1 and I want to get to table 2 based on the values in an attribute field. I know that there is a maximum of 12 unique values for any one D value. This means at max I would have 12 new fields (which can be named 1 - 12). I have 1000's of D values in total. Any advice on where to start, would be helpful. I have tried an intersect and join but found they only returned one value for each D. Thanks This is what the pivot table does, although you would need an Advanced license to use that tool. For the unique value field if you are sure it has no duplicates you can use it as both the pivot field and the value field. The result would be that every record with 6 in the unique field would be in the UNIQUE_6 column and have a value of 6 or null. However, all columns numbered UNIQUE_1 through UNIQUE5 and UNIQUE_7 thru UNIQUE_12 wouldl have null values if 6 was the only value associated with the D value. If you wanted the value of 6 to be in the second column when there are only two values for a given D value, then you need to Sort the table and create a new numeric field to calculate a unique number indicating the column position of each value. This requires Sort/Summary, add numeric column, calculate it to equal ObjectID, Summarize on D value and get the min of the new column, Join, calculate the new column to equal: Sort_table.New_Column - Join_Table.Min_New_Column + 1 that will result in each value being in order with all null column being in positions after the filled in columns.
... View more
07-25-2013
07:56 AM
|
0
|
0
|
1462
|
|
POST
|
Is is possible to create and apply a definition query in ModelBuilder? The model would be the same as in the attached screenshot except that the tool would be "Definition Query" not "Select Layer By Attribute". [ATTACH=CONFIG]26204[/ATTACH] I feel like this should be easy to do. Any help is appreciated. Thanks. pbh Use the Make Feature Layer tool with the query option specified. That is the definition query of the layer as far as I know. A layer without a query can feed a layer with one, but not the other way around as far as I know.
... View more
07-25-2013
07:00 AM
|
0
|
0
|
2208
|
|
POST
|
Does the shape file have a spatial reference projection? If that is corrupt or missing you won't be able to calculate geometry outputs. Does it have a Geographic (angular units like long/lat degrees) or Projected (linear coordinate units like meters or kilometers) spatial reference? Let us know whether or not the normal field calculator is disabled as well. If it is disabled then there is a lock of some kind on the file. Could anyone else have the file open or could you have two copies of it open in separate maps? Also have you started an edit session or not? If you started an edit session on a different workspace that might affect the geometry calcuator (although I don't recall that situation preventing it from working). You are using a shapefile and not an SDE database I am assuming.
... View more
07-24-2013
12:52 PM
|
0
|
0
|
1563
|
|
POST
|
Dear all, In the attribute table of a dbf file I added a field "Area" and wanted to calculate the area value of the features with function "Calculate Geometry". But this function is grey and does not work. What could be the reason for that and what do I have to change? Thanks in advance and kind regards, Matthias Area is a reserved word and field name for geodatabases. It is therefore rendered as a non-editable field. You may not even be able to removed that field by deleting it now either. So add a field like AREA_SQFT and that will work. See this post and specifically this help.
... View more
07-24-2013
11:59 AM
|
0
|
0
|
1563
|
|
POST
|
If I understood correctly, how would including a text file with a path be different than simply hard coding paths in the logic script? The issue at hand is to read files outside the folder where addin is placed. So it would be something like this: say addin is in following folder: 'C:/proj/addin/addin.esriaddin' and I want addin to recognise files in: 'C:/proj/data/raster1' or 'raster2.....' In above instance, data and addin are placed in C drive but I want addin to be configured in a way so that it can read data even if it is placed in D or E or F drive without the need to hard code the root directory path in logic script. This way, user can simply place updated addin in the designated folder irrespective of what drive it is residing in. Please let me know if my answer isn't clear. What you are describing makes no sense. You have to program a path somewhere that is hard coded for at least the root if you are not allowed to deduce the path from the add-in location. Think about it. Lets say I want to make phone call to someone in my own area code. I don't have to tell anyone what the area code is because we can all deduce it from my location. Now lets say I want to dial the same number and not give the area code, but I want the phone to connect with someone in a different area code altogether. How do you expect the phone company to program their phone system to do that? Randomly try every area code for me until the call goes through where I wanted? They could try that approach, but I won't be providing any confirmation that they have connected me to the correct party. If more than one connection is possible, how will they know they got the right one if I won't give them any feedback? Do I have a right to expect my phone call to go through under these conditions? What could do this other than a magical mind reading app? If I could successfully develop that kind of app I would already have a Nobel prize. This is how you have described your program requirements so far. Describe any information I actually was expected to provide to the phone company or the kinds of feedback loops and confirmations I was suppose to give them in the scenario above that would make my phone call possible. Fianlly, you do realize that if you are wanting the user to access data on a network drive that you should not use a drive letter at all for the path ever. Drive letters are dependent on the local computer. What you must specify is the domain URL to the network server (which is what the drive letter actually points to). The path: r'//myserver/files/data/...' will go through on any computer in my network with access permissions to myserver in my domain. A domain name server can be used to abstract the path further, making the path independent of an actual specific server, so that the domain administrator can transfer data and repoint all users to a new server keeping the same path for his end users without touching any local machines.
... View more
07-20-2013
06:35 AM
|
0
|
0
|
1734
|
|
POST
|
Help me realize Arctoolbox's tool Split Line At Vertices (Data Management) with VBA. How can I do this in VBA? Unless you have an outdated version of ArcGIS and plan on staying with that version for a really long time, VBA should be considered dead as a language used to develop tools for ArcGIS. It is nearly impossible to find the old help that applied to VBA for initializing the geoprocessor object and running a tool and I have largely forgotten how to do it since using that approach is that out of date. So unless you provide a compelling reason for why you cannot convert to something else, bite the bullet, stop VBA development, and start migrating your code. Python or .Net should be the approach you look into. Python is easiest if you are just doing geoprocessing, since the tool can be run with arcpy at 10.0 or later or with the geoprocessor object for several earlier versions and the Python forum is filled with examples of how to use geoprocessor tools. Normally you just import arcpy and use the tool syntax description given in the help for the tool preceded with arcpy.*. Using .Net is recommended if you are using advanced GUI forms or need to develop a program that has full ArcObjects control of Desktop or other GIS applications. Here is the help for using the geoprocessor to run a tool in .Net. The VB.Net help would come the closest to what you would do using VBA, but syntax differences would have to be backward converted, which if you are going to convert syntax, go the other way to move to .Net.
... View more
07-19-2013
11:07 AM
|
0
|
0
|
685
|
|
POST
|
Hello, I have a table with Expiration Dates. I want to use the select by attributes to tell me what dates are between now and exactly one year. Thanks in advance for any help. Mark I am going to assume you are using a File geodatabase, since I am most familiar with that database and you did not say what database you actually are using. All SQL help is dependent on the database you are working with, so until you provide that information you really can't get help that deals with your specific needs. This expression will select all records based on the current date and within the last year when time of day is not a factor (accounting for leap year): (EXTRACT(MONTH FROM CURRENT_DATE) = EXTRACT(MONTH FROM CURRENT_DATE - 365) AND EXTRACT(DAY FROM CURRENT_DATE) = EXTRACT(DAY FROM CURRENT_DATE - 365) AND "CREATED" <= CURRENT_DATE AND "CREATED" > CURRENT_DATE - 365) OR (EXTRACT(MONTH FROM CURRENT_DATE) = EXTRACT(MONTH FROM CURRENT_DATE - 366) AND EXTRACT(DAY FROM CURRENT_DATE) = EXTRACT(DAY FROM CURRENT_DATE - 366) AND "CREATED" <= CURRENT_DATE AND "CREATED" > CURRENT_DATE - 366) OR (EXTRACT(MONTH FROM CURRENT_DATE) = 2 AND EXTRACT(DAY FROM CURRENT_DATE) = 29 AND "CREATED" <= CURRENT_DATE AND "CREATED" > CURRENT_DATE - 366) This expression will select all records based on the current date and time stamp to immediately after the exact same time on the same date 1 year ago (accounting for leap year): (EXTRACT(MONTH FROM CURRENT_TIMESTAMP) = EXTRACT(MONTH FROM CURRENT_TIMESTAMP - 365) AND EXTRACT(DAY FROM CURRENT_TIMESTAMP) = EXTRACT(DAY FROM CURRENT_TIMESTAMP - 365) AND "CREATED" <= CURRENT_TIMESTAMP AND "CREATED" > CURRENT_TIMESTAMP - 365) OR (EXTRACT(MONTH FROM CURRENT_TIMESTAMP) = EXTRACT(MONTH FROM CURRENT_TIMESTAMP - 366) AND EXTRACT(DAY FROM CURRENT_TIMESTAMP) = EXTRACT(DAY FROM CURRENT_TIMESTAMP - 366) AND "CREATED" <= CURRENT_TIMESTAMP AND "CREATED" > CURRENT_TIMESTAMP - 366) OR (EXTRACT(MONTH FROM CURRENT_TIMESTAMP) = 2 AND EXTRACT(DAY FROM CURRENT_TIMESTAMP) = 29 AND "CREATED" <= CURRENT_TIMESTAMP AND "CREATED" > CURRENT_TIMESTAMP - 366) I am using matching date logic for leap years rather than end of the month logic so that 2/28/2013 looks back to 2/28/2012. I have not worked out how to get end of the month logic to work so that you go from 2/28/2013 back to 2/29/2012. Speaking to the programmer for the file geodatabase at the ESRI UC this year I found out that file geodatabase SQL complies with all by a few SQL 92 specifications, so you can look up help on the internet for the SQL 92 syntax and normally apply it to the file geodatabase. That is how I found out that CURRENT_TIMESTAMP works with a file geodatabase.
... View more
07-17-2013
09:04 AM
|
0
|
0
|
1094
|
|
POST
|
Is there a way to have a feature's symbol change based on the scale of the map? For example, at 1:250,000 I would prefer for my sewer main layer to be symbolized on main-type only, but when the user adjusts the scale to say 1:10,000, it would be great if the direction of flow would be added to the symbol (but not before). The only work around I have found to adjusting symbol detail is to add the layer in more than one time and adjust the symbol with scale ranges. This gets the job done, but is a bit messy in the TOC. Can Symbol Level drawing be used to control this? Unlike Label classes, the symbology dialog does not provide any way to define several standard layer symbology classes within a single layer that are scale dependent. I believe that Representations can have rules set up to do behaviors that may resemble the behavior you want, but I have not used representations enough to be absolutely certain. Representations have to be built with a particular target scale in mind, so they do not have the same level of flexibility that standard symbols have. I have always created multiple copies of the same layer to make different scale dependent standard symbol sets and typically included them all in the same group layer to simplify their TOC presentation.
... View more
07-17-2013
08:31 AM
|
0
|
0
|
2598
|
|
POST
|
I just started working with models so I don't have much experience. I'm trying to take a database with multiple line feature classes and merge them into one final feature class. I made this model but it isn't working. I'm ending up with a new feature class with only 1 line in it instead of about 6 lines. [ATTACH=CONFIG]25978[/ATTACH] With the merge tool you don't use an iterator. You just include all 5 feature classes as inputs to the tool assuming they are all the same geometry type and run it. Every feature from those 5 inputs will be combined into a single output feature classes.
... View more
07-16-2013
02:29 PM
|
0
|
0
|
1129
|
|
POST
|
I need to end up with a series of line segments that are equal to the original line feature. I was looking to split the line at the midpoint between every two vertices(vertices every 0.1 feet) If that isn't possible I was wondering if I could split the line every 0.05 feet. I would then merge every 2 segments into 1 segment to get the result I need. Split the line at every vertex then apply the method I specified to get the midpoints of each of these split segments exactly midway between the original vertices. Extract those points as I described previously. Then you can split the original line on those points and except for the end vertices of the line (or any 2 point line) a single vertex of the original line will now be somewhere in the center of these newly split lines. That seems to be what you are describing as the result of the splitting and merging that you want. The ends of the line will be connected to split line segments that are 1/2 the distance to the original vertex that was closest to them. So if the original line looked like this (where red periods are line ends and black periods are pseudo-node vertices). .______.____.______.____. The end result of the process would look like this (assume all periods have no actual width so the set of 5 lines below are in fact the exact same total length as the single line above): .___.___.__.__.___.___.__.__. If this is not the result you want, use the above method of displaying lines and vertices to depict how the first line shown should look at the end of the process you really want to accomplish on that line.
... View more
07-16-2013
09:24 AM
|
0
|
0
|
2143
|
|
POST
|
I am wanting to be able to, in an automated fashion through a Model or other means, rename a field in an attribute table once the dataset is created. I have read in earlier versions of ArcMap, the only way to "rename" a field would be to add the new field, copy over the data, and delete the old field, and this functionality was added to 10.x whereby you can manually rename a field using ArcCatalog. However, I'm wanting to rename a field within a Model. There's an older article at http://ideas.arcgis.com/apex/ideaView?id=0873000000087wgAAA which indicates this functionality at one time did not exist, but now that you can do it manually, did Esri implement the ability to do it using some tool or other means? This is the only help I see on the subject and it only applies to manually renaming a field through ArcCatalog properties.
... View more
07-16-2013
08:12 AM
|
0
|
0
|
6139
|
|
POST
|
The lines that built expression and expression2 were messed up (missing escape character to make single quote around your address and street literal) and expression3 badly written. They are corrected below. import arcpy
import os
import re
basedir = r"C:\Test"
fc = r"G:\GIS\ParcelsPublic.shp"
field1 = "ADD1"
field2 = "STREETNAME"
try:
for fn in os.listdir(basedir):
add = re.sub(r"\D"," ", fn)
add = str.lstrip(add)
add = str.upper(add)
street = re.sub(r"[^a-zA-Z]"," ",fn)
street = str.lstrip(street)
street = str.upper(street)
print (add + " " + street)
expression = '"' + field1 + '" = ' + add
expression2 = '"' + field2 + '" LIKE \'%' + street + '%\''
expression3 = expression + " AND " + expression2
rows = arcpy.SearchCursor(fc, fields="STREETNAME; ARN; ADD1", where_clause=expression3) I assumed ADD1 is a numeric field? If it is a string field rewrite the line that builds expression as: expression = '"' + field1 + '" = \'' + add + '\'' And if you want the LIKE syntax applied to the address string use: expression = '"' + field1 + '" = \'' + add + '%\''
... View more
07-16-2013
07:56 AM
|
0
|
0
|
7730
|
|
POST
|
I'm looking for a way to split a line at the midpoint between two vertices. Or if I have a series of line segments, is there anyway to go down the line and merge every 2 segments together? I have a series of slope measurements on a road. Just splitting the segment at each vertex does not accurately reflect the data which was collected at each vertex. The vertex needs to be the midpoint of each line segment. It can be a script or a program, etc as long as it does the job. Thanks. Create two double fields called X_LINE_MID and Y_LINE_MID on the lines. Use the Geometry calculator to calculate the X and Y MIdpoint values of the lines into those fields. Open the tableview of the lines and export that to a table (not a feature class). Use the Make X/Y Event Layer tool to create points from the Midpoint X and Y coordinates of the exported table. Export the layer its context menu in the table of contents to permanently covert the event table layer into an actual point Feature Class. That should be what you want and each point will have all of the attributes of the lines they came from.
... View more
07-16-2013
07:15 AM
|
0
|
0
|
2143
|
|
POST
|
Hi, I was hoping that someone might be able to help me with a problem I'm having. I'm using ArcGIS10.1 for Desktop with an ArcView license. I have two point shapefile datasets (I've called them 'long' and 'short') of ship positions for the month. Each shapefile has the same fields but different amount of data. The fields are more complete in the long shapefile but this only has positional data for every 15 minutes. The short shapefile has positional information every 3 minutes but with fewer of the fields complete. I want to use the short shapefile as there are more points over time but I have found out that there is some missing data points in the short shapefile (database issues which I have no control over!) which are in the long shapefile. My first thought was merging the data but this also incorporated points occupying the same spatial and temporal area (identical ships). I also tried selecting by location but this threw up problems with two points occupying the same spatial location on different days (I need to keep this information). So, my question is; is it possible to select by location and attribute at the same time and for two shapefiles? I was thinking something along the lines of select when two points are within the same source layer feature and the shipnames are identical and the timstamps are identical. Any help would be greatly appreciated. Kind regards, Richard Use Spatial Join with an appropriate tolerance and then correct the result by selecting for matching attributes that are joined together. The more dense point set should be the target and the less dense points set should be the Join. Use the One to Many option to create all match up points and then filter where the attribute matches make sense. Now you can do an attribute selection that also takes account of the spatial relationship of the points. After selecting the matches on attributes, export that set so that you hopefully have a one-to-one match back to the dense point set. Do a standard join of the original dense point set with this spatial join matched and exported dense point set to transfer attributes picked up from the low density points that have correct attributes using the field calculator and then break the join. That should be all you need to do.
... View more
07-16-2013
07:07 AM
|
0
|
0
|
3106
|
|
POST
|
My formula used the outdated 9.2 format, which does not work at 9.3 or later in the regular field calculator. To update the calculation for python script and the field calculator the XY concatenation calculation to a point feature class should be: # Process: Calculate X_Y_Link Field (2)... arcpy.CalculateField_management(Output_Feature_Class, "X_Y_LINK", "Output(!SHAPE.CENTROID!)", "PYTHON_9.3", "def Output(FirstPoint):\\n FPX = round(float(FirstPoint.X), 8)\\n FPY = round(float(FirstPoint.Y), 8)\\n return \"{%(FX)013.8f}{%(FY)013.8f}\" % {'FX': FPX, 'FY': FPY}") In the normal 9.3 and later field calculator you would output to a 30 characer field with the calculation entered as shown below: Parser: Python Show Codeblock: Checked Pre-Logic Codeblock: def Output(FirstPoint):
FPX = round(float(FirstPoint.X), 8)
FPY = round(float(FirstPoint.Y), 8)
return "{%(FX)013.8f}{%(FY)013.8f}" % {'FX': FPX, 'FY': FPY} Expression: Output(!SHAPE.CENTROID!)
... View more
07-15-2013
11:01 PM
|
0
|
0
|
2051
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-24-2026 11:37 PM | |
| 1 | 03-24-2026 08:01 PM | |
| 7 | 02-23-2026 08:34 AM | |
| 1 | 03-31-2025 03:25 PM | |
| 1 | 03-28-2025 06:54 PM |
| Online Status |
Offline
|
| Date Last Visited |
4 weeks ago
|