|
POST
|
What I didn't realize is that the version running in my arcgispro-py3 environment is 3.5.4. I installed Anaconda 3.6. Now when I try to run >import arcgis I get the error: ModuleNotFoundError . The Anaconda/Continuum documentation says to run >conda install python=3.5 , but in what path? If I just go to my user directory and run >python --version , in the Anaconda command prompt, it says python 3.6.5.
... View more
08-14-2018
07:27 AM
|
0
|
1
|
3890
|
|
POST
|
Well, for example, I might try to run a command like "?pip install arcpy" and it would return an error saying pip is not a command. Since, posting this initial question, I went ahead with installing Anaconda. I have the 'arcgis' package installed through Conda on ArcGIS Pro, but when I try to import it from Jupyter or the Spyder IDE, I get the error: "ModuleNotFoundError: No module named 'arcgis'". I run $conda list and it shows that arcgis package is installed under my arcgispro-py3 folder. This is my current problem and what I was trying to avoid. Any suggestions?
... View more
08-14-2018
04:59 AM
|
0
|
3
|
3890
|
|
POST
|
Hey All- I have both Python 2.7 with ArcGIS 10.5 Desktop and Python 3.6 with ArcGIS Pro. A few weeks back, I tried to install Anaconda (w/ Conda, Spyder, Jupyter, etc..) and it somehow overwrote my system settings for Python 2.7 (as well as pip). I noticed that I could no longer use pip or import stuff in 2.7. I uninstall Anaconda and the updated version of pip (it somehow updated the pip version) and everything in 2.7 worked again. Any suggestions on reinstalling Anaconda with wrecking my Python 2.7 development environment again?
... View more
08-13-2018
11:33 AM
|
0
|
14
|
8314
|
|
POST
|
Thanks Robert, It does look like quite an undertaking. I am looking at using the javascript api and dojo/dijits and seeing what I can come up with. I see there is an InfoTemplate example that allows you to have a Pie Chart tab in a popup modal on a clickable layer, but that seems like a whole different concept. Perhaps if I made a category title clickable and then launched a modal with the pie chart, that might be doable. Thanks.
... View more
08-06-2018
07:56 AM
|
0
|
1
|
2117
|
|
POST
|
I am using Robert's eSearch Widget to bring in some ACS census data in certain areas. Graphically, it displays the results like this: Lets say I wanted to display the race results as a pie graph. I can easily use `(Math.floor((Total Pop/RacialGroup) * 100).toFixed(1) + "%"); ` or something like that to get the percentage> I have no idea how I could create and insert a small pie graph in the Results under Race to display. Currently, I am using the following to display the results in the widget.js. thisVar.featLayerTracker +=layerConfig.Label.Population + ": " + sumPOP + "<br>"; So, I am thinking that I need to perhaps look to layerConfig inthe config_eSearch.json perhaps to set something like this up. Any ideas or suggestions?
... View more
08-06-2018
07:14 AM
|
0
|
11
|
2658
|
|
POST
|
.ListFields was definitely the way to go. I didn't realize that Descibe.InfoFields was only for layers not features classes.
... View more
08-05-2018
05:54 PM
|
0
|
0
|
4462
|
|
POST
|
I have a script that looks at feature class inside a .gdb and prints some simple information about the attributes field. Note- these is actually only one feature class in the .gdb. I want use the `arcpy.Describe` method with fieldInfo. Everytime the script gets to the line `field_info = desc.fieldInfo`, it throws the error `AttributeError: DescribeData: Method fieldInfo does not exist`. My feature class definitely has an attribute table with fields. What is the problem here; why is this error being thrown and how can I fix it? My end goal is to just get a list of the field names in my feature class attributes table: import arcpy, sys, os arcpy.env.workspace = r"C:/Workspace/Sandbox/MapChangeProject/data/Alabama.gdb" fcList = arcpy.ListFeatureClasses() for fc in fcList: print("FeatureClass: {}").format(fc) desc = arcpy.Describe(fc) field_info = desc.fieldInfo for index in range(0, field_info.count): print("Field Name: {0}".format(field_info.getFieldName(index)))
... View more
08-03-2018
08:15 AM
|
0
|
2
|
5033
|
|
POST
|
Hey All- Let's says I have a list of state Names in a Python script: stateNames = ['Alabama', 'California', 'Colorado', ...] I also have a gdb called states.gdb, that has a feature for each state: Alaska, Alabama, California, etc... I also have an attribute value that I want to use to select certain features by attribute. Lets say its 'Fips_code' = 01007. Using an item from my stateNames list, lets use stateNames[0] or Alabama, I want to get the Alabama feature from my states.gdb and select all of the records that have have Fips_code = 01007. Any suggestions on where to begin?
... View more
08-01-2018
01:54 PM
|
0
|
1
|
3706
|
|
POST
|
Apparently, when I installed pipenv, it changed the system pip version that I was previously using. For some reason, all of the answers I found were using Linux or Mac, but here is how I resolved it. Simply open your command prompt and type: $python -m pip uninstall pip Then, test that you still have your old version installed by typing: $pip -V This showed me that I had gone from using pip version 18 back to using version 8.1.1. You should then be able to proceed to other tasks using pip.
... View more
07-30-2018
10:43 AM
|
0
|
0
|
3378
|
|
POST
|
I am trying to use pipenv as well as pip and having some issues. I installed pipenv using pip. Then I went back and tried to run pip -v and got the following: ImportError: cannot import name main. I have seen similar problems answered for Linux and Mac, but I cannot use sudo or which commands; I am on Windows 10 using the CMD console. In my scripts folder, I see pip, pip2.7, and pip2. I cannot remember which one was my system pip. I know I need to maybe uninstall and reinstall (I have already tried to upgrade, but of course, without pip running you can't upgrade pip). I don't want to make more of a mess, so I wanted to ask how to resolve this in the CMD console on Windows.
... View more
07-30-2018
07:59 AM
|
0
|
1
|
10017
|
|
POST
|
Hey All, I am using an esri/request call to get data back from an api. Now I'm trying to pick out individual pieces of that data and push them to an empty array that I can further manipulate. Here is how I have the esriRequest code setup. Notice I have a little function called `showResults` to use instead of console.info(resp). I wanted to use this to try and dissect the data be returned in the response (resp): esriRequest({ url:"https://api.census.gov/data/2016/acs/acs5", content:{ get: 'NAME,B01003_001E,B02001_001E,B06007_001E,B06010_001E', for: `tract:${ACS_TRCT}`, in: [`state:${ACS_ST}`,`county:${ACS_CNTY}`] }, handleAs:'json', timeout:15000 }).then(function(resp){ console.info(resp); // showResults(resp); }, function(error){ alert("Data failed" + error.message); }); function showResults(resp) { console.log(resp.data); }; .... Basically, the call returns an object with 2 arrays; 1 that is basically labels and 2 the actual data I want. Essentially I am trying to pick out the data from array 2 ( or array[1], if you will), index 1-4. When I try to use my showResults function that uses console.log(resp.data); , it just returns `undefined`. What am I doing wrong here and how do pick out the array[1] data?
... View more
07-25-2018
07:14 AM
|
0
|
1
|
1193
|
|
POST
|
The above answer works, but I am not sure what the issue was in my original code. It appears that I was using too much info in my original call url and not utilizing the correct content configuration. I thought it may have been a cors issue, but I removed the esriConfig.defaults.io.corsEnabledServers.push('https://api.census.gov') ; part of the code and it still worked fine (ie ...it console.logged the correct info. ). I am uncertain how the `lang.hitch` method works. I may have a follow up question as I attempt to pull data for multiple NAMEs, states, counties, and tracts using the eSearch widget.
... View more
07-24-2018
07:00 AM
|
2
|
0
|
2591
|
|
POST
|
Hey Robert, Thanks for the assist. I marked your answer as correct. Wanna help me with my new question? Api url won’t work with my esri/request method… ☹ -JB
... View more
07-24-2018
06:11 AM
|
0
|
0
|
995
|
|
POST
|
I am trying to retrieve some json census data from an API in a script. I am using esri/request instead of the Ajax method. When I test the following in my console, it works fine: require([ "esri/request"], function(esriRequest) { var dataUrl=
"https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/layers";
var layersRequest = esriRequest({
url: dataUrl,
content: { f: "json" },
handleAs: "json",
callbackParamName: "callback" });
layersRequest.then(
function(response) {
console.log("Success: ", response.layers);
}, function(error) {
console.log("Error: ", error.message);
});
}); As soon as I plug in my API for dataUrl (https://api.census.gov/data/2016/acs/acs5?get=NAME,B01001_001E&for=tract:010805&in=state:01&in=county:073), which is in json format already, I get a 400 (Bad Request) error thrown. What's the problem here?
... View more
07-24-2018
05:43 AM
|
1
|
2
|
4109
|
|
POST
|
I want wanted to configure a select widget in my WAB code on my local to have only the selectBy Polygon instead of the out of the box SelectBy square settings. So I created a new WAB app with those settings, downloaded the code, and attempted to copy the new select widget from the downloaded folder. I immediately realized there was no Widget.html file and no manifest.json file. Everything else looked similar in terms of file structure. I also noticed that the Widget.js code looked a lot different (It was no formatted correctly and looked almost minified) than the original select Widget.js file. For example, there was a selectBy parameter in the new code, but nothing in the original code (I thought maybe I could just modify the original). Any suggestions as to what's going on here? The new widget definitely won't add to my app view without those missing files.
... View more
07-20-2018
09:52 AM
|
0
|
3
|
1101
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-19-2021 01:41 PM | |
| 1 | 11-05-2019 07:44 AM | |
| 1 | 11-05-2019 09:58 AM | |
| 1 | 01-06-2021 05:41 AM | |
| 1 | 12-24-2020 06:48 AM |
| Online Status |
Offline
|
| Date Last Visited |
03-19-2022
10:13 PM
|