|
POST
|
Hi James, Check out the attached toolbox and python script. Please note this has had very limited testing so you should run this using a copy of your data in a file geodatabase and verify that the results are valid. The tool uses road and footpath layers and a search distance as inputs. Also there is the option to specify a workspace if you want to keen the analysis layers used in the calculations. Basically the script creates perpendicular lines from the mid-point of each road feature, these lines will extend out to your search distance value. The script then tests if the line intersects a footpath to the right or left of the road line and creates summary statistics that are added to the road layer. These are two new fields: PathCount - this should be either 1 or 2 (unless your search distances are too large) PathSide - Right, Left or Both You can then calculate your percentage based on the number of PathSide = 'Both' records compared to your total road count. Hope this helps. Owen Spatial XP
... View more
08-21-2014
02:59 PM
|
0
|
2
|
1317
|
|
POST
|
A note on the CreateObject help page suggests using the Extent class directly. Try changing line 160 from:
# myExtent = arcpy.CreateObject('Extent', xMin, yMin, xMax, yMax)
myExtent = arcpy.Extent(xMin, yMin, xMax, yMax)
... View more
08-20-2014
04:39 PM
|
2
|
1
|
1148
|
|
POST
|
I think the PictureFillSymbol was designed for an entirely different purpose: Fill symbols are used to draw polygon features on the graphics layer. To use the PictureFillSymbol you would need to create a polygon to fill with the image first. You would then need to move, rotate, scale the polygon as well as the PictureFillSymbol to get the effect that you are after. If you are just changing the properties of the PictureFillSymbol then the location of the polygon feature remains the same. Using the HTML5 canvas may be a better option but you would need to implement a lot of the move/rotate/scale logic - Canvas with raster layer | ArcGIS API for JavaScript
... View more
08-20-2014
04:26 PM
|
1
|
1
|
896
|
|
POST
|
Joe's link contains the answer. If your local county created the file geodatabase in a recent version of ArcGIS then the geodatabase version will not be readable. You could ask your local county if they could create a 9.3 version of the geodatabase using this process: arcgis 10.0 - How do you create 9.3 version of a geodatabase in ArcMap 10? - Geographic Information Systems Stack Exchan…
... View more
08-20-2014
03:50 PM
|
0
|
0
|
959
|
|
POST
|
Check that you have allowed the ESRI sample server URL in your proxy configuration file. The following example allows access to 2 servers:
<?xml version="1.0" encoding="utf-8" ?>
<ProxyConfig allowedReferers="*"
logFile="proxy_log.log"
logLevel="INFO"
mustMatch="true">
<serverUrls>
<serverUrl url="http://services.arcgisonline.com" matchAll="true"/>
<serverUrl url="http://sampleserver1.arcgisonline.com" matchAll="true"/>
</serverUrls>
</ProxyConfig>
Trying to access any server not in this list should result in a 403 error from your proxy. Owen Spatial XP
... View more
08-20-2014
03:33 PM
|
0
|
2
|
1800
|
|
POST
|
Kakadu - You get a real sense of time standing still and the rock art is fantastic:
... View more
08-20-2014
12:54 AM
|
2
|
1
|
1475
|
|
POST
|
Using the REST API the token is added to the request URL. However, in the JS API the RouteTask and RouteParameters do not have a property for assigning a token to the request. Check out the Token based authentication section on the secure services help section. You may need to use the Identity Manager so check out the samples.
... View more
08-20-2014
12:45 AM
|
0
|
0
|
725
|
|
POST
|
One thing to be aware of is that server GP Tools do not have as many data types available as the desktop tools. Check out this ArcGIS Help 10.1 page for a list of REST geoprocessing task data types. There does not appear to be a data type supporting TINs.
... View more
08-19-2014
04:49 PM
|
0
|
1
|
1518
|
|
POST
|
Totally agree with Dan. The Mark Lutz Learning Python (4th edition) has been my primary python reference for some time.
... View more
08-19-2014
03:52 PM
|
0
|
0
|
3596
|
|
POST
|
This gets back to my original point that ideal solution would be if the query.geometry property took an array as input. This would mean a single round trip to the server. To limit round-trips and minimize code, using the geometry service first and then doing a single query task is probably as good as it gets at the moment. In practice your server would have to be very busy to notice much of a performance difference unless you had a very large number of polygons. If the user is manually selecting polygons then this should not happen very often.
... View more
08-19-2014
03:38 PM
|
0
|
0
|
3069
|
|
POST
|
I haven't really worked with collector. If you have control over the data you could run a scheduled process each night that calculates a new AgeInDays (long) field. This way your definition query is against a simple number value. Something like: Seems to be a lot of pain for a simple task but it should work.
... View more
08-19-2014
02:22 AM
|
1
|
0
|
1194
|
|
POST
|
Just a thought - the definition query may be specific to SQL Server due to the SYSDATETIME() function. This would work when viewing data online but the SYSDATETIME() function may not be available in database that the Collector app uses locally on a device.
... View more
08-19-2014
01:32 AM
|
0
|
2
|
1194
|
|
POST
|
The ideal solution would be if the query.geometry property took an array as input. However the documentation seems to indicate that it is only a single geometry. You could look into promises - check out the last example on this page: dojo/promise/all — The Dojo Toolkit - Reference Guide The trick would be creating the Object that you provide as a parameter dynamically using your multiple polygons. Possibly something like this untested code:
// 1. make sure to add required modules ("dojo/promise/all", "dojo/Deferred", etc )
// 2. dynamically build object for dojo/promise/all parameter
queries = {};
for (var ai = 0; ai < multiplePolygons.length; ai++) {
var qryName = "qry" + ai;
queries[qryName] = queryPolygon(multiplePolygons[ai].areaGeometry);
}
// 3. return a deferred object from each query
function queryPolygon(geom) {
var deferred = new Deferred();
var query = new Query();
var queryTask = new QueryTask(pointUrl);
query.geometry = geom;
query.returnGeometry = true;
query.outFields = ["*"];
queryTask.execute(query, function (results) {
deferred.resolve(results);
});
return deferred.promise;
};
// 4. use all to process each polygon then respond to final results
all({queries}).then(function(results){
// process your final results here
console.log("All Results: ", results);
});
Please note that I haven't used promises/deferred in dojo, but I have had great success in AngularJS using them. Owen Spatial XP
... View more
08-19-2014
01:24 AM
|
0
|
0
|
3069
|
|
POST
|
So in-essence, whenever a user clicks the map and has this process active, what would this calculation look like knowing the XY from the mouse click? It is important that the size of the new polygon feature matches the map (size = 10 Feet by 20 Feet). Thoughts? You can do this using a python script in a custom toolbox.
import arcpy
# Get input parameters - points and target feature class
pts = arcpy.GetParameter(0)
dw = float(arcpy.GetParameterAsText(1))/2
dh = float(arcpy.GetParameterAsText(2))/2
units = arcpy.GetParameterAsText(3)
fc = arcpy.GetParameterAsText(4)
if units == "Feet":
dw = dw/3.2808399
dh = dh/3.2808399
# create new polygons from points
cursor = arcpy.da.InsertCursor(fc, ("SHAPE@"))
with arcpy.da.SearchCursor(pts,["SHAPE@XY"]) as newpts:
for pt in newpts:
x, y = pt[0]
# Create polygon geometry from point
array = arcpy.Array([arcpy.Point(x - dw, y + dh),
arcpy.Point(x + dw, y + dh),
arcpy.Point(x + dw, y - dh),
arcpy.Point(x - dw, y - dh),
arcpy.Point(x - dw, y + dh)])
poly = arcpy.Polygon(array)
cursor.insertRow((poly,))
del cursor
The script takes the following inputs: User Defined Points (Feature Set) Width (size in units) Height (size in units) Units (Meters or Feet) Target Feature Class (new polygons are created in this) See this zipped example with toolbox, script and template point feature class (required for feature set parameter). Note that this example uses the WGS 1984 Web Mercator (auxiliary sphere) projection – so you should use this in your target feature class as well. Owen Spatial XP
... View more
08-18-2014
10:31 PM
|
2
|
2
|
3488
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 10-07-2014 06:13 PM | |
| 1 | 08-25-2015 02:04 AM | |
| 1 | 10-07-2014 03:54 PM | |
| 1 | 08-07-2014 09:19 PM | |
| 1 | 03-04-2015 02:02 PM |
| Online Status |
Offline
|
| Date Last Visited |
07-21-2021
06:32 PM
|