java.lang.NumberFormatException: Invalid int: "WGS84(DD)"

4182
3
07-30-2015 12:45 AM
MariusEggen
New Contributor

I get the following error:

com.esri.arcgis.android.samples.wmslayer W/System.err﹕ java.lang.NumberFormatException: Invalid int: "WGS84(DD)"

I am adding a custom WMS server like this:

String wmsURL = "http://<lan ip>:8080/geoserver/wms";
wmsLayer = new WMSLayer(wmsURL, SpatialReference.create(32633));

I have debugged and decompiled the source and it is "class g" that is the problem, the array "t" which contains all the reference systems in the EPSG: range does Integer.parseInt(var2.substring(5)); ,but the "EPSG:WGS84(DD)" cannot be parsed like this and it throws the NumberFormatException and my layer will never be created.

This was testet with the WmsLayer sample code with version 'com.esri.arcgis.android:arcgis-android:10.2.6-2'

0 Kudos
3 Replies
WillCrick
Occasional Contributor

does the WMS service support this spatial reference?

You could try and use the constructor which checks to see if the current mapviews spatial reference (which is set from the first layer you add, typically the basemap layer) is supported by the WMS service.

0 Kudos
MariusEggen
New Contributor

As you see I am trying to create a layer with EPSG:32633(atleast I think thats how you do it). The wms is geoserver and it supports a broad range of reference systems, as we have not disabled any of the default ones. When testing the Wms sample project, i see that the map defaults to your service if no other layer is set?I cannot find a constructor that both sets reference system and a wms url.

0 Kudos
WillCrick
Occasional Contributor

Can you confirm that you are using the topographic basemap from ESRI that is set in the samples activity_main.xml layout file? This sets the MapViews spatial reference (which in this case is web mercator or 102100). You cannot change this once this is set.  If you want your MapView to be in a specific spatial reference then use a service which supports this and add this as your first layer to the MapView (and remove the topo map reference in the mapview xml definition in the layout file).

Have you tried just adding the WMS Layer using the default constructor into the MapView (whilst still using the top basemap from the layout xml file)? If the map service supports web mercator, it should just work.

0 Kudos