5

They're Field objects, you need to print the Field.name property: [f.name for f in arcpy.ListFields(your_fc)] Example from the Help: Code sample ListFields example - List field properties. import arcpy # For each field in the Hospitals feature class, print # the field name, type, and length. fields = arcpy.ListFields("c:/data/municipal.gdb/...


5

The indentation errors are unrelated to the name of the mapping module. As @smiller comented, you are probably mixing tabs and spaces. If you want to make sure, download Notepad++ and open your Python file by right clicking it and selecting Edit with Notepad++. Once Notepad++ is open, click on the Show All Characters button It will show all special ...


4

No, the problem does not have anything to do with ArcGIS or arcpy. SyntaxError means that there is a problem with the syntax of your program and it identifies this error before running anything. In your case, you have an opening parenthesis that should not be there and is triggering the error. On the line: structureMultiplier = (arcpy.GetParameterAsText(5) #...


3

In VB .net if you want to save an object to file to be used later, e.g. a dictionary you would serialize it. I believe the equivalent in python is pickle. Be aware not all objects can be "pickled", I would imagine especially anything arcpy related (but I may be wrong). So if you are extracting network topology as dictionaries then you should be able to ...


3

Use the 'Dissolve' tool. The Merge tool is for merging multiple feature classes into one new feature class, but still keeping the existing features separate. The Dissolve tool is for merging features within a feature class into either a single feature, or multiple features based on same attribute values. If the features to be merged are not touching or ...


2

ArcGIS Pro 2.4 (released a few weeks ago) quantizes complex vector geometry based on your chosen DPI, thereby potentially drastically reducing file size of your exported PDFs. If you've not yet updated, it might be worth a try to see if this helps with your processing problem.


2

You can use the Identity tool to populate a new attribute field in a new point feature class with the unique identifier of the polygon each point falls within. This tool requires an Advanced level license.


2

Sounds like a Spatial Join would do the job. From the documentation: Joins attributes from one feature to another based on the spatial relationship. The target features and the joined attributes from the join features are written to the output feature class. I assume you just want to keep DISTRICT_NUM and not all the attributes from your Polygon ...


2

Open up a Python console and run the following line: re.search(r"""\((.*?)\)""", "Witless Bay (1001559) T 00000 ( 6.5%)") You will see it returns a match object (<_sre.SRE_Match object at 0x15AB2E60>) as @mikewatt commented. There is no way ArcGIS can insert this object inside a field. You have to use the group method. Following the preceding ...


2

In ArcGIS Desktop 10.x you use arcpy.mapping.Layer lyr = arcpy.mapping.Layer(r"path\to\file.lyr") print lyr.name In ArcGIS Pro you use arcpy.mp.LayerFile: lyrFile = arcpy.mp.LayerFile(r"path\to\file.lyrx") for lyr in lyrFile.listLayers(): print(lyr.name)


2

To do this review the ArcGIS Pro Help on Interactive feature input: When specifying a geoprocessing tool's input feature data, you have the following options: Select a feature layer from the map. Browse to a feature class. Interactive input—add a new layer and interactively create features. It is the third option, which I have bolded, ...


1

From https://geojson.org/: GeoJSON supports the following geometry types: Point, LineString, Polygon, MultiPoint, MultiLineString, and MultiPolygon. Geometric objects with additional properties are Feature objects. Sets of features are contained by FeatureCollection objects. I'm no GeoJSON expert but when I read this I think what you want is not ...


1

You cannot publish your own routing (network dataset) to ArcGIS Online. You'll need to publish it to your on-premise Enterprise. If you're committed to using ArcGIS Online, you'll need to use the routing services and tools they provide (which are generally credit based consumption) Esri staff reference > Help documentation reference


1

It's failing because you're passing in a string to the addLayer function and hoping the method will resolve to the layer you created. In short, it wont. You'll need to be more explicit in what you pass addLayer - the actual layer from the result. In the below code I know that grabbing the first index ([0]) gets the layer object. fooResult = arcpy....


1

The solution turned out to be that I was trying to run the script from a py file inside a toolbox that I created, and not as a saved pyt file.


1

Right click the feature class in the Contents pane and open symbology from the context menu. Shift click the first and last class from the "Primary Symbology" pane to highlight all values. Click the "More" button in the "Primary Symbology" pane, and choose "Format all symbols" from the context menu. Switch from gallery view to properties view in the "Format ...


1

If the images were acquired on the same day, you can usually simply combine using the tool called 'Mosaic To New Raster' (https://pro.arcgis.com/en/pro-app/tool-reference/data-management/mosaic-to-new-raster.htm), while keeping track of NoData values. If the images were not acquired on the same day, combining them is not recommended, as the values will be ...


1

The tool is not available in Pro: "Geometric networks are a read-only dataset in ArcGIS Pro. The capability to manage, model, and analyze network systems for water, gas, electric, telecom, sewer, storm water, and other utilities has been replaced by the Utility Network."


1

Layer Package is just zip archive and the file geodatabase is inside it along with LYR file


Only top voted, non community-wiki answers of a minimum length are eligible