Select to view content in your preferred language

Write Point Geometry out to a Feature Service from XML, after DMS to DD Conversion.

1331
10
Jump to solution
01-30-2024 02:10 PM
Gene_Sipes
Occasional Contributor

I am polling an external website for XML data that will then update a hosted feature service with point data for stream gauges. One of the issues with the XML data is that the lat and long are in DMS as strings. To solve this I am using field calculators to extract the degrees, minutes, and second values, convert them to double type values, and perform simple math to convert them to decimal degrees. That all works well. The issue I am having is figuring out how to write those converted latitude and longitude values out to the hosted feature service as geometries. I am curious if the fact that the latitude and longitude values are being calculated on the fly, and so is the geometry, that when I go to build my geometry those calculated latitude and longitude values only exist in memory and are not available to the "toPoint()" function. I have even tried breaking out the latitude, longitude, and geometry calculations to their own field calculator processors, but no luck. It's really hard to explain what issue I am encountering, so I appreciate it if you have read this far, and maybe you have some suggestions? 

Tags (2)
0 Kudos
10 Replies
Gene_Sipes
Occasional Contributor

Ok I worked it out. 

I needed to set up my input definition to include the two new fields that I was going to convert my DMS values to DD values to. Then in the geo event service, set up my field calculators to convert the values from DMS to DD and store in those new fields. Finally map them out to my output. Screenshots below for each piece of the pie. Hopefully someone gets something from this in the future! 


XML Feed:
https://hayscounty.wetec.us/WETMap/public/hayswlpublic.xml

Input Definition with new fields highlighted:

Gene_Sipes_0-1707921110650.png

XML Input Connector:

Gene_Sipes_1-1707921183020.png

Hosted feature service output connector, make sure Update only is "NO":

Gene_Sipes_7-1707921753764.png

 

Output Definition, with geometry output:

Gene_Sipes_2-1707921262582.png

Geoevent Service outputs to a hosted feature service, and sends email.

Gene_Sipes_3-1707921359671.png

 

Example Field Calculator that converts the XML DMS string value to a double DD value. 

Gene_Sipes_4-1707921465614.png

In the field mapper, using the DD values for latitude and longitude to construct the geometry. 

Gene_Sipes_5-1707921551317.png

 

Data mapped to hosted feature service. 

Gene_Sipes_6-1707921646774.png

 

 

 

 

 

0 Kudos