POST
|
Some additional information, if I load data from this service: Sync/WildfireSync (FeatureServer) the completion-block can be reached and the runtime gdb is successfully created. Also, if I try to load the data from my service with the code from the OfflineFeatureEditingSample, from the function "switchToLiveData" which copied in my application, the features are downloaded and displayed as live data in the map.
... View more
07-24-2015
01:33 AM
|
0
|
1
|
290
|
POST
|
Hi Divesh, the service runs on ArcGIS Server v10.3. It is hosted within ArcGIS Online.
... View more
07-22-2015
11:57 PM
|
0
|
0
|
290
|
POST
|
Hi there, An AGSGDBSyncTask crashes after it has downloaded all features but right before it enters the completion block. The stack trace right before the crash happens looks like this: StackTrace: ( 0 SOF-Land 0x00000001091eeece __33-[mainViewController viewDidLoad]_block_invoke + 94 1 SOF-Land 0x00000001093ec181 __67-[AGSGDBSyncTask generateGeodatabaseWithUtility:status:completion:]_block_invoke + 49 2 SOF-Land 0x000000010941fbab __56-[AGSResumableTaskJobUtility privateFetchResultWithUrl:]_block_invoke344 + 347 3 SOF-Land 0x000000010933c54e __40-[AGSRequestOperation kickoffConnection]_block_invoke + 222 4 libdispatch.dylib 0x000000010e4b5186 _dispatch_call_block_and_release + 12 5 libdispatch.dylib 0x000000010e4d4614 _dispatch_client_callout + 8 6 libdispatch.dylib 0x000000010e4bca1c _dispatch_main_queue_callback_4CF + 1664 7 CoreFoundation 0x000000010d8931f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9 8 CoreFoundation 0x000000010d854dcb __CFRunLoopRun + 2043 9 CoreFoundation 0x000000010d854366 CFRunLoopRunSpecific + 470 10 GraphicsServices 0x000000011045ea3e GSEventRunModal + 161 11 UIKit 0x000000010bf0c900 UIApplicationMain + 1282 12 SOF-Land 0x00000001091e37bf main + 111 13 libdyld.dylib 0x000000010e508145 start + 1 14 ??? 0x0000000000000001 0x0 + 1 Any advice on this?
... View more
07-20-2015
06:03 AM
|
0
|
4
|
3212
|
POST
|
Hi there, Currently I'm working on an addin which should be used to query a certain attribute within a MapServerLayer which is loaded in ArcMap. My present approach is to use IIdentify, but no matter what the result returned is null. In the SDK reference there is the hint, that MapServerIdentifySublayer or -QuerySublayer should be used, but I honestly have no clue how to obtain a reference for this. I also checked if the Object in question implements the appropriate interfaces, that is the case.
protected override void OnMouseDown(ESRI.ArcGIS.Desktop.AddIns.Tool.MouseEventArgs arg)
{
IPoint point = new PointClass();
point = mxApplication.Display.DisplayTransformation.ToMapPoint(arg.X, arg.Y);
IMapServerSublayer msl = null; //new MapServerLayerClass();
MapServerIdentifySublayer misl;
IIdentify layerIdent = null;
for (int i = 0; i < layerArray.Count; i++)
{
if (layerArray is IMapServerSublayer)
{
msl = layerArray as IMapServerSublayer; //Here something is returned, what seems to be right.
misl = layerArray as MapServerIdentifySublayer; // This cast result in "null"
layerIdent = msl as IIdentify;
}
}
if (layerIdent is IIdentify)
{
IArray array = layerIdent.Identify(point);
for (int j = 0; j < array.Count; j++)
{
System.Object arrayObject = array.get_Element(j);
IRowIdentifyObject rowIdentifyObject = array.get_Element(j) as IRowIdentifyObject;
IFeature featureIdent = rowIdentifyObject.Row as IFeature;
for (int k = 0; k < featureIdent.Fields.FieldCount; k++)
{
if (featureIdent.Fields.Field .Name == "dbo_extViewActive_IncidentID")
{
MessageBox.Show("Die IncidentID lautet: " + featureIdent.Fields.Field .DefaultValue);
}
}
}
}
else
{
MessageBox.Show("Identify kann nicht ausgeführt werden");
}
}
protected override void OnUpdate()
{
Enabled = ArcMap.Application != null;
}
}
Regards, Dominik
... View more
07-21-2011
10:27 PM
|
0
|
0
|
577
|
POST
|
Just in case, someone is facing the same problem, the solution is to use JDOM only. Since the use of JDOM and XPATH results, for unknown reasons, in an untraceable error (ArcMap and the addin continue to run and you also can choose another file to parse, but you won't get any results!). So you have to use JDOM only! The resulting code is rather intricate:
private void LoadGPXTracks(File importFile) throws JDOMException, IOException, ParseException
{
//XML-Datei einladen
Document gpxDoc = new SAXBuilder().build(importFile);
Namespace gpx_ns = Namespace.getNamespace("http://www.topografix.com/GPX/1/1");
Element gpx_root = gpxDoc.getRootElement();
int j = 0;
for (Iterator it = gpx_root.getChildren("trk", gpx_ns).iterator(); it.hasNext();)
{
Element trk = (Element) it.next();
if("trk".equals(trk.getName()))
{
IFeature feature = _featureClassTracks.createFeature();
int contractorFieldIndex = _featureClassTracks.findField("objname");
if (contractorFieldIndex >= 0)
feature.setValue(contractorFieldIndex, trk.getChildText("name", gpx_ns).toString());
contractorFieldIndex = _featureClassTracks.findField("kern_id");
if (contractorFieldIndex >= 0)
feature.setValue(contractorFieldIndex, j++);
IGeometryBridge2 pGeoBrg = new GeometryEnvironment();
IPointCollection4 pPointColl = new Polyline();
//List<?> trackSegsInfo = XPath.selectNodes(gpxDoc, "/gpx/trk/trkseg/");
int i = 0;
Element trk_seg = null;
for (Iterator it_seg = trk.getChildren("trkseg", gpx_ns).iterator(); it_seg.hasNext();)
{
trk_seg = (Element) it_seg.next();
for (Iterator trk_pt_count = trk_seg.getChildren("trkpt", gpx_ns).iterator(); trk_pt_count.hasNext();)
{
Element trk_pt_count_elem = (Element) trk_pt_count.next();
i++;
}
}
Point point_help = new Point();
IPoint aPointBuffer = point_help;
IPoint[] aPointBufferArray = new Point;
i = 0;
for (Iterator it_pt = trk_seg.getChildren("trkpt", gpx_ns).iterator(); it_pt.hasNext();)
{
Element trk_pt = (Element) it_pt.next();
String longitude = null;
String latitude = null;
Iterator it_trk_pt_attr = trk_pt.getAttributes().iterator(); it_trk_pt_attr.hasNext();
Attribute trk_pt_attr = (Attribute) it_trk_pt_attr.next();
latitude = trk_pt_attr.getValue().toString();
trk_pt_attr = (Attribute) it_trk_pt_attr.next();
longitude = trk_pt_attr.getValue().toString();
String elevation = trk_pt.getChildText("ele", gpx_ns).toString();
String time = trk_pt.getChildText("time", gpx_ns).toString();
Point point = CreatePoint(longitude, latitude, elevation != null ? elevation : "0");
aPointBuffer = point;
aPointBufferArray = aPointBuffer;
IFeature trkPntFeature = _featureClassTrackPoints.createFeature();
trkPntFeature.setShapeByRef(point);
if (time != null)
{
DateFormat format = new SimpleDateFormat("yyyy'-'MM'-'dd'T'hh:mm:ss");
Date d = format.parse(time);
trkPntFeature.setValue(trkPntFeature.getFields().findField("time"), d);
}
trkPntFeature.store();
i++;
}
pGeoBrg.setPoints(pPointColl, aPointBufferArray);
feature.setShapeByRef((IPolyline) pPointColl);
feature.store();
}
it.next();
}
}
Regards, Dominik
... View more
05-19-2011
10:53 PM
|
0
|
0
|
164
|
POST
|
Hi, Currently I'm working on an addin which should import data from a .gpx-file. To achieve this I want to use JDOM with XPath, but when I get to parse the data, nothing ever happens. My addin still runs and eclipse doesn't show any kind of errors. The relevant line of code is: Element testing = (Element) XPath.selectSingleNode(gpxDoc, "/gpx/trk/@*"); Is there anybody, who has faced the same kind of problem? Regards, Dominik
... View more
05-17-2011
06:09 AM
|
0
|
1
|
1859
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|