<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Get Congressional District output with location (lat, lon) input using REST call. in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/get-congressional-district-output-with-location/m-p/1062285#M5888</link>
    <description>&lt;P&gt;In order to help someone with the same question here is a working example:&lt;/P&gt;&lt;PRE&gt;https://tigerweb.geo.census.gov/arcgis/rest/services/TIGERweb/Legislative/MapServer/0/query?where=1=1&amp;amp;text=&amp;amp;objectIds=&amp;amp;time=&amp;amp;geometry={"x" : -78.64541815397774, "y" : 35.88159837593537, "spatialReference" : {"wkid" : 4326}}&amp;amp;geometryType=esriGeometryPoint&amp;amp;inSR=&amp;amp;spatialRel=esriSpatialRelWithin&amp;amp;distance=&amp;amp;units=esriSRUnit_Foot&amp;amp;relationParam=&amp;amp;outFields=NAME&amp;amp;returnGeometry=false&amp;amp;returnTrueCurves=false&amp;amp;maxAllowableOffset=&amp;amp;geometryPrecision=&amp;amp;outSR=&amp;amp;havingClause=&amp;amp;returnIdsOnly=false&amp;amp;returnCountOnly=false&amp;amp;orderByFields=&amp;amp;groupByFieldsForStatistics=&amp;amp;outStatistics=&amp;amp;returnZ=false&amp;amp;returnM=false&amp;amp;gdbVersion=&amp;amp;historicMoment=&amp;amp;returnDistinctValues=false&amp;amp;resultOffset=&amp;amp;resultRecordCount=&amp;amp;returnExtentOnly=false&amp;amp;datumTransformation=&amp;amp;parameterValues=&amp;amp;rangeValues=&amp;amp;quantizationParameters=&amp;amp;featureEncoding=esriDefault&amp;amp;f=json&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;it returns:&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"displayFieldName": "BASENAME",&lt;BR /&gt;"fieldAliases": {&lt;BR /&gt;"NAME": "NAME"&lt;BR /&gt;},&lt;BR /&gt;"fields": [&lt;BR /&gt;{&lt;BR /&gt;"name": "NAME",&lt;BR /&gt;"type": "esriFieldTypeString",&lt;BR /&gt;"alias": "NAME",&lt;BR /&gt;"length": 100&lt;BR /&gt;}&lt;BR /&gt;],&lt;BR /&gt;"features": [&lt;BR /&gt;{&lt;BR /&gt;"attributes": {&lt;BR /&gt;"NAME": "Congressional District 4"&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;/P&gt;</description>
    <pubDate>Thu, 27 May 2021 13:42:37 GMT</pubDate>
    <dc:creator>MarkGlass</dc:creator>
    <dc:date>2021-05-27T13:42:37Z</dc:date>
    <item>
      <title>Get Congressional District output with location (lat, lon) input using REST call.</title>
      <link>https://community.esri.com/t5/developers-questions/get-congressional-district-output-with-location/m-p/1062097#M5884</link>
      <description>&lt;P&gt;I'm developing an application which has a java backend servicing a REST API and a front end using Angular 8. I need to create a function that accepts lat, lon and returns the congressional district the point is located in.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone suggest how I might do that?&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2021 22:33:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/get-congressional-district-output-with-location/m-p/1062097#M5884</guid>
      <dc:creator>MarkGlass</dc:creator>
      <dc:date>2021-05-26T22:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get Congressional District output with location (lat, lon) input using REST call.</title>
      <link>https://community.esri.com/t5/developers-questions/get-congressional-district-output-with-location/m-p/1062116#M5885</link>
      <description>&lt;P&gt;Using, for example, the &lt;A href="https://tigerweb.geo.census.gov/arcgis/rest/services/TIGERweb/Legislative/MapServer/0/query?where=1%3D1&amp;amp;text=&amp;amp;objectIds=&amp;amp;time=&amp;amp;geometry=%7B%22x%22+%3A+-118.15%2C+%22y%22+%3A+33.80%2C+%22spatialReference%22+%3A+%7B%22wkid%22+%3A+4326%7D%7D&amp;amp;geometryType=esriGeometryPoint&amp;amp;inSR=&amp;amp;spatialRel=esriSpatialRelWithin&amp;amp;distance=&amp;amp;units=esriSRUnit_Foot&amp;amp;relationParam=&amp;amp;outFields=NAME&amp;amp;returnGeometry=false&amp;amp;returnTrueCurves=false&amp;amp;maxAllowableOffset=&amp;amp;geometryPrecision=&amp;amp;outSR=&amp;amp;havingClause=&amp;amp;returnIdsOnly=false&amp;amp;returnCountOnly=false&amp;amp;orderByFields=&amp;amp;groupByFieldsForStatistics=&amp;amp;outStatistics=&amp;amp;returnZ=false&amp;amp;returnM=false&amp;amp;gdbVersion=&amp;amp;historicMoment=&amp;amp;returnDistinctValues=false&amp;amp;resultOffset=&amp;amp;resultRecordCount=&amp;amp;returnExtentOnly=false&amp;amp;datumTransformation=&amp;amp;parameterValues=&amp;amp;rangeValues=&amp;amp;quantizationParameters=&amp;amp;featureEncoding=esriDefault&amp;amp;f=json" target="_self"&gt;Census Bureau's service of legislative districts&lt;/A&gt;, all you need to do is include the lat/lon in the &lt;STRONG&gt;geometry&lt;/STRONG&gt; parameter being sent in the REST query. Then specify &lt;STRONG&gt;geometryType=esriGeometryPoint&lt;/STRONG&gt; and &lt;STRONG&gt;spatialRel=esriSpatialRelWithin&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;I'm not sure how you're getting the lat/lon, maybe from a click or manual input, but once you have those values, just swap them into the geometry definition in the query:&lt;/P&gt;&lt;PRE&gt;geometry={"x" : lon, "y" : lat, "spatialReference" : {"wkid" : 4326}}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2021 23:21:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/get-congressional-district-output-with-location/m-p/1062116#M5885</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-05-26T23:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: Get Congressional District output with location (lat, lon) input using REST call.</title>
      <link>https://community.esri.com/t5/developers-questions/get-congressional-district-output-with-location/m-p/1062285#M5888</link>
      <description>&lt;P&gt;In order to help someone with the same question here is a working example:&lt;/P&gt;&lt;PRE&gt;https://tigerweb.geo.census.gov/arcgis/rest/services/TIGERweb/Legislative/MapServer/0/query?where=1=1&amp;amp;text=&amp;amp;objectIds=&amp;amp;time=&amp;amp;geometry={"x" : -78.64541815397774, "y" : 35.88159837593537, "spatialReference" : {"wkid" : 4326}}&amp;amp;geometryType=esriGeometryPoint&amp;amp;inSR=&amp;amp;spatialRel=esriSpatialRelWithin&amp;amp;distance=&amp;amp;units=esriSRUnit_Foot&amp;amp;relationParam=&amp;amp;outFields=NAME&amp;amp;returnGeometry=false&amp;amp;returnTrueCurves=false&amp;amp;maxAllowableOffset=&amp;amp;geometryPrecision=&amp;amp;outSR=&amp;amp;havingClause=&amp;amp;returnIdsOnly=false&amp;amp;returnCountOnly=false&amp;amp;orderByFields=&amp;amp;groupByFieldsForStatistics=&amp;amp;outStatistics=&amp;amp;returnZ=false&amp;amp;returnM=false&amp;amp;gdbVersion=&amp;amp;historicMoment=&amp;amp;returnDistinctValues=false&amp;amp;resultOffset=&amp;amp;resultRecordCount=&amp;amp;returnExtentOnly=false&amp;amp;datumTransformation=&amp;amp;parameterValues=&amp;amp;rangeValues=&amp;amp;quantizationParameters=&amp;amp;featureEncoding=esriDefault&amp;amp;f=json&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;it returns:&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"displayFieldName": "BASENAME",&lt;BR /&gt;"fieldAliases": {&lt;BR /&gt;"NAME": "NAME"&lt;BR /&gt;},&lt;BR /&gt;"fields": [&lt;BR /&gt;{&lt;BR /&gt;"name": "NAME",&lt;BR /&gt;"type": "esriFieldTypeString",&lt;BR /&gt;"alias": "NAME",&lt;BR /&gt;"length": 100&lt;BR /&gt;}&lt;BR /&gt;],&lt;BR /&gt;"features": [&lt;BR /&gt;{&lt;BR /&gt;"attributes": {&lt;BR /&gt;"NAME": "Congressional District 4"&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 13:42:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/get-congressional-district-output-with-location/m-p/1062285#M5888</guid>
      <dc:creator>MarkGlass</dc:creator>
      <dc:date>2021-05-27T13:42:37Z</dc:date>
    </item>
  </channel>
</rss>

