|
POST
|
Bill Major, Daniel Hunter - My question is not just about Lambda, but also integrating this into a preexisting python environment. Do you know where this is on the Windows Anaconda install? Anaconda is in C:\ProgramData\Anaconda3 by following the installer's default. There is a folder C:\ProgramData\Anaconda3\Lib\site-packages\arcgis with a bunch of .py scripts. Is that folder all I need to grab, or are there other entries written elsewhere (like a registry of modules)? Does the arcgis API imports other modules I need to get? -- For Lambda, I assume I just drop the arcgis folder under my scripts and zip it up, does that sound right? -- For the existing python, do I assume I just re-create whatever conda created. I see there is a tarball in the Esri Anaconda channel. Is that a better starting point? All I could find on GitHub (via Google) were training docs and samples. thanks!
... View more
11-17-2017
09:15 PM
|
0
|
5
|
8993
|
|
POST
|
Thanks, Dan, I'll check out the TBX (link 1 to the blog). I had already viewed link 2 (support article). Option A produced some funny results. Any feature touching the edge of my raster did not get converted. Also, there are no attributes produced, and producing the label features seemed like a big hassle. Option B gets into converting to raster and back to vector, which seems like the process I'm already struggling with... Here is a screenshot of what I'm getting (blue) with the raster-to-polygon behind it. It appears that anything touching the outer boundary is missing. Link 3 (GeoStats) looks promising. I had actually stumbled upon that just before you replied. I am really struggling with creating the Geostatistical Layer. Any ideas on that? I converted my raster to points and ran the IDW tool (from Geostatistical Analyst) and it runs without error, but it doesn't produce a layer file! Any idea what I'm doing wrong? It will produce a TIF if requested, but I don't get a .lyr file with or without the TIF. As you can see in the screenshot below, I am specifying a path to a file, but it doesn't have a file-open icon next to it, so is that just an in-memory layer or something? (I'm not set on IDW, either - happy to use a different method - just started with the simplest first.) thanks!
... View more
11-17-2017
07:36 PM
|
0
|
1
|
2381
|
|
POST
|
My best guess as to the problem is that the FILTER tool is trying to write a temporary kernel file into a directory that is forbidden to users who are not administrators. As my non-administrator user, I am unable to create files in that directory (C:\PROGRA~2\ARCGIS\DESKTO~1.5\BIN\), so that would explain the failure. I have 3 work-around solutions for this: 1) Run ArcCatalog as an administrator. Just find it in your start menu and right-click on it and choose "Run as Administrator". You have to have another user/pass login to do this. My work's policy is that users are not administrators, but we have access to an admin account for limited usage. This works for me, but may not for you. Also, it runs as a separate user, so I don't have access to any of my settings (database connections, folder connections, symbols, etc, etc.) from my user. I guess I could switch over to the administrator user full-time, but... yuck. 2) The filter tool with the LOW type is basically the same as FOCAL STATISTICS with the RECTANGLE neighborhood at 3x3 and a MEAN statistics type. That is working fine for me as a non-administrator. NOTE: My guess is FILTER is running FOCAL STATISTICS with an irregular neighborhood and trying to write out a temp 3x3 kernel file. 3) Use python. This worked fine in both the ArcCatalog command line and a stand-alone script (both running as my non-admin user). It is only the tool in ArcCatalog that gave me an error.
... View more
11-17-2017
05:15 PM
|
1
|
0
|
3645
|
|
POST
|
OK, good point. I tried to edit it so I got #3 in with #1 and #2, but I couldn't figure out how. Will post a new entry and mark that as the solution. Thanks for all your input.
... View more
11-17-2017
04:59 PM
|
0
|
0
|
1206
|
|
POST
|
Short(er) version of the question: I have a raster surface (decimal values) that I want to convert into 5 categories of polygons based on class breaks, and the output must be smooth and visually appealing. Using the "contour list" tool and line smoothing (PAEK method), I'm able to produce nice contour lines that are basically what I want, but I need polygons. Back in the raster world, using reclass (to convert to integer) and then "raster to polygon", I get a jumble of sliver polygons and ugly blocky edges. I could smooth these out, but it also doesn't create concentric rings in places where it increases sharply, so I get non-consecutive values adjacent to each other. The screenshot below shows what it looks like when I use raster to polygon without simplification, and the simplified version is an even worse mess. The nice contour lines are drawn over it. How can I get polygons that look like what I see with these contour lines? Long(er) version of the question: My input is a raster surface (double), and I want to produce polygons as output for 5 classes based on thresholds. I have ArcGIS Desktop and access to all the extensions. Although I may be a data nerd who doesn't see any problem with blocky edges and sliver polygons, my marching orders were to produce nice, clean polygons that show the larger trends in the data and remove the micro-fluctuations in the data. In other words, it needs to be smooth and visually appealing, and I have creative license to get there. The raster is an air quality model, so it's not a conventional DEM terrain surface. There are massive fluctuations in the surface (Z) value in a very short distance, so contours will be very close to each other, but I do need them to be concentric, even if they are very narrow bands (like the contour lines above). I have already smoothed it and reduced the cell size to get this far. I suppose I could continue to smooth and resample until my raster data processing produces something similar to the contours. That said, I feel like I have what I want with the contours (visually), but I need polygons, not lines. I found an Esri help doc on converting contours to polygons saying to rasterize it and then run raster to polygon. This doesn't exactly fill me with confidence, since that is the process I'm fighting with already! Is there some contouring tool that will do what I have above, but with the lines filled in as polygons?
... View more
11-17-2017
04:56 PM
|
0
|
3
|
4048
|
|
POST
|
WORK-AROUND 3: Use python. That works fine. In the great irony, I was actually writing a python script, and I only used the tool in ArcCatalog to try it once or twice before putting it in code. Gah! That should teach me for using the mouse instead of the command line...
... View more
11-14-2017
03:46 PM
|
0
|
1
|
2439
|
|
POST
|
Hi all - I think I found two work-around ideas. First, I appreciate the input on filenames. I re-ran it with the simplest names I could give it and got the same error. Here is the "copy as Python Snippet" for what I tried: arcpy.gp.Filter_sa("C:/temp/avg.tif", "C:/temp/avg2.tif", "LOW", "DATA") It feels like we can eliminate wacky file names from the list of suspects. The error is saying the neighborhood mask is invalid, which I'm guessing is basically a kernel file, and if it's missing, that would be invalid... Why it's missing is anyone's guess, but the name looks like a temporary file name, so I started asking myself "what would cause a temporary file to fail?" Well, I'm not running ArcCatalog as an administrator user, and that would absolutely prevent me from writing into the program files x(86) folder. In fact, I had that problem the other day with something else. WORK-AROUND 1: Run as Administrator - This worked!!! Except, it's a real hassle, because it actually runs as another user, so I don't have access to any of my settings (database connections, folder connections, symbols, etc, etc.). I guess I could switch over to the administrator user full-time, but... yuck. WORK-AROUND 2: Can someone please confirm the following? Is the FILTER tool with the LOW type the same as FOCAL STATISTICS with the RECTANGLE neighborhood at 3x3 and a MEAN statistics type? That is working fine for me. Last note: I appreciate the suggestion to file a tech support request, but our academic site license policy is basically that we are only allowed to do so when it is a total show-stopper, so I'm wondering if FOCAL STATISTICS is the same thing.
... View more
11-14-2017
03:38 PM
|
0
|
6
|
2439
|
|
POST
|
Xander Bakker - I copied the input to C:\temp and got the same result. Can you please take a look in C:\Program Files (x86)\ArcGIS\Desktop10.5\bin to see if you have a file or folder named NBR02? If so, can you post its content and/or attach it? thanks
... View more
11-14-2017
11:05 AM
|
0
|
10
|
2439
|
|
POST
|
How strange. I am just getting the same non-WKT I posted in my original question in both a Jupyter notebook and on a MacBook running python 3.6. Thanks for your help, but for now, we just dumped it to JSON, read that into a Python dictionary, and transmogrified it into WKT that PostGIS will accept. I may circle back on this in Windows using the ArcGIS-supplied python just out of curiosity, but if I can't count on it working reliably in all environments (this will probably go to an Ubuntu Server or AWS Lambda for production), then I can't use it.
... View more
11-14-2017
10:49 AM
|
0
|
0
|
2039
|
|
POST
|
I am using ArcCatalog 10.5, running the Filter tool from the Spatial Analyst toolbox. I enter an input and output grid and specify low filter type. I leave the ignore nodata box checked. The inputs to this aren't complicated, but I'm getting an error: Here are the Messages Executing: Filter C:\temp\2017-11\multi-model-vis\PNW_4km_2017090900\averages\average00.tif C:\temp\2017-11\multi-model-vis\PNW_4km_2017090900\averages\average00_filterlow.tif LOW DATA Start Time: Tue Nov 14 09:18:19 2017 ERROR 010333: Invalid Weight neighborhood mask:: C:\PROGRA~2\ARCGIS\DESKTO~1.5\BIN\NBR02 ERROR 010067: Error in executing grid expression. Failed to execute (Filter). Failed at Tue Nov 14 09:18:19 2017 (Elapsed Time: 0.26 seconds) This laptop is actually pretty new, and I have never fiddled around with the file mentioned in the red line. There is no file or folder of that name when I go there in Windows Explorer. I have two ideas, and any feedback is appreciated. 1) Use the Focal Statistics with the MEAN statistic type. This seems like the same thing as the rectangle with 3x3, or I can create my own 3x3 kernel file with all weights equal (1, for example). 2) Try to create a kernel file at this location. Has anyone ever experienced this? If you have a file at C:\PROGRA~2\ARCGIS\DESKTO~1.5\BIN\NBR02 (this path is just DOS shorthand for "C:\Program Files (x86)\ArcGIS\Desktop10.5\bin"), can you please attach it to this thread or insert its text in a reply? thanks! David
... View more
11-14-2017
10:41 AM
|
0
|
13
|
5218
|
|
POST
|
I am also running 1.2.4. I tried it on a Jupyter notebook and a regular install of Python on a Macbook - same result. The ArcGIS Server is 10.31, could that be the isssue?
... View more
10-26-2017
02:56 PM
|
0
|
2
|
2039
|
|
POST
|
Joshua - Thanks. I'm not too familiar with the delta between WKT & EWKT. For simple features, they seem to be about the same. Setting that issue aside, however, the ArcGIS Python API's WKT is quite different, so thanks for confirming I'm not crazy or doing something wrong in my code. I appreciate the ArcPy solution, but we're hoping to avoid all that overhead for now on our little Linux server. Without ArcPy, is it safe to say that writing some code to reformat ArcGIS WKT into PostGIS WKT is our fastest approach? It's not a big job, but then I suppose we'll have to eventually do point, line, and polygon, plus the "multi" versions of each. Any other suggestions are welcome.
... View more
10-25-2017
11:10 AM
|
0
|
4
|
2039
|
|
POST
|
Thanks, Kelly. I tried so many permutations of URL and username that I had reached the end of my rope. I've been grabbing the session out of Chrome Developer Tools which works for prototyping, but I'm trying to automate some server code, so that's not a long-term solution. It sounds like my next step is to figure out Oauth. Do you know of any clear and concise demos to generate a token that way? Even if it's in .Net or just POST instructions, I can convert that to Python. thanks!
... View more
10-25-2017
10:50 AM
|
0
|
0
|
5372
|
|
POST
|
Hi all - I am trying to retrieve features from an ArcGIS Server 10.31 map service using the ArcGIS Python API and insert them into PostgreSQL/PostGIS. For the geometry, both use WKT, but they don't have the same format. Here is a snippet of what I run to get the data: import arcgis
from arcgis.gis import GIS
from arcgis.features import FeatureLayer
from arcgis.geometry import Geometry
perimetersLAYER = FeatureLayer('https://<URL>/arcgis/rest/services/<service>/MapServer/1')
perimeters_feature_set = perimetersLAYER.query(where="objectid = 8605")
for feature in perimeters_feature_set.features:
print('\n\n')
for field in feature.fields:
print(field + ': ' + str(feature.get_value(field)))
geom = Geometry(feature.geometry)
print('geom.WKT: ' + str(geom.WKT))
The ArcGIS Python API Geometry response looks like this: MULTIPOLYGON (((-13645793.9305409509688616, 4645922.6947647286579013),
(-13645734.9949775058776140, 4645907.8913778141140938),
(-13645738.5948890540748835, 4645918.5636747097596526),
(-13645706.8243041206151247, 4645943.8052548961713910), [SNIP]
I'd like to pass this directly to a SQL insert with the PostGIS MULTIPOLYGON function, which looks like this: MULTIPOLYGON(((0 0 0,4 0 0,4 4 0,0 4 0,0 0 0),(1 1 0,2 1 0,2 2 0,1 2 0,1 1 0)),((-1 -1 0,-1 -2 0,-2 -2 0,-2 -1 0,-1 -1 0))) Note that the geometry formats are slightly different. In PostGIS, the x/y/z coords are space delimited and each vertex is comma delimited. The Esri geometry's x/y coords are comma delimited, and each vertex is wrapped in parentheses and also comma delimited. I can parse all the strings and munge the formats from one to another, but is there a way to automagically convert from one to another? It looks like Esri's WKT does not match the input PostGIS needs for its WKT functions. When I try the Geometry's WKB and JSON properties, it returns None, so I'm not sure where to go with that. Of course the geometry format is the minutia of my problem. The bigger picture issue is to find the shortest path from an ArcGIS Enterprise map service to PostGIS. If there's a better way, I'm all ears, though I'd like to keep it in python and run it on Linux. thanks!
... View more
10-24-2017
07:29 PM
|
0
|
6
|
2796
|
|
POST
|
Hi Kelly. We are on a site license, so I think it's called ArcGIS Online for Organizations. I access it at https://{orgname}.maps.arcgis.com/ and my user name is in the format of {user}_{ORGNAME} noting that the two letters in {ORGNAME} are capitalized. When I log in to AGOL manually, it sends me to a web page at my organization to authenticate, which is what I think you are referring to as an Enterprise Login. There, my user name that I enter does not have the _{ORGNAME} suffix. I've tried a bunch of combinations of which URL to send to, variations on my user name, referer, etc. I hope this provides some more info that is useful. Any help is appreciated.
... View more
10-15-2017
06:03 PM
|
0
|
2
|
5372
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-10-2018 05:54 PM | |
| 1 | 11-17-2017 05:15 PM | |
| 1 | 02-08-2018 10:08 AM | |
| 1 | 02-15-2018 11:55 AM | |
| 1 | 06-29-2018 12:12 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:24 AM
|