|
POST
|
Below my suggestion, never implemented this scenario personally before just a possible solution Cast your polygon to ISegmentCollection Iterate through each segment Use ReturnTurnDirection ArcObjects 10 .NET SDK Help on your segments If No Turn returned ArcObjects 10 .NET SDK Help then sum your segment length Whenever there is a turn break your summation and restart At the end you loop you would have got your dimensions.
... View more
08-19-2014
06:36 AM
|
1
|
0
|
1749
|
|
POST
|
Hi Frauke, Hope this is what you wanted. As you can see I have saved your csv file as an excel spreadsheet. Below are the assumptions for the code. You excel columns are structured as below. Once a column ceases to have data, no further columns will have data.
import arcpy
import os
import arcgisscripting
gp = arcgisscripting.create()
def Message(sMsg):
print sMsg
gp.AddMessage(sMsg)
# Define the feature class
table = "C:\Users\deenr\Desktop\Nitrate.xlsx\Sheet1$"
fields = arcpy.ListFields(table)
fieldCnt = len(fields)
with arcpy.da.SearchCursor(table, ("*")) as cursor:
for row in cursor:
msg = ""
cellNonEmpty = ""
idx = 0
for cell in row:
if idx == 0:
msg += "Latitude:" + str(cell)
elif idx == 1:
msg += " Longitude:" + str(cell)
elif fields[idx].name == "0":
msg += " Measure at surface is " + str(cell)
elif cell is None:
msg += " Measure at Depth " + fields[idx - 1].name + " is " + str(cellNonEmpty)
break;
elif idx == fieldCnt - 1:
msg += " Measure at Depth " + fields[idx].name + " is " + str(cell)
cellNonEmpty = cell
idx += 1
Message(msg)
... View more
08-19-2014
05:16 AM
|
2
|
1
|
4920
|
|
POST
|
Yes dev, response.map is an esri/map object and you should be able to inject the code for your custom layer in the same way as i have done.
... View more
08-19-2014
12:27 AM
|
0
|
1
|
1567
|
|
POST
|
Go to Content -> Document (Next to all content and blogs), you'' find maarten's upload there.
... View more
08-18-2014
08:15 AM
|
1
|
1
|
841
|
|
POST
|
Hi Miri, IE strictly follows the URL length of 2048 characters. if you have a request which is longer than 2048 you need to use POST method, for which you need proxyurl. What is your client's security concern about using proxy page. If you can't convince your client to use proxy page and still want to use IE, then you may have to build a post request something like below (NOT RECOMMENDED) Also move this discussion to ArcGIS API for JavaScript for better help PS: Don't know how chrome is toggling between get and post request, if you find out how do post back.
... View more
08-18-2014
08:13 AM
|
0
|
1
|
506
|
|
POST
|
When creating your new feature class you should import the fields from your existing feature class. And of course when appending your features Schema Type should be NO_TEST. Please mark this discussion as answered, I'm sure there are other people who might have similar issues with linear referencing.
... View more
08-18-2014
07:42 AM
|
0
|
0
|
1874
|
|
POST
|
You may want to look at SQL_Clause of ArcGIS Help 10.1. Set your where clause to depth > 0 and order by depth ASC. First row would be the data that is not zero. (Tweak it depending on your data)
import arcpy
import os
import arcgisscripting
gp = arcgisscripting.create()
def Message(sMsg):
print sMsg
gp.AddMessage(sMsg)
# Define the feature class
fc = str(sys.argv[1])
with arcpy.da.SearchCursor(fc, ("ORIG_FID", "OBJECTID"),
"OBJECTID < 10",
"",
False,
("TOP 1", "ORDER BY OBJECTID DESC")) as cursor:
for row in cursor:
Message(row[1])
... View more
08-18-2014
07:18 AM
|
0
|
0
|
4920
|
|
POST
|
Hi Maarten, Found your 1 meter segment. This is what i did. Created another feature class with M Tolerance 0.0001 Appended your features to my new feature class Created a route event layer. There it is your 1 meter segment.
... View more
08-18-2014
06:41 AM
|
1
|
3
|
6138
|
|
POST
|
Can try using Upload file in forum? it'll be next to your profile icon or uploading in any public file sharing web site.
... View more
08-18-2014
05:30 AM
|
0
|
5
|
1874
|
|
POST
|
On thing that quickly pops up is, you can create a Class Breaks Table for every degree value containing 360 rows or every half degree containing 720 rows, depending on your accuracy requirement. will post back if I can think of something else.
... View more
08-18-2014
05:27 AM
|
0
|
1
|
1525
|
|
POST
|
Hi Dev, The best approach would be to add your feature layer or CSV files to a map and share the map publicly. This way everything you need comes in the map and you can use this map directly in the basic viewer. If your requirement is something like Felix, adding custom layer to your web map then may be below approach will help. You'll have a to create a function createMyLayer and hook it up on web map create event (line 29 below) Below code was tested in sandbox.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"/>
<title>Web Map</title>
<link rel="stylesheet" href="http://js.arcgis.com/3.10/js/dojo/dijit/themes/tundra/tundra.css" />
<link rel="stylesheet" href="http://js.arcgis.com/3.10/js/esri/css/esri.css" />
<style>
html, body { height: 100%; width: 100%; margin: 0; padding: 0; }
</style>
<script src="http://js.arcgis.com/3.10/"></script>
<script>
require(["dojo/ready", "dojo/on", "dojo/dom", "dijit/registry", "dojo/dom-construct", "dojo/parser", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", "esri/map", "esri/arcgis/utils", "esri/domUtils", "dojo/fx", "dojo/_base/fx", "esri/layers/GraphicsLayer", "esri/InfoTemplate", "esri/geometry/Point", "esri/symbols/SimpleMarkerSymbol", "esri/Color", "esri/graphic", "esri/SpatialReference", "dojo/dom-attr", "dojo/io/script", "dojo/_base/array" ], function(
ready, on, dom, registry, domConstruct, parser, BorderContainer, ContentPane, Map, arcgisUtils, domUtils, coreFx, baseFx, GraphicsLayer, InfoTemplate, Point, SimpleMarkerSymbol, Color, Graphic, SpatialReference, domAttr, ioScript, array ) {
ready(function() {
initMap();
function initMap() {
var deferred = arcgisUtils.createMap(("d94dcdbe78e141c2b2d3a91d5ca8b9c9"), "mainWindow");
deferred.then(function(response){
var map = response.map;
createMyLayer(map);
});
}
function createMyLayer(map){
var gl = new GraphicsLayer({ id: "weather" });
map.addLayer(gl);
ioScript.get({
url: "http://openweathermap.org/data/2.1/find/city",
content: {
lat: 48,
lon:2,
cnt:20
}
, callbackParamName: "callback"
, load: function (data) {
var response = data.list;
array.forEach(response, function (loc){
gl.add(new Graphic(
new Point(loc.coord.lon,loc.coord.lat, new SpatialReference({wkid:4326})),
new SimpleMarkerSymbol().setStyle(SimpleMarkerSymbol.STYLE_SQUARE).setColor(new Color([255,0,0,0.5]))
,{"name": loc.name, "temp":loc.main.temp,"humidity":loc.main.humidity}
,new InfoTemplate("Weather","Location Name: ${name} <br/>Temperature: ${temp} <br/>Humidity:${humidity}")
));
});
}
, error: function(error) {
alert("errro");
}
});
}
});
});
</script>
</head>
<body class="tundra">
<div id="mainWindow">
</div>
</body>
</html>
... View more
08-18-2014
05:20 AM
|
1
|
3
|
1567
|
|
POST
|
Hi Maarten, This is strange, Provided you are getting 'zero length extent' error, I would have expected Richard's suggestions would have fixed your issue. Can you update your line feature with attributes stripped out, that will help in identifying or reproducing the issue rather than speculating.
... View more
08-18-2014
01:39 AM
|
0
|
8
|
1874
|
|
POST
|
Hi Tim, On the fly M:N relate works just fine. The steps you followed will establish M:N relate if there is an M:N cardinality between your table attributes. You don't have to specify the cardinality explicitly as you would when you create a relationship class. Refer screenshot of M:N relate i created on the fly.
... View more
08-16-2014
04:16 AM
|
1
|
0
|
828
|
|
POST
|
Use feature vertices to point tool for converting all vertices of your polyline to point feature class ArcGIS Desktop Use Add XY Coordinates tool ArcGIS Desktop. This will add XY coordinates as well as Z values. Use search cursor to iterate through point FC created in step 2. Use ORIG_FID on the point feature class to search your polyline, Use Point FC shape as point input for measureOnLine method. You got your chainage here. Update your Point feature with chainage. Alternatively: Use Create routes tool to create an M aware polyline from your Z polyline. ArcGIS Help 10.1, set measure source as length. Now your polyline has both Z and M (which is distance from start of the line) Use feature vertices to point tool for converting all vertices of your polyline to point feature class ArcGIS Desktop Use Add XY Coordinates tool ArcGIS Desktop. This will add XY coordinates as well as Z and M values. You got what you wanted, all these can be done through model builder and you export it out as python script if you want.
... View more
08-15-2014
08:34 AM
|
0
|
0
|
2889
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-31-2014 06:04 AM | |
| 1 | 09-25-2014 06:03 PM | |
| 1 | 09-16-2014 06:15 PM | |
| 1 | 10-08-2014 03:50 AM | |
| 1 | 08-25-2014 08:33 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:24 AM
|