|
POST
|
There is a nice post by Katie Cullen: How to update the Max Record Count of a Feature Service in REST that you might want to look at. Kind regards, Xander
... View more
11-16-2014
06:14 PM
|
1
|
0
|
2351
|
|
POST
|
Maybe you find the necessary information in this website: Python Example - Google Cloud Storage — Google Cloud Platform Kind regards, Xander
... View more
11-16-2014
06:06 PM
|
0
|
0
|
2083
|
|
POST
|
Hi James, Great to hear that you can advance with the previous explanation, but to complete it, I'll continue with... 4) In case you have done a zonal statistics for the semi circle, you will have a count columns which holds the number of cells inside each semi circle. With your "histogram" (frequency distribution), you can sort the data on height (ascending order) and calculate the percentage for each record (remember: area = count * cellsize^2). Next calculate the cumulative area (or percentage) and determine the value that corresponds to the percentage you're looking for (e.g. the 5% you were mentioning). How to do this with some python code, please refer to this thread: https://community.esri.com/message/391944#392135 5) for determining the flood plain you should not take the amount of pixels that are beneath the flood level. Only those pixels that can be reached should be taken into account. An example thread were this is discussed you can find here: Re: Determine Floodplain: Based on known flood level Good luck with your analysis. Kind regards, Xander
... View more
11-16-2014
05:50 PM
|
0
|
0
|
1658
|
|
POST
|
Hi James, Although you provided a lot of information, I still miss some details on your software to know what functionality you have available: - what version of ArcGIS are you using? - what license level do you have (arcview-basic, arceditor-standard or arcinfo-advanced)? - which extensions (Spatial Analyst, 3D Analyst) do you have available? 1) The import depends on your data format. Did you get .TXT files with XYZ values or did you download LAS files (this would be easiest) 2) To create a buffer you can read this help topic: ArcGIS Help (10.2, 10.2.1, and 10.2.2) To create a semi circle, you will probably have to edit the buffers and split them. ArcGIS Help (10.2, 10.2.1, and 10.2.2) Normally your buffers will have a field OBJECTID which has a unique value for each feature. You can use that as the unique identifier or add a field and fill them with the unique values you want. 3) The zonal statistics will provide information of a statistic per zone. This will not create the histogram. When a Raster is of type integer, you will have a histogram, but it will contain a histogram for all the study areas in your raster. To convert a floating raster to integer, use this tool: ArcGIS Help (10.2, 10.2.1, and 10.2.2) You can use the combine tool to create a raster holding the combination of zones and integer values from your LiDAR: ArcGIS Help (10.2, 10.2.1, and 10.2.2) The result is a table that allows you to calculate the stats your looking for. Instead of translating the raster to integer you could reclassify the raster in the ranges you want. This simplifies the result. ArcGIS Help (10.2, 10.2.1, and 10.2.2) I leave it for the moment to this, since I gtg... Kind regards, Xander
... View more
11-16-2014
02:00 PM
|
0
|
2
|
1658
|
|
POST
|
What you can do is to create a Raster Catalog (in Data Management Tools\Raster\Raster Catalog), then use the Workspace to Raster Catalog tool, and after that the raster catalog can be exported (export footprints, in context sensitive menu of the raster catalog in your TOC). This will create a polygon featureclass of the extents. Kind regards, Xander
... View more
11-15-2014
08:39 PM
|
0
|
0
|
1695
|
|
POST
|
ArcGIS Team Python posted a nice example with python to add a rank field (but don't use the category field): Ranking field values | ArcPy Café This post also shows a python solution for your problem: https://community.esri.com/message/128653#128653 Kind regards, Xander
... View more
11-15-2014
08:02 PM
|
1
|
1
|
970
|
|
POST
|
You could use some Python code to retrieve the JSON from Google Docs and join it using python (arcpy) to a featureclass. And yes, you should probably move this to a different place, since installation support has nothing to do with your question. Kind regards, Xander
... View more
11-14-2014
07:06 PM
|
0
|
0
|
2083
|
|
POST
|
To send a geometry, the geometry has to be specified in JSON format. As from ArcGIS 10.1 SP1 you can use the json token SHAPE@JSON on a feature during a search cursor. In ArcGIS 10.1 the arcpy.Polygon object has a property called "JSON" (arcpy.Polygon.JSON) which will do this for you. In ArcGIS 10.0 you have to go a little deeper and use the private property arcpy.Polygon.__geo_interface__ Now, what might be a challenge, is (or was) the fact that the Python JSON flavor is not the same flavor ArcGIS Server consumes. This means that you will have to do some manual conversion to obtain the correct format.
# let's say you have an arcpy.Polygon object. No get the JSON:
polygonJSON = polygon.__geo_interface__ # 10.0 syntax
# convert this to the correct JSON format for ArcGIS Server
data_string = str(polygonJSON)
data_string = data_string.replace("'type': 'Polygon', 'coordinates':","'rings':")
data_string = data_string.replace("(", "[")
data_string = data_string.replace(")", "]")
You can use the urllib library to encode all your parameters like this:
params = urllib.urlencode({'f': 'json', 'geometryType': 'esriGeometryPolygon',
'geometry': data_string, 'spatialRel': 'esriSpatialRelIntersects',
'where': '1=1', 'outFields': '', 'returnGeometry': 'true'})
If you know the service URL to query: http://someserver/ArcGIS/rest/services/aFolder/sService/MapServer/0 This actual url to connect to will be http://someserver/ArcGIS/rest/services/aFolder/sService/MapServer/0/query To force the POST request you will have to do the following:
# assuming this query URL
queryURL = "http://someserver/ArcGIS/rest/services/aFolder/sService/MapServer/0/query"
# use the request method on the urllib2 library
req = urllib2.Request(queryURL, params) # forces POST request
# get the response
response = urllib2.urlopen(req)
The response will be file based GeoJSON. To create a JSON object you will need to do the following:
# assuming this query URL
jsonResult = json.load(response)
Next, process the JSON with the results... Kind regards, Xander
... View more
11-14-2014
06:21 PM
|
0
|
0
|
1992
|
|
POST
|
If you are the administrator of the service, you will probably have access to the data. In that case you could use something like the ArcGIS Open Data Help | ArcGIS which has feature to allow users to download the data. In case you are not the owner of the data, you can use the REST API to query the data. A simple way to do this is using some Python code. A small example can be found here: https://community.esri.com/message/436087#436158 Please note the services by default are configured to return no more than 1000 features. If you are not the administrator of the service, you will have to do multiple requests on the REST service to obtain all features. You can provide the REST query with a geometry to restrict the results to that geometry. Kind regards, Xander
... View more
11-14-2014
06:09 PM
|
0
|
0
|
916
|
|
POST
|
I suppose you would have to create a line from the GPS locations using the Points To Line tool (in Data Management Tools/Features). Next you would probably have to create a route (Linear Referencing Tools/Create Routes) using the time as measurements, followed by Make Route Event Layer (also in Linear Referencing Tools) to convert your samples to locations. Your samples should have the same unit of measurement (time, in seconds or minutes?) to make it work. I myself, would probably use some Python coding to make it work... Kind regards, Xander
... View more
11-14-2014
12:29 PM
|
0
|
0
|
835
|
|
POST
|
The raster cells are always oriented horizontally and vertically (since they are always rows and columns). The may display rotated if the projection of your data frame is different from the projection of your raster. In ArcMap you can create different formats of data. An Esri grid is normally the result when writing to a folder. A geodatabase raster is the result if you write to a (file)geodatabase. If you use the default geodatabase as output location you will be created rasters inside a file geodatabase. If the focal statistics does not work for you, you may consider creating polygons for the neighborhoods you want to use and do a zonal statistics instead. Kind regards, Xander
... View more
11-14-2014
08:55 AM
|
3
|
2
|
3939
|
|
POST
|
Did you try Project Raster in Data Management? See: ArcGIS Help (10.2, 10.2.1, and 10.2.2) This will create a raster with projected coordinates. Kind regards, Xander
... View more
11-14-2014
08:46 AM
|
0
|
0
|
1214
|
|
DOC
|
Added an example on working with domains. Pieter Geert van den Beukel, next time it might be better to post your question as a thread. This way you can get more valuable answers which are more directed to your specific needs. Kind regards, Xander
... View more
11-14-2014
07:59 AM
|
1
|
0
|
18514
|
|
DOC
|
Hi Pierter Geert, I can include some code sample to work with domains in Python, but it would require the use of the data access module. Since you stated "row.getValue()", you may be working with 10.0, the version before the da module was released. Do you have access to the da module? If so, my recomendation would be to switch to the da cursors, which are much faster. I will add some code sample to retrieve the domain description rather than the code. Kind regards, Xander
... View more
11-14-2014
04:08 AM
|
0
|
0
|
18514
|
|
POST
|
While looking for some problems I've encountered I came across this thread. Not sure if anyone is still "listening" to this thread, but thought I would post some code I have to list subtypes and correnponding default field values (and releted domains in the subtype). Maybe it is useful for someone...
def main():
# import arceditor
import arcpy
import os
lst_amb = ["DLLO 9.3.1", "TEST 9.3.1", "PROD 9.3.1",
"DLLO 10.1", "TEST 10.1", "PROD 10.1"]
# dictionary with connection files
dct_conn = {"DLLO 9.3.1":r"C:\Users\xbakker\AppData\Roaming\ESRI\Desktop10.1\ArcCatalog\Desarrollo 9.3.1 (GEOGENESIS).sde",
"TEST 9.3.1": r"C:\Users\xbakker\AppData\Roaming\ESRI\Desktop10.1\ArcCatalog\Pruebas 9.3.1 (GEOGENESIS).sde",
"PROD 9.3.1": r"C:\Users\xbakker\AppData\Roaming\ESRI\Desktop10.1\ArcCatalog\Produccion 9.3.1 (GEOGENESIS).sde",
"DLLO 10.1": r"C:\Users\xbakker\AppData\Roaming\ESRI\Desktop10.1\ArcCatalog\Desarrollo 10.1.sde",
"TEST 10.1": r"C:\Users\xbakker\AppData\Roaming\ESRI\Desktop10.1\ArcCatalog\Pruebas 10.1.sde",
"PROD 10.1": r"C:\Users\xbakker\AppData\Roaming\ESRI\Desktop10.1\ArcCatalog\Produccion 10.1.sde"}
# set encoding to utf-8
import sys
reload(sys)
print sys.getdefaultencoding()
def_enc = sys.getdefaultencoding()
sys.setdefaultencoding('utf8')
# format of TXT report with subtypes
report = r"D:\Xander\Genesis\Domains\report_subtypes_v4.txt"
with open(report, "w") as f:
f.write("Database\tDataset\tFeatureClass\tSubtypeField\tSubtypeCode\tSubtypeName\tIsDefaultValue\tFieldName\tFieldDefaultValue\tFieldDomain\n")
# loop through databases
for amb in lst_amb:
ws = dct_conn[amb]
arcpy.env.workspace = ws
lst_fds = arcpy.ListDatasets()
# loop through feature datasets
for fds in lst_fds:
fcs = arcpy.ListFeatureClasses(feature_dataset=fds)
if len(fcs) != 0:
# loop through each featureclass en current feature dataset
for fc in fcs:
try:
# list subtypes
subtypes = arcpy.da.ListSubtypes(os.path.join(ws,fds,fc))
# colect info on subtype
for stcode, stdict in subtypes.iteritems():
if 'Default' in stdict:
IsDefaultValue = stdict['Default']
else:
IsDefaultValue = ""
if 'Name' in stdict:
SubtypeName = stdict['Name']
else:
SubtypeName = ""
if 'SubtypeField' in stdict:
SubtypeField = stdict['SubtypeField']
if SubtypeField != None and SubtypeField != "":
# list default field value and field details (like related domain)
if 'FieldValues' in stdict:
fields = stdict['FieldValues']
for fieldname, fieldvals in fields.iteritems():
FieldDefaultValue = fieldvals[0]
if not fieldvals[1] is None:
domainname = fieldvals[1].name
else:
domainname = ""
f.write('{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}\n'.format(
amb, fds, fc, SubtypeField, stcode, SubtypeName, IsDefaultValue,
fieldname, FieldDefaultValue, domainname))
except:
f.write('{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}\n'.format(
amb, fds, fc, "Error", -1, "Error", "Error",
"Error", -1, "Error"))
# restore default settings
sys.setdefaultencoding(def_enc)
if __name__ == '__main__':
main()
Kind regards, Xander
... View more
11-13-2014
05:53 AM
|
2
|
0
|
1991
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-09-2020 09:26 AM | |
| 6 | 12-20-2019 08:41 AM | |
| 1 | 01-21-2020 07:21 AM | |
| 2 | 01-30-2020 12:46 PM | |
| 1 | 05-30-2019 08:24 AM |
| Online Status |
Offline
|
| Date Last Visited |
a week ago
|