Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a use case in which I need to parse the XML generated by an ArcGIS server, then push that data to another API. The ArcGIS server sits behind the firewall at our customer's site and exposes a REST through which we can query the database. The REST URL looks something like this:


I plan on stepping through the DOM and extract the records in Java (probably using Xerces). All the fields except the geometry fields are pretty straightforward. The geometry fields are defined as type esriFieldTypeGeometry with the data being stored as base64 binary string. My question is: how do I parse the binary data in Java and convert it to a set of coordinates?

Here is an extract of the XML:

<esri:Workspace xmlns:esri=''
    <WorkspaceDefinition xsi:type='esri:WorkspaceDefinition'>
    <WorkspaceData xsi:type='esri:WorkspaceData'>
        <DatasetData xsi:type='esri:TableData'>
            <Data xsi:type='esri:RecordSet'>
                <Fields xsi:type='esri:Fields'>
                    <FieldArray xsi:type='esri:ArrayOfField'>
                        <Field xsi:type='esri:Field'>
                            <GeometryDef xsi:type='esri:GeometryDef'>
                                <SpatialReference xsi:type='esri:ProjectedCoordinateSystem'>
                            <ModelName>System-maintained Geometry for a feature</ModelName>
                <Records xsi:type='esri:ArrayOfRecord'>
                    <Record xsi:type='esri:Record'>
                        <Values xsi:type='esri:ArrayOfValue'>
                            <Value xsi:type='esri:PointB'>

Thanks in advance for any suggestions you guys can give.

share|improve this question
In addition to PointB data, I also have to work with PolylineB and PolygonB data. – bluecollarcoder May 30 '13 at 21:48

My question is: how do I parse the binary data in Java and convert it to a set of coordinates?


URL xmlURL = new URL("");
InputStream xml = xmlURL.openStream();
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(xml);
share|improve this answer
The question is not about how to parse XML. The question is how to handle the binary base64 coordinate data when parsing the ESRI XML. This is the node in question: <Value xsi:type='esri:PointB'> <Bytes>AQAAAMAnD4uRGzJBAFYObYdpJ0E=</Bytes> </Value> – bluecollarcoder Jun 7 '13 at 15:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.