|
POST
|
I tried your code, Joshua, and it seems to work fine. I'm not sure what I was doing; I must have had a brief infection of Friday afternoon derp derp. However, since I'm already using datetime, I'll use that instead of time. import datetime
import os
gdb = # path to file geodatabase
created_timestamp = os.path.getctime(gdb)
print datetime.datetime.fromtimestamp(created_timestamp)
... View more
05-23-2016
09:38 AM
|
0
|
0
|
4352
|
|
POST
|
Just noticed there is a gdb file in the geodatabase that seems to retain the earliest time of the geodatabase. I'm going with that unless anyone else has a better suggestion.
... View more
05-20-2016
04:24 PM
|
0
|
2
|
4352
|
|
POST
|
Is there a way to get the date a file geodatabase was created? Windows file explorer properties shows the correct creation date but os.path.getctime() just seems to return the same thing as os.path.getmtime(): the date modified ( which gets changed every time you view something in the gdb). Workspace Describe doesn't have anything either.
... View more
05-20-2016
02:11 PM
|
0
|
6
|
9730
|
|
POST
|
I think I did it like this spatial_ref = # Define Spatial referene here
point = arcpy.Point(X, Y)
point_geometry = arcpy.PointGeometry(point, spatial_ref) Then you can use point_geometry with your insert cursor (which should be opened with the ID field as well as SHAPE@) to create the feature with the ID.
... View more
05-18-2016
11:19 AM
|
1
|
4
|
3991
|
|
POST
|
Richard Fairhurst has a nice blog post titled Turbo Charging Data Manipulation with Python Cursors and Dictionaries that might help with the cursor side of your question.
... View more
05-17-2016
09:18 AM
|
0
|
1
|
2748
|
|
POST
|
You might have to make your own geoprocessing service and call it with ArcGIS API for JavaScript
... View more
05-13-2016
03:50 PM
|
0
|
0
|
2082
|
|
POST
|
Are you working in ArcMap or a web app with ArcGIS Javascript API?
... View more
05-13-2016
02:03 PM
|
0
|
2
|
2082
|
|
POST
|
Sorry, I just realized that where_clause doesn't use the utm_field variable I had set up. Line 5 from the code above should be: where_clause = "{} LIKE '{}%'".format(utm_field, utm_prefix_filter)
... View more
05-11-2016
09:30 AM
|
1
|
0
|
720
|
|
POST
|
My suggestion would be to do something like this where you can specify the beginning of the value. Assuming the structure of the FOL_250K field values will stay the same, you can specify just the block or the block and sheet. # Get list of distinct UTM values
utm_field = "FOL_250K"
utm_prefix_filter = arcpy.GetParameterAsText(0)
if utm_prefix_filter:
where_clause = "FOL_250K LIKE '{}%'".format(utm_prefix_filter)
else:
where_clause = ""
sql_prefix = "DISTINCT {}".format(utm_field)
sql_suffix = None
distinct_utm = [
i[0] for i in arcpy.da.SearchCursor(
feature_class, utm_field, where_clause, sql_clause=(sql_prefix, sql_suffix)
)
]
... View more
05-09-2016
05:11 PM
|
2
|
1
|
720
|
|
POST
|
Will you only ever filter on block or do you want to also filter on sheet or something else? Will it be a single filter value or a list of filter values?
... View more
05-06-2016
11:19 AM
|
0
|
3
|
2718
|
|
POST
|
Something like this might work. # Get list of usable field names (exclude OID and SHAPE fields)
fieldNames = [
f.name for f in arcpy.ListFields(inputTable)
if f.type != "Geometry" and f.editable == True
]
... View more
05-02-2016
09:47 AM
|
2
|
0
|
1836
|
|
POST
|
Could you use the definitionQuery property of Layer?
... View more
04-29-2016
09:05 AM
|
0
|
1
|
3320
|
|
POST
|
From the code you posted, you're not actually joining a table, only limiting the fields that are exported from whatever gab_und_crt_dic[0] is. If that's the case, then your code is fine. An alternative method would be to only add the field maps you want from the start instead of adding everything, then going through each one to remove what doesn't belong. ws = "path to workspace"
fc_path = os.path.join(ws, gab_und_crt_dic[0])
out_fields = [
"ID_UND_CRT",
"st_UND_GEOL",
"DSCR_UND_CRT",
"DSCR_UND_CRT_LG",
"FOL_250K",
"ID_UND_LITO",
"DSCR_UND_GEOL",
"DSCR_UND_LITO",
"IDE_CRON_INF",
"IDE_CRON_SUP"
]
# Build field mappings with only desired fields
fieldmappings = arcpy.FieldMappings()
for field in out_fields:
fm_obj = arcpy.FieldMap()
fm_obj.addInputField(fc_path, field)
fieldmappings.addFieldMap(fm_obj)
# Export feature class with field mappings
arcpy.FeatureClassToFeatureClass_conversion(
bla,
bla,
bla,
bla,
)
... View more
04-29-2016
08:30 AM
|
2
|
0
|
2718
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 4 weeks ago | |
| 1 | 10-23-2025 03:53 PM | |
| 1 | 04-28-2026 07:25 AM | |
| 1 | 03-19-2026 08:59 AM | |
| 1 | 02-12-2026 01:37 PM |