<?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: add background imagery tile based on GPS coordinates in ArcPad Questions</title>
    <link>https://community.esri.com/t5/arcpad-questions/add-background-imagery-tile-based-on-gps/m-p/253208#M1839</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Gareth,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for for your advice.&amp;nbsp; I tried your code (as well as lots of modifications to try and and get it to run) but I am still getting&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the error: Object doesn't support this property or method: 'objCatalog.IsPointIn', Source Text Unavailable&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jason&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Sub AddImagery
Dim objCatalog
Set objCatalog = Map.Layers("nv_24kquads_TEST")
Dim objPoint
Set objPoint = Application.CreateAppObject("point")
objPoint.X = GPS.X
objPoint.Y = GPS.Y
Dim objPolyNum
If objCatalog.IsPointIn(objPoint) Then 
objPolyNum = objCatalog.Records.Fields("QUAD_NAME").value 
Map.AddLayerFromFile("C:\Data\ArcPad\NV_FieldForms\Databases" &amp;amp; objPolynum &amp;amp; ".tif")
End If
End Sub&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 12:32:02 GMT</pubDate>
    <dc:creator>JasonTrook</dc:creator>
    <dc:date>2021-12-11T12:32:02Z</dc:date>
    <item>
      <title>add background imagery tile based on GPS coordinates</title>
      <link>https://community.esri.com/t5/arcpad-questions/add-background-imagery-tile-based-on-gps/m-p/253206#M1837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi ArcPad Users,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Currently I'm creating ArcPad projects displaying only vector data and then a user has to manually add the correct NAIP imagery tile &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;based upon their location.&amp;nbsp; This is necessary because my survey areas are too large to do a bulk check out of my background &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;imagery (get low memory warnings on GPS device).&amp;nbsp; Has anyone written a script that, upon the click of a button, will add the correct background NAIP tile based on the GPS coordinates?&amp;nbsp; I'm thinking it could add the .tiff image from my SD card and remove all other &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.tifs, if needed.&amp;nbsp; I have an index/fishnet that matches the .tif name so if GPS coordinates intersect feature 14 in the index then add &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;14.tif from SD card.&amp;nbsp; Just looking for a script I could modify or advice how to set this up. Thanks in advance for any help. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jason&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2013 22:25:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/add-background-imagery-tile-based-on-gps/m-p/253206#M1837</guid>
      <dc:creator>JasonTrook</dc:creator>
      <dc:date>2013-01-08T22:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: add background imagery tile based on GPS coordinates</title>
      <link>https://community.esri.com/t5/arcpad-questions/add-background-imagery-tile-based-on-gps/m-p/253207#M1838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jason,Great question, I have often wished for a simple raster catalog for ArcPad. You can definately do what you want to achieve.&amp;nbsp; I would suggest that you use the isPointIn. Take your gps reading check that it inside a polygon, then use the addlayerfromfile.Excuse me for putting some pseudo code but I am trying out the internet explorer on my xbox, so I am not fully equipped.vbScript:dim objCatalogset objCatalog = Map.Layers("polygonLayer")dim objPointset objPoint = Application.CreateAppObject("point")objPoint.X = GPS.XobjPoint.Y = GPS.Ydim objPolyNumif objCatalog.IsPointIn(objPoint) then objPolyNum = objCatalog.Records.Fields("name").value Map.AddLayerFromFile("c:temp" &amp;amp; objPolynum &amp;amp; ".tif")end ifWell, it will be something like that. I think I have the isPointIn correct.Let me know how you go. I this is a good start.Cheers,Gareth&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2013 08:45:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/add-background-imagery-tile-based-on-gps/m-p/253207#M1838</guid>
      <dc:creator>GarethWalters</dc:creator>
      <dc:date>2013-01-30T08:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: add background imagery tile based on GPS coordinates</title>
      <link>https://community.esri.com/t5/arcpad-questions/add-background-imagery-tile-based-on-gps/m-p/253208#M1839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Gareth,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for for your advice.&amp;nbsp; I tried your code (as well as lots of modifications to try and and get it to run) but I am still getting&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the error: Object doesn't support this property or method: 'objCatalog.IsPointIn', Source Text Unavailable&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jason&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Sub AddImagery
Dim objCatalog
Set objCatalog = Map.Layers("nv_24kquads_TEST")
Dim objPoint
Set objPoint = Application.CreateAppObject("point")
objPoint.X = GPS.X
objPoint.Y = GPS.Y
Dim objPolyNum
If objCatalog.IsPointIn(objPoint) Then 
objPolyNum = objCatalog.Records.Fields("QUAD_NAME").value 
Map.AddLayerFromFile("C:\Data\ArcPad\NV_FieldForms\Databases" &amp;amp; objPolynum &amp;amp; ".tif")
End If
End Sub&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:32:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/add-background-imagery-tile-based-on-gps/m-p/253208#M1839</guid>
      <dc:creator>JasonTrook</dc:creator>
      <dc:date>2021-12-11T12:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: add background imagery tile based on GPS coordinates</title>
      <link>https://community.esri.com/t5/arcpad-questions/add-background-imagery-tile-based-on-gps/m-p/253209#M1840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jason,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry for the delay. I see in your code that you actually need a couple of extra steps. The IsPointIn method works on a polygon layer but you need to have a polygon feature selected to run the test, otherwise you need to loop through and test the rule against every polygon.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In this instance I may have give you a bum steer as you are really need to use the GPS to find what is around you. In that case I would suggest you try the FindNearestXY method&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
//var objPoint = Map.Layers("Poles");
//var objPointRS = objPoint.Records;
//objPointRS.BookMark = Map.SelectionBookMark;


var objX = GPS.X; //objPointRS.Fields.Shape.X; 
var objY = GPS.Y; //objPointRS.Fields.Shape.Y;


var objPoly= Map.Layers("Parcel");
var objPolyRS = objPoly.Records;
var objPolyBookMark = objPolyRS.FindNearestXY(objX,objY,0)


if (objPolyBookMark != 0)
{
&amp;nbsp; //AddLayerFromFile routine
}
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This way you will start at the GPS Position and find a polygon that is closest to it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope this helps. Let me know how you get on.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Gareth&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;P.S. Here is cbScript version for you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
'Dim objPoint
'Set objPoint = Map.Layers("Poles")
'Dim objPointRS 
'Set objPointRS = objPoint.Records
'objPointRS.BookMark = Map.SelectionBookMark


Dim objX
objX = GPS.X 'objPointRS.Fields.Shape.X
Dim objY
objY = GPS.Y 'objPointRS.Fields.Shape.Y


Dim objPoly
Set objPoly = Map.Layers("Parcel")
Dim objPolyRS
Set objPolyRS = objPoly.Records
Dim objPolyBookMark
objPolyBookMark = objPolyRS.FindNearestXY(objX,objY,0)


if objPolyBookMark &amp;lt;&amp;gt; 0 then
&amp;nbsp; Console.print objPolyBookMark
&amp;nbsp; 'AddLayerFromFile routine
end if
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:32:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/add-background-imagery-tile-based-on-gps/m-p/253209#M1840</guid>
      <dc:creator>GarethWalters</dc:creator>
      <dc:date>2021-12-11T12:32:04Z</dc:date>
    </item>
  </channel>
</rss>

