Creating a Shapefile with ArcGIS Runtime SDK for Java

4930
3
08-24-2015 11:44 AM
MichaelDuffy1
New Contributor

Is this possible to do?  If not, what is the best recommendation for grammatically generating Shapefiles in Java?  GeoTools seems like the best bet; however, their latest and greatest version causes an error when uploading to ArcGIS Online.

0 Kudos
3 Replies
FreddieGibson
Occasional Contributor III

Shapefiles are currently a readonly source in the current version of the Java Runtime API. I'd hate for this to be the reason why you don't adopt this runtime, could you explain what you're needing to do with these shapefiles?

0 Kudos
MichaelDuffy1
New Contributor

Freddie,

Thx for the reply.

We need to process a data stream and then programmatically generate shape files on the fly.

What is the best way to do this?

Mike

0 Kudos
FreddieGibson
Occasional Contributor III

For the most part runtime treats shapefiles as a readonly source. It would allow you to read existing ones, but there isn't currently anything within the API to allow you to create new ones or edit existing ones. That being said, it isn't entirely impossible to create shapefiles with the current runtime API if you leverage ArcGIS Server or Local Server.

If you have access to ArcGIS Server and your users are in a connected environment you could create any data structure (i.e. shapefiles, file geodatabases, etc.) that you can create in ArcGIS Server. You'd just need to return this data as a zip file from the server and unpack it on the client. On the other hand, I've been able to accomplish this using LocalServer for disconnected workflows in Runtime for .NET. I would assume that because LocalServer is essentially the same between between Java and .NET that these workflows would work there as well.

To create the tool you could do something as simple as running the copy features tool in ArcGIS Desktop. The output of this tool would need to be a shapefile. You could then publish this tool to ArcGIS Server or a Geoprocessing package (gpk) and you could leverage this from runtime to create your shapefiles.

Let me know if this makes sense.