POST
|
To do this you need to first set the RGB composite manually on one raster and save it as a lyr file. You can then use the lyr file to update the symbology of the raster that you have added with arcpy.mapping.Updatelyr. Here is a script that i wrote to add all of the .tif files in a folder to a mxd and set the symbology as RGB. #-*- coding: utf-8 -*-
import glob
import os
import arcpy
#Count number of files added to mxd
count = 0
#Paths
path = r"V:/Path/to/raster/folder"
MXD = r"V:/Path/to/arcmapdocument/mymap.mxd"
sourceLayer = arcpy.mapping.Layer(r"V:/path/to/layerfile/rgb.lyr")
mxd = arcpy.mapping.MapDocument(MXD)
df = arcpy.mapping.ListDataFrames(mxd)[0]
for file in os.listdir(path):
if file.endswith(".tif"):
name = file.split('.')[0]
print name
rasterPath =os.path.join(path, file)
updatelyr = arcpy.mapping.Layer(rasterPath)
arcpy.mapping.UpdateLayer(df, updatelyr, sourceLayer, True)
arcpy.mapping.AddLayer(df, updatelyr, "BOTTOM")
count = count + 1
print count
mxd.save()
Hope this helps!
... View more
10-15-2018
10:47 PM
|
2
|
2
|
1799
|
POST
|
It was the buildings I created yesterday that aren't visible. I have just tried replacing a building in a new multipatch with a SketchUp model and publishing and it worked. Seems like my other multipatch is corrupt. For the buildings with white roofs it seems like I need to set a colour on the reverse side of the polygon (inside the building) so that it is not white when published on ArcGIS online.
... View more
12-05-2017
02:30 AM
|
0
|
1
|
691
|
POST
|
I have created a number of 3D buildings using SketchUp and ArcGIS Pro which are stored as a multipatch. All buildings are visible in ArcGIS Pro and with the correct appearence. I have created a scene layer package and published to ArcGIS online. When I open the layer in a scene a number of the buildings are missing and a number have got white roofs and not the colour which I see in ArcGIS Pro. When I view the multipatch in a 2D map in Pro/Desktop/Catalog the missing buildings are visible. I don't think it has anything to do with the base elevation value as most buildings as visible. Any ideas?
... View more
12-05-2017
02:05 AM
|
0
|
3
|
835
|
POST
|
I have produced a map in Web App builder that I would like to create a URL for that opens the map in a specified place with one or several layers visible. I have read the information here: Use URL parameters—Web AppBuilder for ArcGIS | ArcGIS I assume that it is the 'query=' parameter that I need to use. All of the layers in the map are in groups, meaning that I need to use <layer id_sublayer id>. Is it possible to add one more level to this? for example <layer id_sublayer id_sublayer id>. All of the layers have been added to the map as ArcGIS Server web services. When I add the encoded query to the url the map loads as it would without the query (the query parameter has no effect). At the moment I am trying to use layer names rather than IDs. Adding a query to the URL works on another Web App where the layers have been uploaded to ArcGIS Online from shape files and are not grouped. My questions: Is query the correct parameter to use or is there a better method? Does Query work with web services? Does query work with layers that are grouped in a subgroup within a subgroup?
... View more
11-27-2016
11:36 PM
|
0
|
2
|
1722
|
POST
|
Have a look at my answer to a similar question here: https://community.esri.com/message/641654-upload-csv-to-workforce-as-assignments Hopefully it might help!
... View more
11-04-2016
11:02 AM
|
0
|
0
|
207
|
POST
|
I thought I would make an attempt to answer your question. A few days ago I was in a similiar situation, we are trying to put together a Workforce project for a maintenance department. While Workforce is easy to get started with and create a project it quickly becomes more complicated if you want to do anything more that create assignments by clicking on the screen. I have used Python for various tasks before but would class myself as a beginner and when I have used it for geoprocessing tasks I have always written the code and then run it directly from the GUI (rather than the command line). While the documentation is good for the Workforce scripts I get the impression it is aimed at people who are already exprienced in Python. I'll try to explain the steps I took to import assignments from a csv file, anyone with more experience or that spots a mistake feel free to comment! 1. Follow the instructions here: GitHub - Esri/workforce-scripts: A set of scripts to help administer Workforce projects. to download and install both Python and ArcREST. I installed using pip, if you haven't got this far then there is information available on the internet about how to download and install pip and python librarys using pip. 2. Download the zip file including the Worforce scripts and unzip it somewhere on your computer 3. Create a Workforce project here: Workforce for ArcGIS. Add the names of the assignments you wish to include (Assignment Types) in you project and the mobile workers and dispatchers. 4.Open an empty text file and copy the example usage command line propmt to the text file from here. workforce-scripts/create_assignments_from_csv_readme.md at master · Esri/workforce-scripts · GitHub 5. In your text file change username and password to your ArcGIS Online username and password. Change "https://<org>.maps.arcgis.com" to your ArcGIS online account address. Change the code under -pid to your Workforce project code (you can find it in the web address when you are logged in to your Workforce project). 6. Depending upon how you have installed python and where you have unzipped the workforce scripts you may need to change the paths of the "create_assignments_from_csv.py" script, the assingment.csv file and the log text file. If you add the full file path then python should be able to find them. I have used the arcrest_scripts rather than the standalone_scripts. 7. Open your command line and type "python" without the quotes. If you see some white text and a >>> then you don't need to do anything, if you get an error then python is probably not in your system path. At the start of you text file, replace "python" with the full path to your python.exe (most likely something like C:\Python27\python.exe). 8. If you are going to run the sample assignments.csv then it should work now to copy the command line you have edited in your text file to the command line of your computer. I suggest you try this first before creating your own assignments. 9. When creating own assignments I have followed the structure of the sample csv file with regards to column names and order. If you want to change them then you need to change them in your command line aswell. Depending on your region, if you create a csv from Excel it might use a semi-colon instead of a comma as a seperator. This casues the python scipt to fail. In the csv file under the column "Type" there must be an interger, the number that you give the assignment here will be assigned an Assignment Type based on the order of the assignment types that you created in the Workforce project earlier. Change "102100" under -wkid to the EPSG code of the coordinate system you are using. If your Due Date format doesn't match "%m/%d/%Y" then you need to add -dateFormat with your date format to the command line. For example -dateFormat "%Y-%m-%d". Attachments work from a file, I haven't got them to work with a web url. Hope this helps!
... View more
11-04-2016
02:35 AM
|
1
|
11
|
1835
|
Title | Kudos | Posted |
---|---|---|
2 | 10-15-2018 10:47 PM | |
1 | 11-04-2016 02:35 AM |
Online Status |
Offline
|
Date Last Visited |
02-21-2024
05:09 AM
|