Fixing geocoding in XML using velocity

363
2
Jump to solution
08-09-2023 05:48 AM
Bryan_Wade
Occasional Contributor

My organization recently gave me access to ArcGIS Velocity and I am working to pull some data from an external XML file. Within the XML schema, the geocoding for location is shown like this "36.63610131 -81.9392393". I'm trying to find if there is a calculation in Velocity that will allow me to fix the geocoding so that it matches the needed schema for the feature service to map the point. This is my first time using Velocity so any assistance would be greatly appreciated.

 

0 Kudos
1 Solution

Accepted Solutions
JeffEismanGIS
Esri Contributor

@Bryan_Wade 

Thanks for providing the additional information. The Public URL in XML format can be brought into a HTTP Poller feed.  

https://www.511virginia.org/mobile/data/RSS/StatewideIncident.xml

For this feed you can flatten and use channel as the root to get down to a usable schema. The geometry is still nested in the item-link field and looks like this

 “ http://www.511virginia.org/?lon1=-77.462688&lat1=37.5759&lon2=-77.462688&lat2=37.5759” 

It will need to be calculated in a Real Time analytic to pull the Latitude and Longitude.  

 

JeffEismanGIS_0-1692043406256.png

In a Real-Time Analytic add the feed that was just created and add a calculate field tool to the analytic. 

In the Calculate Field tool

- Add new Geometry field

JeffEismanGIS_3-1692043674886.png

Use an arcade expression to calculate Geometry

 

var a = Split($feature.item_link, '?',10 ) [1]

var b = Split(a,'=', 5)[1]

var Long = Number(Split(b,'&', 2)[0])

 

var a = Split($feature.item_link, '?',10 ) [1]

var b = Split(a,'&', 5)[1]

var Lat = Number(Split(b,'=', 2)[1])

 

Point({"x" : Long, "y" : Lat, "spatialReference" : {"wkid" : 4326}})

 

 

JeffEismanGIS_2-1692043443983.png

Let me know if you have any other questions 

 

 

 

 

View solution in original post

0 Kudos
2 Replies
JeffEismanGIS
Esri Contributor

@Bryan_Wade Thanks for the question we do have a few way to work with projections and calculations. Message me directly and we can set up a few minutes to look at your data. 

0 Kudos
JeffEismanGIS
Esri Contributor

@Bryan_Wade 

Thanks for providing the additional information. The Public URL in XML format can be brought into a HTTP Poller feed.  

https://www.511virginia.org/mobile/data/RSS/StatewideIncident.xml

For this feed you can flatten and use channel as the root to get down to a usable schema. The geometry is still nested in the item-link field and looks like this

 “ http://www.511virginia.org/?lon1=-77.462688&lat1=37.5759&lon2=-77.462688&lat2=37.5759” 

It will need to be calculated in a Real Time analytic to pull the Latitude and Longitude.  

 

JeffEismanGIS_0-1692043406256.png

In a Real-Time Analytic add the feed that was just created and add a calculate field tool to the analytic. 

In the Calculate Field tool

- Add new Geometry field

JeffEismanGIS_3-1692043674886.png

Use an arcade expression to calculate Geometry

 

var a = Split($feature.item_link, '?',10 ) [1]

var b = Split(a,'=', 5)[1]

var Long = Number(Split(b,'&', 2)[0])

 

var a = Split($feature.item_link, '?',10 ) [1]

var b = Split(a,'&', 5)[1]

var Lat = Number(Split(b,'=', 2)[1])

 

Point({"x" : Long, "y" : Lat, "spatialReference" : {"wkid" : 4326}})

 

 

JeffEismanGIS_2-1692043443983.png

Let me know if you have any other questions 

 

 

 

 

0 Kudos