How to create .lyr or .avl file format using ArcGIS Runtime SDK JAVA?

8740
10
03-13-2014 05:05 AM
RavindraSingh
Occasional Contributor
Hi GeoGeeks,

I would like to store the symbology in '.lyr' OR '.avl' files,
using ArcGIS runtime SDK Java.

Basically I want to interchange the symbology between my custom application and ArcGIS Desktop(e.g. ArcMap 10.x).
and I want to create and read that symbology using my custom application.

IS it possible? if yes, then please suggest the way to do so.
if not, then, is there any other 3rd party API's which can make it possible?
0 Kudos
10 Replies
MarkBaird
Esri Regular Contributor
You can author data and its symbology in ArcMap and publish it for use in a runtime application.  The new way of doing this is via a geodatabase file although the classes to read geodatabases are currently in Beta at 10.2.  However there is a release coming out very soon where these classes will be final.

Another way of achieving what you are after is to use the Local Server with an mpk file which can also be exported from ArcMap.

If you wait a few weeks then I'd recommend using the geodatabase route.  Geodatabases can also be exported from ArcGIS Server Feature Services which enable you to edit data offline and then sync when you are back in network coverage.  The other advantage of geodatabase files is that they are supported by all runtime SDKs unlike the Local Server which is only on Java, Qt and WPF.

Does this help?

Mark
0 Kudos
RavindraSingh
Occasional Contributor
Hi Mark,

Thanks for kind attention.
But that won't solve my problem.

Let me explain you my situation in little more details.

  1. I have created a GIS Viewer using ArcGIS Runtime SDK Java.

  2. Now in this I am adding layers in the map using DynamicWorkspace capability of this SDK. and adding data from .shp, Geodatabase sources etc.

  3. Now I am providing an user interface to user where s/he can define the symbology(e.g. Simple, classbreak, Unique etc.) to render above layers (e.g. .shp or geodatabase) in map.

  4. Now I want to store above defined symbology in compitible file (e.g. .lyr or .avl or anyother), so that user can share these with others fellow and can re-use in ArcMap also, so that s/he need not to define each and every property of the symbology again and again. and vice-versa.


I hope now, I am able to make myself more clear.
and hope now, you would be able to guide me more precisely on this note.
0 Kudos
SachinKanaujia
Occasional Contributor III
If you want to work within the ArcGIS Runtime/Javascript environment it would be easy to manage it as a json structure. If you want to make it work across ArcMap as well then you need to look at exporting/import .lyr and .lpk but all of it may not be supported within the runtime environment. Save To Layer File is supported so you can use it to create something for ArcMap
0 Kudos
CarlosColón-Maldonado
Occasional Contributor III
You can author data and ... publish it for use in a runtime application.  The new way of doing this is via a geodatabase file although the classes to read geodatabases are currently in Beta at 10.2.  However there is a release coming out very soon where these classes will be final. If you wait a few weeks then I'd recommend using the geodatabase route.  Geodatabases can also be exported from ArcGIS Server Feature Services which enable you to edit data offline and then sync when you are back in network coverage.  The other advantage of geodatabase files is that they are supported by all runtime SDKs unlike the Local Server which is only on Java, Qt and WPF.


That's good news for those of us who desire modifying map package geodatabase content such as raster data.

1. Will it support mosaic dataset containing raster data?

2. Will it support referenced or contained geodatabases? I'd rather have users upload and persist rasters rather than me providing them preloaded, and I haven't been able to figure out how to implement that at run time.

3. Will the geoprocessing tools for adding/removing rasters unto a mosaic dataset be there (a big one for me)?

Thanks, Mark.
0 Kudos
MarkBaird
Esri Regular Contributor
In answer to the original question, which was about using the API to create lyr files, I'm afraid there isn't a way of doing this.

However in the future we will be expanding the use of the new geodatabase format which we are currently using for the offline capabilties.  The geodatabase not only contains data, but also rendering information too.  Use of the geodatabase will be directly from the Runtime API (not using Local Server).  This is good as it means that all Runtime APIs will support the format.  So in the future you will be able to author data AND rendering and be able to share this back to other applications in one file.  This will however not be in the next release (10.2.2).

It is always good to hear how developers are using the applications so we can make sure that we've got the right functionality available (or at least planning it).

In answer to Carlos:

After 10.2.2 we will be directly supporting more raster formats without using local server.  I can't share the exact details of this yet, but we are listening to your requirements 🙂

Mark
0 Kudos
MarkBaird
Esri Regular Contributor
Also we are considering the following GP tools at 10.2.2:

�?� Data Management > Raster > Mosaic Dataset > Create Mosaic Dataset
�?� Data Management > Raster > Mosaic Dataset > Add Rasters To Mosaic Dataset

Mark
0 Kudos
SachinKanaujia
Occasional Contributor III
Hi Mark,
So now we will have direct reads for Shapefile files, rasters and geodatabases without having to add them to the local service.

1) From what you explained it appears geodatabase will also have rendering information, what about shapefiles and raster color maps?

2) This way of rendering info from the geodatabase will be supported in ArcMap as well?

3) If you are going to have direct reads for shapefile, raster, geodatabase etc outside local server then API should give a way to export map Image similar to what was available with Arcobjects (Engine). There are scenarios where the data needs be consumed/displayed outside the JMap?

4) Why are Geoprocessing Tools being released at such a slow pace in Runtime? Atleast for Desktop environment (JAVA API) all tools should be available since most of the heavy lifting is being done by Geoprocessing. Any sound reasoning behind that? It is a big showstopper for us to not be able to use all the geoprocessing, some being very basic stuff.
0 Kudos
MarkBaird
Esri Regular Contributor
Yes that's right we're aiming to support more data types without using Local Server.  It will make the code to consume these much easier to write.  This however is for after 10.2.2.

So specific anwers:

1. Yes the geodatabase does have rendering info.  We are not altering the shapefile format, so this will not contain rendering info.

2.  Geodatabases will be supported in ArcMap

3.  Export Image isn't planned, but it's something I can think about.

4.  There are more new geoprocessing tools than these 2 being added at 10.2.2.  Exact details will follow, but I thought I'd mention these ones as they are of interest to this thread.  The best thing to do it tell us what is missing and we can consider getting them added.

Mark
0 Kudos
SachinKanaujia
Occasional Contributor III
Here are my specific issues/concerns which I would be happy if they are addressed

Yes that's right we're aiming to support more data types without using Local Server.  It will make the code to consume these much easier to write.  This however is for after 10.2.2.

[Sachin]- While doing things via API is always great but it should be flexible and perform well. Flexible that it should not restrict data access/display within JMap as I mentioned earlier. There should still be a way to expose REST urls or export image. Will you completely take off data access via local server once direct read is in place?
Performance - I have observed that single instance of local server is not multithreaded but multiple instance can be used to boost performance. How will direct read address this?

So specific answers:

1. Yes the geodatabase does have rendering info.  We are not altering the shapefile format, so this will not contain rendering info.

[Sachin]- lyr files didn't alter the shapefile format either. Atleast that would have provided a consistent way of moving rendering info around. Why cant there is a single file format to consistently handle rendering info? or atleast if something new is considered all formats should be considered. How do I make shapefiles rendering info portable?

2.  Geodatabases will be supported in ArcMap

3.  Export Image isn't planned, but it's something I can think about.
[Sachin]-Thanks for considering this. I hope the local server access will also continue until there is export Image. That will help us

4.  There are more new geoprocessing tools than these 2 being added at 10.2.2.  Exact details will follow, but I thought I'd mention these ones as they are of interest to this thread.  The best thing to do it tell us what is missing and we can consider getting them added.
[Sachin]- I can come up with a list but one thing I am trying to understand, if there is already a known reason for not adding all the geoprocessing tools. For example, lets take Projections and Transformations, currently only Define Projection is available. I want all the tools to be available under this category. Can these be added?
0 Kudos