|
POST
|
No unfortunately that doesn't change anything. It does not know how to handle entry.getValue(). After a bit more playing around I was able to solve it using this methodology: Map<Long, FeatureResult> result = resultFutureRelatedQeury.get();
for (Map.Entry<Long, FeatureResult> entry : result.entrySet()) {
long id = entry.getKey(); // parcel id
Iterator<Object> features = entry.getValue().iterator();
while(features.hasNext()) {
Object element = features.next();
Feature feature = (Feature) element;
}
}
... View more
04-25-2017
11:04 AM
|
1
|
0
|
889
|
|
POST
|
I am attempting to switch from a GeodatabaseFeatureTable.queryFeatures(...) to .queryRelated method as I thought it would increase performance. However, I cannot seem to work with the Future<> result in the same way. I have followed the API documentation exactly but I get a compile error with the sample code. So unless I am missing something there seems to be an issue with the documentation. Any other attempts to work with the FeatureResult have not worked. Here is a picture of what I'm seeing when I use the sample provided in the API documentation: As far as I can tell everything is in order with both methods. I am using the 10.2.9 Runtime Library. As a side note the reason I am needing to change original implementation of my table query was a strange error that was only occurring occasionally when running multiple table queries on an asyc task. The error was: A/libc: Fatal signal 11 (SIGSEGV) at 0x00b52a0b (code=1), thread 23436 Thanks,
... View more
04-24-2017
04:25 PM
|
0
|
2
|
1527
|
|
POST
|
I also have spent a lot of time trying to figure this out. I haven't tried your solution yet but it looks like it should work. Exactly what I was looking for. (working on the Android side through) If someone from ESRI is looking at this a sample with a date query would be helpful
... View more
01-10-2017
11:22 AM
|
1
|
0
|
538
|
|
POST
|
The documentation states that : "public void dispose () -- Disposes the geodatabase. This method must be called when closing an application (or when otherwise finished with the geodatabase) to release resources which use the Geodatabase class." So do you always need to dispose a temporary geodatabase created for some reason within the app? Would there be issues if I did not dispose the tempGDB at all? What about if I only disposed the tempGDB on the final tempGDB, ignoring the ones created during the loop? Is there a memory leak if the geodatabase is never disposed? Ex: private void someFunciton(){
Geodatabase tempGDB;
for (String gdbPath: gdbArray) { //gdbArray is just an array of strings that contains paths to GDB's
try {
tempGDB = new Geodatabase(gdbPath);
//does something with tempGDB
//...finds all layers...etc.
tempGDB.dispose();
}catch(Exception e){
}
}
} Thanks!
... View more
11-30-2016
12:30 PM
|
0
|
0
|
1076
|
|
POST
|
Hi all I'm trying to come up with a simple solution for running some geoprocessing for an app. It seems like there could be many solutions but I am looking for simple cost effective solutions. I am developing for a startup so cash is as tight as it gets. The Problem: Need to process point locations relative to polygon locations (simple contains or intersects) and return results for which polygons the points intersect. This process could potentially be run many times per user/per day. The results would be need to be stored in a database and used for profile info. My thoughts thus far: I would like to be able to just run the process against some server/service I am hosting online. Results I had envisioned being stored in sql database outside of arcgis land. Two thoughts of solutions: 1. Host feature service with ploygons, get locations from app, run process against feature service using runtime sdk. 2. Host feature service with polygons, get locations from app, run process again feature service using some sort of online geoprocessing (without setting up my own server, installing arcServer etc). Does option 2 exist? This thread make me think not. I have worked with android sdk for arcgis extensively for other projects but unsure this would be an elegant or financially viable solution, If I am using the sdk just for geoprocessing wouldn't I have to register every app for licensing? Any thoughts would be greatly appreciated. -Forrest
... View more
11-09-2015
12:49 PM
|
0
|
2
|
3550
|
|
POST
|
With a cursory look it seems like the code should work. Have you debugged and caught the table exception if there is one? It could be that the point is outside of the GDB extent. When you created the offline .geodatabase an extent was needed. Instead of creating the point from a static x-y coordinate I would use a map tap event to get the x-y like so public boolean onSingleTap(final MotionEvent e) {
mMapView.toMapPoint(new Point(e.getX(), e.getY()))
} Hope that helps.
... View more
04-22-2015
01:39 PM
|
0
|
1
|
1857
|
|
POST
|
I am using SDK version 10.2.4 I am trying to implement the autopan abilities. However, I feel that the API needs improvement with the current autopan capabilities. From my testing all "autopan" modes are deactivated upon interaction with the map. I believe this is undesirable and should be a further option to leave active with map interaction. Currently the only way I see to implement a map panning the way I want is to add this line: locationDisplayManager.setAutoPanMode(AutoPanMode.LOCATION); to the onLocationChanged() event for the locationDisplayManager. This can't be very efficient for the system. Anyways that's my 2 cents. Are there any plans to impove autopan further? I saw that in version 10.2.3 there was "auto pan imporovements" but was not sure exactly what those were.
... View more
04-17-2015
02:09 PM
|
0
|
1
|
3813
|
|
POST
|
I have tried that. My code supplied above is very simplified. I had a graphic added to a graphics layer then I pass that graphic to another intent by graphicLayer.getGraphic(UID). I have yet to be successful in this. I have however solved the ultimate issue of setting the spatial Reference of my FeatureSet which can be accomplished by simply using the "setSpatialReference(SR)" method. But the graphic and Spatial Reference issue is still a mystery to me.
... View more
03-23-2015
11:50 AM
|
0
|
0
|
927
|
|
POST
|
I cannot seem to get a graphic with a spatial reference. I have a basemap as a tpk. My mapview and Graphics layer have a spatial reference. I have tried many methods two are listed below that I thought should work. public boolean onSingleTap(final MotionEvent e) {
Geometry geometry = mMapView.toMapPoint(new Point(e.getX(), e.getY()));
Graphic graphic = new Graphic(geometry, pointSymbol);
SpatialReference spatialReference = graphic.getSpatialReference();//=null
} I've also tried to project it. public boolean onSingleTap(final MotionEvent e) {
Geometry geometry = mMapView.toMapPoint(new Point(e.getX(), e.getY()));
Geometry RealProj = GeometryEngine.project(geometry, mMapView.getSpatialReference(), mMapView.getSpatialReference());
Graphic graphic = new Graphic(geometry, pointSymbol);
SpatialReference spatialReference = graphic.getSpatialReference();//=null
}
Nothing seems to work. Is there something obvious I am not doing? This has not been an issue until I have started trying to use the FeatureSet.toJson method and realized that my spatial reference was empty. Thanks in advance for any help.
... View more
03-20-2015
01:43 PM
|
0
|
2
|
4766
|
|
POST
|
FYI it appears that the feature service supporting this sample is down. Here is the url: Folder: DemoData Not sure if it is down for good or what. Looking into just using another service to see if that will work.
... View more
03-18-2015
12:35 PM
|
0
|
0
|
2747
|
|
POST
|
In case anyone is having this issue or has it in the future. I Revisited this problem after some time and fixed it. It was due to architecture issues, and was solved by creating a global variable of a Geodatabase and always using that variable for database operations. Previously I was creating new instances of a geodatabase and using that for inserts. So here is what I do now: static Geodatabase localGDB; //declare global variable in main activity
localGDB = new Geodatabase("path/to/local/my.geodatabase"); //instantiate geodatabase in on create or elsewhere
MyActivityWithGlobalVar.localGDB //reference localGDB variable in other activities in this way when doing anything to it
... View more
12-16-2014
03:37 PM
|
0
|
0
|
740
|
|
POST
|
After some time of playing with this. I finally figured it out with the help of an esri tech. Essentially where I was going wrong was referencing my GeodatabaseFeatureTables. I was creating a new instance of a localGeodatabase inside of my function that was trying to select my features. Everything was solved once I created a global variable for my localGeodatabase at the same time I was adding those layers into the map. Thanks for all your help on Dave! I wouldn't have gotten as far on it without your help. -Cheers
... View more
12-12-2014
01:36 PM
|
0
|
0
|
1466
|
|
POST
|
I followed your advice and I was able to select the features via queryFeatures with a simple where "1=1" query. After that I was also able to select features via a spatial query. After much digging I have found the source of the problem is but still don't know the cause or a solution. It seems that there is a disconnect between my global variable that is a feature layer when it is added to the map view and when I try to use it inside of my MyTouchListener class. Or it has to do with the declaration of the call back as a global variable. However, both of these are exactly how the Select Features sample has them declared. 1. The only way I can get the FeatureLayer.SelectFeatures(QueryParamaters,...) to work is to add that layer to the mapview at time of selectFeatures. This leads to duplicate layers. 2. On the other hand I can use the global featureLayer when using the method described above using queryfeatures on the geodatabaseFeature table then passing the oids captured in the callback to FeatureLayer.selectFeatures(long[] oids,..) However using this method in a dynamic way for any/all layers possibly present in a map is proving logically difficult. 3. Tried using and this does not work either. mmapview.getLayers() does not refer back to the actual map layers after I cast them to FeatureLayer. Layer[] allLayers = mMapView.getLayers();
for (Layer layer : allLayers) {
try{
FeatureLayer xFeatureLayer = (FeatureLayer) layer;
QueryParameters q = new QueryParameters();
q.setGeometry(g.getGeometry()) //g being a qualifying graphic
q.setSpatialRelationship(SpatialRelationship.INTERSECTS)
//other qualifying query paramaters...
//....
xFeatureLayer.selectFeatures(q, SelectionMode.NEW, callback);
}catch (Exception ee) {
ee.printStackTrace();
}
} So I still don't have a way to select features without adding new Feature layers in at time of query OR capture all Featurelayers added to the map as global variables, then do a combination of queryFeatures and SelectFeatures(long[] oids, ...). Neither of these seem like the intended way of handling this. Any thoughts? Your continued thoughts/help is much appreciated. Thanks!
... View more
12-03-2014
05:17 PM
|
0
|
2
|
1466
|
|
POST
|
Thank you very much for your reply. I have noticed that my variable g (my graphic) does not have a spatial reference. It is null. I tried several things but can not seem to rectify this by any means. I am now trying to figure out how to give it a spatial reference. It is derived from a graphicsLayer which has a spatial reference. I'm not sure I am understanding the relationship between the graphic, graphicLayer and Envelope. Here is a better sample of my code. Should a graphic inherit a spatial relationship from a graphics layer? I don't see a way to create a graphic with a spatial relationship or a way to set one. Do I need to project it (this would seem overly complex)? Thank you very much for your help.
GraphicsLayer gLayerSelect = new GraphicsLayer(); //Global Var
gLayerSelect = new GraphicsLayer(mMapView.getSpatialReference(),null,RenderingMode.DYNAMIC); //Defined in on Create
mMapView.addLayer(gLayerSelect);//added in on Create
private class MyTouchListener extends MapOnTouchListener {
Graphic g;
Point p0 = null;
int uid = -1;
SimpleFillSymbol sfs;
public MyTouchListener(Context context, MapView view) {
super(context, view);
sfs = new SimpleFillSymbol(Color.BLACK);
sfs.setOutline(new SimpleLineSymbol(Color.RED, 2));
sfs.setAlpha(100);
}
public boolean onDragPointerMove(MotionEvent from, MotionEvent to) {
if (uid == -1) { // first time
//Geometry xGeometry = mMapView.toMapPoint(new Point(from.getX(), to.getY()));
//g = new Graphic(xGeometry, sfs);
g = new Graphic(null, sfs);//original
p0 = mMapView.toMapPoint(from.getX(), from.getY());
uid = gLayerSelect.addGraphic(g);
} else {
Point p2 = mMapView.toMapPoint(new Point(to.getX(), to.getY()));
Envelope envelope = new Envelope();
envelope.merge(p0);
envelope.merge(p2);
gLayerSelect.updateGraphic(uid, envelope);
}
return true;
}
public boolean onDragPointerUp(MotionEvent from, MotionEvent to) {
if (uid != -1) {
g = gLayerSelect.getGraphic(uid);
if (g!= null && g.getGeometry() != null) {
fLayer.clearSelection();
QueryParameters q = new QueryParameters();
q.setWhere("1=1");
q.setOutSpatialReference(mMapView.getSpatialReference());
q.setReturnGeometry(true);
q.setInSpatialReference(mMapView.getSpatialReference());
q.setGeometry(g.getGeometry());
q.setSpatialRelationship(SpatialRelationship.INTERSECTS);
fLayer.selectFeatures(q, SelectionMode.NEW, callback);
if (g.getSpatialReference() == mMapView.getSpatialReference()){
String X = "";
}
}
gLayerSelect.removeAll();
}
p0 = null;
uid = -1;
return true;
}
... View more
12-02-2014
10:36 AM
|
0
|
4
|
1466
|
|
POST
|
I am having trouble selecting features from an offline geodatabase. I am following the 'Select Features' sample. I have switched all that parameters to work off of a local gdb. So I am passing in: QueryParameter() and SelectionMode. Instead of: Query() and SELECTION_METHOD. I have also added a .setSelectionColor & .setSelectionColorWidth to the featureLayers in my map. However, nothing seems to get selected after I create the envelope and release. Here is some Sample FeatureLayer fLayer = null;
//added to Mapview in onCreate
localGdb = new Geodatabase(FeatureInformation.getInstance().activeGeodatabasePathString);
for (GeodatabaseFeatureTable gdbFeatureTable : localGdb.getGeodatabaseTables()) {
if (gdbFeatureTable.hasGeometry()) {
fLayer = new FeatureLayer(gdbFeatureTable);
fLayer.setSelectionColor(12828800);
fLayer.setSelectionColorWidth(30);
mMapView.addLayer(fLayer);
}
}
localGdb.dispose();
//This is inside of onDragPointerUp just like Select Features sample
QueryParameters q = new QueryParameters();
//q.setWhere("FEATURE='Fire'");
q.setReturnGeometry(true);
q.setInSpatialReference(mMapView.getSpatialReference());
q.setGeometry(g.getGeometry());
q.setSpatialRelationship(SpatialRelationship.INTERSECTS);
fLayer.selectFeatures(q, SelectionMode.NEW, callback);
... View more
12-01-2014
06:09 PM
|
0
|
6
|
5401
|
| Title | Kudos | Posted |
|---|---|---|
| 3 | 03-02-2023 03:00 PM | |
| 1 | 05-27-2021 09:46 AM | |
| 2 | 05-25-2021 05:55 PM | |
| 1 | 04-25-2017 11:04 AM | |
| 2 | 10-31-2019 11:10 AM |
| Online Status |
Offline
|
| Date Last Visited |
Tuesday
|