|
POST
|
@RobertSchweikert Using the service you mentioned in the other post on the forum, I can list the layers and the ids using the following code: // connect to the feature server
ServiceGeodatabase gdb = new ServiceGeodatabase("https://services1.arcgis.com/owfRSBecxmXo3S0X/arcgis/rest/services/roads_database_ver_411gdb20211207t151917z001/FeatureServer");
gdb.loadAsync();
gdb.addDoneLoadingListener(()-> {
System.out.println("gdb load status " + gdb.getLoadStatus());
ArcGISFeatureServiceInfo serviceInfo = gdb.getServiceInfo();
// list the layers
for (IdInfo idInfo : serviceInfo.getLayerInfos()) {
System.out.println("layer id = " + idInfo.getId() + " name = " + idInfo.getName());
}
// list the tables
for(IdInfo idInfo : serviceInfo.getTableInfos()) {
System.out.println("table id = " + idInfo.getId() + " name = " + idInfo.getName());
}
}); From each of the layers you can choose to load them from the ServiceFeatureTable class as you've mentioned above. Does this help? Also does this also answer the other question you posted?
... View more
12-14-2021
06:05 AM
|
1
|
0
|
2249
|
|
POST
|
In the app in in my git repository I'm refreshing 5000 graphics every 20ms. I've managed to get it up to 50000 before I started to see a drop in performance. If you pull the source code for the demo app and run it, you will see it performs quite well. Something is wrong if you can't refresh every second. Have a close look at how I've got this working and see if this can be applied to your own app. You can definitely improve on the 1second refresh rate you have at the moment. If you have some code you can share I can take a look at it.
... View more
12-13-2021
09:24 AM
|
0
|
0
|
696
|
|
POST
|
Hi @Tone I've seen a few apps like the one you describe and a wrote a blog post on the subject a few months ago. It is far more up to date than the PDF you linked to which is from 2014. There is a git repository which has a working app showing an example of how this is done too. In this case it was a simulation of vehicles based on route data in csv files. It may follow a similar pattern to what you need to implement. Let me know if this helps. Mark
... View more
12-13-2021
02:39 AM
|
1
|
0
|
713
|
|
POST
|
Hi @Tone The ellipseGeodesic method is very fussy about its parameters. You need to make sure you set them all and you also need to pass in a center point which has a known spatial reference. I've created an example ellipse method which should help you: private Polygon makeEllipse() {
// create parameters and set all the parameters
GeodesicEllipseParameters parameters = new GeodesicEllipseParameters();
parameters.setCenter(new Point(3,14, SpatialReferences.getWebMercator())); // Note the spatial reference
parameters.setGeometryType(GeometryType.POLYGON);
parameters.setSemiAxis1Length(100);
parameters.setSemiAxis2Length(200);
parameters.setAxisDirection(45);
parameters.setMaxPointCount(100);
parameters.setAngularUnit(new AngularUnit(AngularUnitId.DEGREES));
parameters.setLinearUnit(new LinearUnit(LinearUnitId.METERS));
parameters.setMaxSegmentLength(20);
Polygon ellipsePoly = (Polygon) GeometryEngine.ellipseGeodesic(parameters);
return ellipsePoly;
} This is how I used the resulting geometry: SimpleLineSymbol lineSymbol = new SimpleLineSymbol(SimpleLineSymbol.Style.SOLID, 0xFF0063FF, 1);
SimpleFillSymbol fillSymbol = new SimpleFillSymbol(SimpleFillSymbol.Style.SOLID, 0xFF00FF00, lineSymbol);
Graphic graphic = new Graphic(makeEllipse(), fillSymbol);
graphicsOverlay.getGraphics().add(graphic); Looks like this: Let me know if this helps Mark
... View more
12-10-2021
05:07 AM
|
1
|
1
|
1157
|
|
POST
|
Reading the polygon is just the same as creating it. From the polygon class you can get the parts which make up the polygon rings. You can have multiple rings (parts) which can make up a multi-part polygon. For example you could have a polygon representing the multiple islands which make up the Outer Hebrides. You can also have rings inside rings, and even rings in side rings, which are inside rings! This allows you to make items like: - An island which has a lake in it - An island which has a lake, and the lake has another island which in turn has its own lake.
... View more
12-10-2021
03:32 AM
|
0
|
0
|
1602
|
|
POST
|
If you are wanting to draw a polygon with a hole in it, the following method shows how this can be achieved. The polygon is made up of "parts" which form the inner and out rings of your polygon with a hole it it. private Polygon makePolygonWithHole() {
// create a new point collection for polygon
PointCollection outerPoints = new PointCollection(SpatialReferences.getWebMercator());
// create and add points to the point collection
outerPoints.add(new Point(2000, 2000));
outerPoints.add(new Point(2000, 4000));
outerPoints.add(new Point(4000, 4000));
outerPoints.add(new Point(4000, 2000));
Part outerPart = new Part(outerPoints);
// inner part (the hole)
PointCollection innerPoints = new PointCollection(SpatialReferences.getWebMercator());
innerPoints.add(new Point(3500,2500));
innerPoints.add(new Point(3500,3500));
innerPoints.add(new Point(2500,3500));
innerPoints.add(new Point(2500,2500));
Part innerPart = new Part(innerPoints);
// make parts for multi part polygon
PartCollection partCollection = new PartCollection(SpatialReferences.getWebMercator());
partCollection.add(outerPart);
partCollection.add(innerPart);
// create the polyline from the point collection
Polygon polygon = new Polygon(partCollection);
return (Polygon) GeometryEngine.simplify(polygon);
} The polygon can be used in features (persisted in a feature service for example), or a graphics overlay. I've shown some simple code below which shows how to draw the polygon in a graphics overlay: // create a map view and set the map to it
mapView = new MapView();
mapView.setMap(map);
GraphicsOverlay graphicsOverlay = new GraphicsOverlay();
mapView.getGraphicsOverlays().add(graphicsOverlay);
SimpleLineSymbol lineSymbol = new SimpleLineSymbol(SimpleLineSymbol.Style.SOLID, 0xFF0063FF, 1);
SimpleFillSymbol fillSymbol = new SimpleFillSymbol(SimpleFillSymbol.Style.SOLID, 0xFF00FF00, lineSymbol);
Graphic graphicWithHole = new Graphic(makePolygonWithHole(), fillSymbol);
graphicsOverlay.getGraphics().add(graphicWithHole); Multi part polygons can also be created with parts. Does this help?
... View more
12-06-2021
03:18 AM
|
1
|
0
|
1619
|
|
POST
|
@RobertSchweikert yes you can do both of these things. How are you wanting to store them? Are you wanting to store them in a feature layer or a graphic overlay?
... View more
12-03-2021
09:26 AM
|
0
|
0
|
1635
|
|
POST
|
There is potentially a way to achieve this using Local Server which is a separate ArcGIS Runtime product. I'm just checking if this workflow is supported.
... View more
12-03-2021
05:05 AM
|
0
|
0
|
679
|
|
POST
|
We do have support for drawing true curves and Bezier curves as part of a geometry. There is a sample here which shows how both are used to create a heart shape like this: The lines of code to draw this shape start here. Does this help?
... View more
12-01-2021
01:22 PM
|
1
|
0
|
676
|
|
POST
|
The default mode for a query operation is to limit the attributes returned so things render quicker and you are transferring less data across the network. It is explained here. In the code when you perform a query to get the features you can set it so you return everything. Here is some very crude code to show it: // define the feature table
ServiceFeatureTable featureTable = new ServiceFeatureTable("https://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0");
featureTable.loadAsync();
// load it and wait...
featureTable.addDoneLoadingListener(() -> {
System.out.println("load status " + featureTable.getLoadStatus());
// query parameters for everything
QueryParameters queryParameters = new QueryParameters();
queryParameters.setWhereClause("1=1");
// query the table
//ListenableFuture<FeatureQueryResult> future = featureTable.queryFeaturesAsync(queryParameters); // returns default fields only
ListenableFuture<FeatureQueryResult> future = featureTable.queryFeaturesAsync(queryParameters, ServiceFeatureTable.QueryFeatureFields.LOAD_ALL);
try {
// thread blocks here until results come back
FeatureQueryResult queryResult = future.get();
// take a look at the features we've got
for (Feature feature : queryResult) {
System.out.println(" attr " + feature.getAttributes().keySet());
}
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
}); You mention that you are writing an app which does not use JavaFX controls. Can you tell me how you are using the SDK?
... View more
11-24-2021
05:54 AM
|
1
|
0
|
1811
|
|
POST
|
Hi @VanyaIvanov I'm sure this is possible, but you are going to need to write some code for this. Just so I can understand, are you looking to extend a line so it continues to point in the same direction? If you can share a little more information on what you are trying to achieve I'll make some suggestions. One thing to note if if you were drawing in MapViews (2D), the Sketch Editor might help you. Mark
... View more
11-23-2021
11:54 AM
|
2
|
1
|
1899
|
|
POST
|
I can see the problem here, the rendering mode for a GraphicsOverlay is set when you instantiate it. The default constructor will set it in DYNAMIC, but there is an overload which allows you to set this yourself. The code you've written for changing the rendering mode is for feature layers. Using the following code, I've managed to render your arrowhead: PointCollection polylinePoints = new PointCollection(SpatialReferences.getWgs84());
polylinePoints.add(new Point(10, 10));
polylinePoints.add(new Point(20, 20));
Polyline polyline = new Polyline(polylinePoints);
SimpleLineSymbol lineSymbol = new SimpleLineSymbol(SimpleLineSymbol.Style.SOLID,
0xFF0063FF, 7, SimpleLineSymbol.MarkerStyle.ARROW, SimpleLineSymbol.MarkerPlacement.END);
Graphic polylineGraphic = new Graphic(polyline, lineSymbol);
GraphicsOverlay graphicsOverlay = new GraphicsOverlay(GraphicsOverlay.RenderingMode.STATIC);
sceneView.getGraphicsOverlays().add(graphicsOverlay);
graphicsOverlay.getGraphics().add(polylineGraphic); I am however going to look at making the arrow head to render in the dynamic rendering mode for a future release. Does this help?
... View more
11-11-2021
02:49 AM
|
0
|
0
|
1672
|
|
POST
|
Take a look at graphics overlays, I believe these are what you need to be using. This doc introduces the subject of graphics overlays in scenes. There are also samples which show some of the concepts. I've included samples for 2D and 3D apps. Remember that the graphics are created in the same way for 2D and 3D, just remember that you might want to add a Z value for 3D. https://github.com/Esri/arcgis-runtime-samples-java/tree/main/display_information/add-graphics-with-symbols https://developers.arcgis.com/java/scenes-3d/add-graphics-to-a-scene-view/ https://github.com/Esri/arcgis-runtime-samples-java/tree/main/scene/surface-placement https://github.com/Esri/arcgis-runtime-samples-java/tree/main/scene/extrude-graphics https://github.com/Esri/arcgis-runtime-samples-java/tree/main/scene/distance-composite-symbol https://github.com/Esri/arcgis-runtime-samples-java/tree/main/scene/animate-3d-graphic https://github.com/Esri/arcgis-runtime-samples-java/tree/main/scene/symbols Hopefully there is enough here to get you started. You may need to consider the surface placement modes you use which are in one of the samples above. Mark
... View more
11-09-2021
06:42 AM
|
0
|
0
|
744
|
|
POST
|
@HammadMuddassir 10.2.4 of ArcGIS Runtime is a very old release and no longer supported. It sounds like you are migrating an app from Map Objects, so replacing it with another outdated product isn't recommended. You need to be using the latest version which is 100.12.0. I really would step back and look at your workflows and see if you can modernise them. Although we do support direct connect to SDE databases via Local Server, there will be a license cost implication to using this. It is likely to be more cost effective to access your data using an ArcGIS Server instance and there are several other benefits to using this as I've detailed in an earlier post.
... View more
11-04-2021
09:24 AM
|
0
|
1
|
2026
|
|
POST
|
@gokulthakare has using dedicated class instances for the MapView and Scene View (Table and Layer classes) fixed the crash you were experiencing?
... View more
10-28-2021
12:42 AM
|
0
|
1
|
1687
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-13-2024 05:17 AM | |
| 1 | 07-10-2024 01:50 AM | |
| 1 | 04-22-2024 01:21 AM | |
| 1 | 04-18-2024 01:41 AM | |
| 1 | 12-05-2023 08:50 AM |
| Online Status |
Offline
|
| Date Last Visited |
03-12-2025
07:13 PM
|