|
POST
|
It looks like there's a problem with how you're specifying your coordinate system. Apparently, there are 3 ways to properly create a spatial reference: 1.) Use the name of the coordinate system (I couldn't get it to work with "GCS_WGS_1984" or "WGS_1984", so I'm not sure what it's looking for) 2.) Use a projection file (.prj) (I didn't try this) 3.) Use a coordinate system's factory code (or authority code) (this works) Try making spRef = 4326 This works for me: arcpy.MakeXYEventLayer_management("H:/GIS_Data/ApgRImmrpWGSxyz.xls/ApgRImmrpWGS$", "X", "Y", "outputlayer",4326, "Z")
... View more
11-01-2012
07:45 AM
|
0
|
0
|
4088
|
|
POST
|
The order of parameters from the help is (note that the z-field is last): MakeXYEventLayer_management (table, in_x_field, in_y_field, out_layer, {spatial_reference}, {in_z_field}) So, your call should be: arcpy.MakeXYEventLayer_management(tb, xc, yc, out_Layer, spRef, zc)
... View more
10-31-2012
02:13 PM
|
0
|
0
|
4088
|
|
POST
|
Another option is to use the Linear Referencing tools. Intersect the pipelines with parcels, create a route from your pipelines, locate the intersections along the route, make route events from the locate table, and export to a permanent feature class. This calculates the distance from the beginning of your pipeline to each intersection point - you're still left with the task of deleting those intermediate points.
... View more
10-15-2012
02:33 PM
|
0
|
0
|
915
|
|
POST
|
I forget about how the code works inside the field calculator as i rarely do this sort of thing in that contex; does this code get run directly against the Sort field then and the returned value is assigned to that field? I was thinking there's still need to be a line of code where Sort is assigned a value. Seems there wouldn't need to be a function defined in that event. You'd get along well with the presenter at the ESRI UC who said, "why UI when you can arcpy?", which I agree makes sense if you're doing it over and over. But, if you're only going to do it once, I find it faster (with my code-writing, at least a few minutes to get everything working) to right-click the column in the table, choose Field calculator and fill it out (as attached). So, "why arcpy when you can UI?" It's basically six one way, half a dozen the other.
... View more
09-24-2012
11:51 AM
|
0
|
0
|
2313
|
|
POST
|
Part of the problem is that we don't know how the OPs code "doesn't work" since that isn't stated in the original question. I assume it doesn't work because the statement !sort! = 10; should be return 10 (and so on for the others). Also returning a value that way still only means that function has to be wrapped into another function that actually updates the Sort field as the OP desires. This code is intended to be run in the field calculator (as per the OP). won't trap only those contours that end with 10, just those that are evenly divisible by 10 - so the OP would get contours ending in 20, 30, 40, etc. being reclassified. Though its a bit unclear, I don't think that is his intention. You're right - it's unclear. But I assume they want all contours ending with a zero, not literally "10", so they can symbolize those contours differently. I could be wrong...
... View more
09-24-2012
09:23 AM
|
0
|
0
|
2313
|
|
POST
|
This works for me (am I missing something?): def reclass(contours):
if contours % 10 == 0:
return 10
elif contours % 5 == 0:
return 5
else:
return 1
reclass( !Contours!)
... View more
09-24-2012
08:35 AM
|
0
|
0
|
2313
|
|
POST
|
Is there a fundamental problem with editing a checkout (or parent database) that is joined to another feature class? Background: we have a personal SQL Express database as the parent database. Checkouts are distributed from it. In one of the checkouts, two columns were added and populated (yes, I'm sure that makes some of you cringe). Of course, on check-in to the parent, those new columns are ignored. Is there any way to get those columns into the parent db? I am allowed to create the new columns in the parent, but once I join the checkout to either the parent or a new checkout in order to join and transfer data from column to column with the Field Calculator, the Field Calculator is disabled. Any help is greatly appreciated!
... View more
09-11-2012
09:05 AM
|
0
|
1
|
1093
|
|
POST
|
Depending on the size of your datasets and amount of RAM available on your system, you could potentially save some time writing/deleting by taking advantage of the in-memory workspace.
... View more
09-04-2012
08:11 AM
|
0
|
0
|
2660
|
|
POST
|
Have you looked into Data Driven Pages (ArcGIS 10+)? If you're using ArcGIS 9.3 or lower, check out DS Mapbook. Either way, it allows you to output PDF pages showing data (your polygons) by an index layer (your grid).
... View more
09-04-2012
07:42 AM
|
0
|
0
|
676
|
|
POST
|
Try it using proper path syntax (ie. no backslashes, unless you put "r" in front, or escape with a second backslash. 1) "C:/Path/path" 2) "C:\\path\\path" 3) r"C:\path\path"
... View more
07-22-2012
01:21 PM
|
0
|
0
|
903
|
|
POST
|
Read this page about creating signature files. Basically, if you know what classes you want the image to be classified into (ie. the colors on your original map), then draw polygons to use as samples for the classification, and use the Create Signatures tool to make the signature file.
... View more
07-10-2012
07:33 AM
|
0
|
0
|
1261
|
|
POST
|
1.) With rasters (ie. your georeferenced GIF) you need to use Extract By Mask, not Clip. 2.) You'll have to reclassify your image into meaningful categories. You might want to think about using Maximum Likelihood Classification to group together similarly colored pixels.
... View more
07-04-2012
08:54 AM
|
0
|
0
|
1261
|
|
POST
|
The problem is that in VB you need to wrap strings in quotes. When you pass what you've written into the field calculator from Python, it strips off the quotes of the parameters turning "STAK" into STAK. Basically, you just need an extra set of quotes around the expression so it's left with quotes once the first set have been stripped. arcpy.CalculateField_management ("WELL_PT", "W_STATUS", ' "STAK" ', "VB")
... View more
06-26-2012
07:15 AM
|
1
|
0
|
1501
|
|
POST
|
From the help: If the zone feature input has overlapping polygons, the zonal analysis will not be performed for each individual polygon. Since the feature input is converted to a raster, each location can only have one value. An alternative method is to process the zonal statistics iteratively for each of the polygon zones and collate the results. If you're comfortable with python, you should be able to cycle through each buffer with a SearchCursor, use Make Feature Layer with the appropriate where clause to pull out each buffer one by one, calculate statistics using Zonal Statistics as Table, and Merge all the tables together.
... View more
06-25-2012
11:44 AM
|
0
|
0
|
2380
|
|
POST
|
I don't know about Quick Export, but this exports a feature class to csv, with headers. import arcpy, csv fc = "H:/GIS_Data/TEMP.gdb/points" #input feature class rows = arcpy.SearchCursor(fc) csvFile = csv.writer(open("H:/GIS_Data/csvfile.csv", 'wb')) #output csv fieldnames = [f.name for f in arcpy.ListFields(fc)] allRows = [] for row in rows: rowlist = [] for field in fieldnames: rowlist.append(row.getValue(field)) allRows.append(rowlist) csvFile.writerow(fieldnames) for row in allRows: csvFile.writerow(row) *mostly stolen from here
... View more
06-22-2012
01:16 PM
|
0
|
0
|
1382
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-30-2013 02:22 PM | |
| 1 | 04-12-2011 11:19 AM | |
| 1 | 09-17-2021 09:43 AM | |
| 1 | 04-04-2012 12:05 PM | |
| 2 | 07-16-2020 11:31 AM |
| Online Status |
Offline
|
| Date Last Visited |
07-15-2023
12:11 AM
|