Question

HTTP Caller output

  • 28 June 2016
  • 6 replies
  • 19 views

Badge

Hi I am trying to sent some dat to an api and retrieved some polygons which are being returned back using the http caller but not sure how to get the the output to mapinfo as polygons? Below is an example of the output when I save to file (formatting might have changed slightly when I pasted into this question box) but really want to go via attribute option of the HTTP Caller?

<?xml version="1.0" encoding="UTF-8"?>

-<aas:AAS xsi:schemaLocation="http://www.geoinform.fh-mainz.de/aas D:/Schemata/AAS1.0/AccessibilityService.xsd" version="1.0" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aas="http://www.geoinform.fh-mainz.de/aas">

<aas:ResponseHeader xsi:type="aas:ResponseHeaderType"/>

 

-<aas:Response version="1.0" xsi:type="aas:ResponseType" requestID="00">

 

-<aas:AccessibilityResponse xsi:type="aas:AccessibilityResponseType">

 

-<aas:AccessibilitySummary>

<aas:NumberOfLocations>0</aas:NumberOfLocations>

 

-<aas:BoundingBox srsName="EPSG:4326">

<gml:pos>-1.6862003 53.6159234</gml:pos>

<gml:pos>-1.6818549 53.6203252</gml:pos>

</aas:BoundingBox>

</aas:AccessibilitySummary>

 

-<aas:AccessibilityGeometry>

 

-<aas:Isochrone time="60.0">

 

-<aas:IsochroneGeometry area="304297.36">

 

-<gml:Polygon srsName="EPSG:4326">

 

-<gml:exterior>

 

-<gml:LinearRing xsi:type="gml:LinearRingType">

<gml:pos>-1.6841016 53.6164491</gml:pos>

<gml:pos>-1.6835025 53.6162827</gml:pos>

<gml:pos>-1.6823042 53.6159234</gml:pos>

<gml:pos>-1.6818549 53.6162827</gml:pos>

<gml:pos>-1.6818549 53.6180794</gml:pos>

<gml:pos>-1.6818549 53.6198760</gml:pos>

<gml:pos>-1.6823042 53.6203252</gml:pos>

<gml:pos>-1.6841016 53.6203252</gml:pos>

<gml:pos>-1.6848628 53.6198760</gml:pos>

<gml:pos>-1.6858991 53.6185285</gml:pos>

<gml:pos>-1.6862003 53.6180794</gml:pos>

<gml:pos>-1.6858991 53.6169952</gml:pos>

<gml:pos>-1.6841016 53.6164491</gml:pos>

</gml:LinearRing>

</gml:exterior>

</gml:Polygon>

</aas:IsochroneGeometry>

</aas:Isochrone>

</aas:AccessibilityGeometry>

</aas:AccessibilityResponse>

</aas:Response>

</aas:AAS>

Thanks

Neil


6 replies

Store the results of the HTTPCaller to an attribute and then use a GeometryReplacer set to GML encoding with the source as that attribute. That should do it. I tried it with the above fragment and it worked fine for me.

Hope this helps

Mark

Badge

Thanks I have got that bit working but I have a noticed my location comes out incorrect and when I inspect the data I see the following some bits looked liked they have been reversed. Any suggestions?

Userlevel 1
Badge +10

Thanks I have got that bit working but I have a noticed my location comes out incorrect and when I inspect the data I see the following some bits looked liked they have been reversed. Any suggestions?

You may need to manually set the GML SRS Axis Order in the GeometryReplacer

Badge

I used coordinate swapper which worked any ideas how to get the values of "Isochrone time" variable as an attribute attached to the correct polygon?

Userlevel 1
Badge +10

If you have 2016 you can use a stringsearcher with a regular expression. This won't work in 2015 or earlier

(?<=Isochrone time=").+(?=">)

The Isochrone time will be returned in the matched_characters attribute (or whatever attribute name you choose)

Userlevel 2
Badge +17

I used coordinate swapper which worked any ideas how to get the values of "Isochrone time" variable as an attribute attached to the correct polygon?

Hi @denby, looks like you have fragmented the XML document using <Polygon> element as 'Elements to Match' parameter. Try perform fragmentation by <AccessibilityGeometry> element instead of <Polygon>. Then, set 'No' to the 'Remove Attribute' parameter in the GeometryReplacer so that the "Isochrone time" attribute will be preserved.

Reply