POST
|
Hi, I have created a web map and the spatial reference in the web map data when I request the specific item is (presumably based on the base layer spatial reference?): "spatialReference": { "wkid": 102100, "latestWkid": 3857 } but the extent in the web map content item is: "extent": [[105.533276992, -43.6430919145], [159.105442464, -9.23004701800001]] What is the spatial reference of the extent? Is it EPSG:4326 and if so is this always the case for web maps? I could not find a definitive reference for this. Cheers, Chris Mugdan
... View more
03-21-2018
06:24 PM
|
0
|
5
|
1810
|
POST
|
Hi Tyler, It would seem that the current SDK is not ideal for our purposes. I shall investigate the Python engine. Thanks for your assistance.
... View more
02-28-2018
04:46 PM
|
0
|
0
|
1863
|
POST
|
Hi Eric, Would you consider providing an SDK that does what we need without the javafx paraphernalia? I would even be happy to have the asynchronous operations with the ListenableFuture<> even though we do not need them to be asynchronous. I guess that the licensing model would need to be different and it would be good to know from the outset what that might be, including estimated costs. Chris
... View more
02-28-2018
04:36 PM
|
1
|
0
|
298
|
POST
|
Hi Tyler, The code hangs even when in an entirely isolated environment and not in our Web application. Could it be that I have not extended javafx.application.Application nor have I created a Stage or Scene? Would you be able to try the code yourself and see what you get? Cheers, Chris
... View more
02-26-2018
07:17 PM
|
0
|
2
|
1863
|
POST
|
Hi Eric, Our application Map Intelligence is a Java Web application that is usually installed in a Tomcat Web container. It has its own user interface that renders maps inside Business Intelligence tools. We have adapters for a number of GIS back ends including one for ArcGIS Server. Currently the adapter connects to the REST interface of ArcGIS Server to render maps from map services. We want to do the same with ArcGIS Online web maps and that is why I have been investigating the ArcGIS Java SDK as I thought it would be suitable to fetch the layer data from ArcGIS Online and render the maps locally based on local content and the ArcGIS Online layers. Have a look at our website: www.integeo.com to see who we are and there is a demo map viewer using ArcGIS Server at http://arcdemo.development.integeo.com/mapIntelligence Any suggestions based on the above model would be gratefully received. Cheers, Chris
... View more
02-26-2018
07:14 PM
|
2
|
2
|
1863
|
POST
|
Hi Tyler, Thanks for the response, it is much appreciated. I modified the code as per the first example and that all works fine now. I am starting to get a feel for the operation of the SDK bit by bit. However, now that I have the map and mapView, when I try to render the image as per the second example, it hangs when the "addDoneListener" line executes and the actions in that listener lambda do not get executed. The test program does not exit. I have appended the modified code. It would be really nice to have synchronous versions of the current asynchronous operations for our purposes (see below.) I should explain that our application Map Intelligence is not the type of application that the SDK usually supports. It is a web application (installed in Tomcat by default) that renders maps in its own UI. We currently connect to the ArcGIS Server using the REST interface to render maps (with map services) and I was hoping to do something similar with the ArcGIS Java SDK so that we can connect to ArcGIS Online. We do not use the JavaFX library at all and this is the first time I have needed to get involved in it. I am wondering if the hanging request is because the JavaFX library is not properly set up? Do you have an explanation? A question on the use of the get() method in the Listenable Future: in the Java Future class the get() method waits on the conclusion of the asynchronous action. I see that the ListenableFuture overrides this method. When is it acceptable to use the get() method in the ArcGIS Java SDK? Cheers, Chris The modified code: com.sun.javafx.application.PlatformImpl.startup(()->{});
MapView mapView = new MapView();
SpatialReference sr = SpatialReference.create(4326);
ArcGISMap map = new ArcGISMap(sr);
ArrayList<Field> fields = new ArrayList<>();
fields.add(Field.createInteger("ID", "ID"));
fields.add(Field.createString("NAME", "NAME", 256));
FeatureCollectionTable ft = new FeatureCollectionTable(fields, GeometryType.POINT, sr);
ArrayList<Feature> features = new ArrayList<>();
HashMap<String,Object> attrs1 = new HashMap<>();
attrs1.put("ID", 1);
attrs1.put("NAME", "point 1");
Geometry geom1 = new Point(151.096, -33.709, sr);
Feature f1 = ft.createFeature(attrs1, geom1);
features.add(f1);
HashMap<String,Object> attrs2 = new HashMap<>();
attrs2.put("ID", 2);
attrs2.put("NAME", "point 2");
Geometry geom2 = new Point(151.091, -33.706, sr);
Feature f2 = ft.createFeature(attrs2, geom2);
features.add(f2);
HashMap<String,Object> attrs3 = new HashMap<>();
attrs3.put("ID", 3);
attrs3.put("NAME", "point 3");
Geometry geom3 = new Point(151.103, -33.704, sr);
Feature f3 = ft.createFeature(attrs3, geom3);
features.add(f3);
ListenableFuture<Void> loaded = ft.addFeaturesAsync(features);
try
{
loaded.get();
}
catch (Throwable t)
{
System.out.println(t.getMessage());
}
FeatureCollection fc = new FeatureCollection();
Renderer rdr = new SimpleRenderer();
ft.setRenderer(rdr);
fc.getTables().add(ft);
FeatureCollectionLayer fl = new FeatureCollectionLayer(fc);
map.getOperationalLayers().add(fl);
mapView.setMap(map);
Envelope e = new Envelope(151.090, -33.713, 151.107, -33.702, sr);
Viewpoint vp = new Viewpoint(e);
mapView.setViewpoint(vp);
ListenableFuture<Image> imageResult = mapView.exportImageAsync();
imageResult.addDoneListener(() ->
{
try {
// get image
Image image = imageResult.get();
// choose a location to save the file
File file = new File("C:/tmp/img.png");
if (file != null) {
// write the image to the save location
ImageIO.write(SwingFXUtils.fromFXImage(image, null), "png", file);
}
}
catch (Exception ex)
{
ex.printStackTrace();
}
finally
{
mapView.dispose();
}
});
... View more
02-23-2018
08:59 PM
|
0
|
8
|
1863
|
POST
|
ArcGIS Java SDK 100.2 I am new to the Java SDK and I am trying a simple test case to create an image from an ArcGISMap with a few points in it. When I try to run it I get the following when I try to create FeatureLayer from a FeatureCollectionTable: Exception in thread "main" com.esri.arcgisruntime.ArcGISRuntimeException: Invalid argument at com.esri.arcgisruntime.internal.jni.CoreFeatureLayer.nativeCreateWithFeatureTable(Native Method) at com.esri.arcgisruntime.internal.jni.CoreFeatureLayer.<init>(SourceFile:67) at com.esri.arcgisruntime.layers.FeatureLayer.a(SourceFile:209) at com.esri.arcgisruntime.layers.FeatureLayer.<init>(SourceFile:194) I could not see how to create a FeatureTable from some Features, hence my use of a FeatureCollectionTable. Maybe that is incorrect? I have set the environment variable ARCGISRUNTIMESDKJAVA_100_2_0 to the correct path to find the JNI code which I presume is in jniLibs under that path? I have attached the (very simple) test code. I presume I have missed something but what? Cheers, Chris Mugdan
... View more
02-21-2018
09:28 PM
|
0
|
10
|
2792
|
POST
|
An update on this: I upgraded to 10.5.1 and it worked again. Something must have got scrambled in the 10.5 server.
... View more
07-08-2017
06:02 PM
|
0
|
0
|
330
|
POST
|
It was working with this 10.5 ArcGIS Server, but it now does not. It just hangs when I try to import the file created by ArcCatalog. ArcCatalog is able to connect to the server though. There are no errors reported in the logs. it just sits there saying that it is being imported. Can anyone give me a clue as to what is going on? It would be really nice if it gave some indication of what is going wrong! Chris Mugdan
... View more
07-07-2017
11:53 PM
|
0
|
1
|
653
|
POST
|
Can someone tell me how to set the routing optimisation method (distance or time) in the ArcGIS Online routing service using the REST interface for the multi-point route (travelling salesman)? Looking at the Web page I could not find any mention of this. Cheers, Chris Mugdan
... View more
05-21-2017
12:03 AM
|
0
|
0
|
779
|
POST
|
It does not happen all the time, but when it does, you have to restart the ArcGIS Server before it is able to fetch the information from our web server. This is with 10.5 enterprise. What can be done about this condition since our web server is up and functioning and the only way to solve it currently is to re-start the ArcGIS Server? It is happening frequently enough to be of concern. Further explanation: we are rendering map images using the export map facility on ArcGIS Server map services by invoking the REST interface. Some of our layers use PNG symbols that reside on our web server and we pass the URLs to those symbols across to the ArcGIS Server. These symbols disappear when the ArcGIS Server stops communicating with our web server.
... View more
04-07-2017
01:28 AM
|
0
|
0
|
1299
|
POST
|
Disregard this. I have found what I am looking for. Cheers, Chris Mugdan
... View more
01-18-2017
01:18 AM
|
0
|
0
|
455
|
POST
|
I am rendering a dynamic layer that consists of lines. I was wondering if there is a text alignment that causes the text to follow the line and then whether the text has its top or bottom closest to the line? Is there some document that describes what the text alignments in the REST API mean when related to lines? I am using ArcGIS Server 10.4 Cheers, Chris Mugdan
... View more
01-18-2017
01:16 AM
|
0
|
1
|
1280
|
POST
|
Thanks for you reply Jake. I had a look at the JSON and I can see the setting in properties. Unfortunately I cannot readily get this information. Currently, my application uses the ArcGIS REST API to render map images using the Print Tools ExportWebMap and I want to use the Export Map facility in the map services because it is quicker and more flexible (and less buggy;-). I need to use dynamic workspaces for this so I need to know in advance whether a map service has a dynamic workspace in it.If the service does not have a suitable dynamic workspace then I revert to my current method of rendering the map image. Maybe the best way is to send a test "dummy" request to the service when I get its information and check the response? It is just a bit of a nuisance! Cheers, Chris
... View more
01-05-2017
02:39 PM
|
0
|
0
|
643
|
POST
|
If not, is there another way to do this programmatically? I would much prefer to be able to use the REST interface as I am using that for all my other requests
... View more
01-04-2017
05:20 PM
|
0
|
2
|
1178
|
Title | Kudos | Posted |
---|---|---|
1 | 09-25-2019 05:31 PM | |
1 | 09-16-2019 10:58 PM | |
1 | 01-10-2019 05:16 PM | |
1 | 02-28-2018 04:36 PM | |
2 | 02-26-2018 07:14 PM |
Online Status |
Offline
|
Date Last Visited |
11-20-2023
08:49 AM
|