arctoolbox
One of the great advancements over the last decade plus in GIS is that government agencies have started to move away from a ‘recover-our-cost’ mentality to more of an ‘Open Data’. Minnesota, for example, has launched their Geospatial Commons as a platform for sharing data.
And while getting free, authoritative data is awesome, it can leave you in a bind if the structure of the data changes. Sometime between April and September, Hennepin County, Minnesota, changed the schema of their publicly available street centerlines data.
For some odd reason, I wanted to split all the arcs in a polyline feature class to a specific length–if a specific feature was longer than the target length, it would become two or more separate polyline records.
Here is the bare-bones script that copies an existing feature class into a new feature class then processes each record, splitting it into multiple records if the polyline is longer than the user-specified tolerance.
One of the Spatial Analyst tools we often use in ArcGIS is the Extract Values to Points tool. This allows us to take a point file (well locations in our case) and attach a value (elevations) from a raster image (a DEM) to each point.
Today I was running it for the first time against an Image Service we recently published and I received a warning message,‘WARNING 000957: Skipping feature(s) because of NULL or EMPTY geometry’.
Since I use python for different tasks, I launch python scripts a variety of ways. Depending on what I am doing, a single script may need to accept parameters from either:
Passed in from an ArcGIS Toolbox Tool. Re-occurring default value. Often used in scheduled processes, a nightly backup, for example. A temporary set of values used in an interactive, debugging session. What I often do is make the parameter interpretation flexible to meet my needs.