<?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: Dynamically add points to map in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/dynamically-add-points-to-map/m-p/63733#M5171</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ahhhh if thats what you're after (Darren's comments) - this is now available in 10.1 with editor tracking&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//01m600000068000000"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//01m600000068000000&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Jun 2012 15:54:31 GMT</pubDate>
    <dc:creator>KevinHibma</dc:creator>
    <dc:date>2012-06-21T15:54:31Z</dc:date>
    <item>
      <title>Dynamically add points to map</title>
      <link>https://community.esri.com/t5/python-questions/dynamically-add-points-to-map/m-p/63728#M5166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to create a python script (or something of the sorts) that allows me to interactively add points to a .shp or FC by clicking on a map that is updated every X seconds. (This will be done from a helicopter where map updates are based on GPS location). I have been playing around with modelbuilder and feature sets which allows me to add the points interactively, however it stores all the points in the in__memory (I think) then adds them to a FC all at once. I want to be able to append a point to a FC as soon as it is added (i.e. as soon as I click on the map) as each point needs to have a unique timestamp. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have some experience with python, and a little more with modelbuilder.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be awesome!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2012 03:31:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/dynamically-add-points-to-map/m-p/63728#M5166</guid>
      <dc:creator>DanielNutsford</dc:creator>
      <dc:date>2012-06-20T03:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically add points to map</title>
      <link>https://community.esri.com/t5/python-questions/dynamically-add-points-to-map/m-p/63729#M5167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How about incorporating an arcpy.CalculateField_management()?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You can acquire the current date/time with python module datetime:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import datetime&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;now = datetime.datetime.now()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then you can supply this as the value to put into the field.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2012 19:50:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/dynamically-add-points-to-map/m-p/63729#M5167</guid>
      <dc:creator>JimCousins</dc:creator>
      <dc:date>2012-06-20T19:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically add points to map</title>
      <link>https://community.esri.com/t5/python-questions/dynamically-add-points-to-map/m-p/63730#M5168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your response Jim, that function will definitely come in handy. However I still have the problem of not being able to use it to calculate the date/time of each point individually as it is added to the map. If I was to put it in now it would say all points were added at the exact same time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Below is the code I have exported straight from modelbuilder. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Import arcpy module&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Set Geoprocessing environments&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.scratchWorkspace = "D:\\dnutsford\\Thar_project"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.env.workspace = "G:\\Temp\\Daniel"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Script arguments&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;points = arcpy.GetParameterAsText(0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if points == '#' or not points:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; points = "in_memory\\{CC1D7814-D71D-4E29-8FB1-3CC188292BF4}" # provide a default value if unspecified&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;output_map = arcpy.GetParameterAsText(1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if output_map == '#' or not output_map:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output_map = "D:\\dnutsford\\Thar_project\\output_map" # provide a default value if unspecified&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Local variables:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Process: Make Feature Layer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.MakeFeatureLayer_management(points, output_map, "", "", "OBJECTID OBJECTID VISIBLE NONE;SHAPE SHAPE VISIBLE NONE;an an VISIBLE NONE;numba numba VISIBLE NONE")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am adding my points as the first parameter ('points') using a feature set as this allows me to interactively click on the display map. Im thinking that I need some way of iterating through the first parameter so that the script runs automatically each time the user clicks on the map display with the cursor. I can then append all the points to one feature class. Any help with the code required (or if it can be done in modelbuilder even better) would be much appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jun 2012 20:33:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/dynamically-add-points-to-map/m-p/63730#M5168</guid>
      <dc:creator>DanielNutsford</dc:creator>
      <dc:date>2012-06-20T20:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically add points to map</title>
      <link>https://community.esri.com/t5/python-questions/dynamically-add-points-to-map/m-p/63731#M5169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not sure I completely understand your workflow.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Exactly how are the points being entered - manually by someone at the computer? The GPS device logs the points to a file (or similar) and you will read points at a given time?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It sounds sort of like you're creating a tracking application?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When you say the map is updated every few seconds, how is it updated? Is this a map service and you want it to refresh the newly added points?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm sure what you're after is possible, I just dont understand how you want to implement.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2012 15:01:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/dynamically-add-points-to-map/m-p/63731#M5169</guid>
      <dc:creator>KevinHibma</dc:creator>
      <dc:date>2012-06-21T15:01:46Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically add points to map</title>
      <link>https://community.esri.com/t5/python-questions/dynamically-add-points-to-map/m-p/63732#M5170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It seems like your question is more "how to dynamically calculate the time when a point is added" rather than "how to dynamically add a point" (that's what an edit session is for). I think the best way to do it would be to write a simple ArcObjects macro that listens for an event (adding a point) and then calculates the time in the table for that point. I think you're barking up the wrong tree trying to force this in Python, which doesn't listen for events.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2012 15:48:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/dynamically-add-points-to-map/m-p/63732#M5170</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2012-06-21T15:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamically add points to map</title>
      <link>https://community.esri.com/t5/python-questions/dynamically-add-points-to-map/m-p/63733#M5171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ahhhh if thats what you're after (Darren's comments) - this is now available in 10.1 with editor tracking&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//01m600000068000000"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//01m600000068000000&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2012 15:54:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/dynamically-add-points-to-map/m-p/63733#M5171</guid>
      <dc:creator>KevinHibma</dc:creator>
      <dc:date>2012-06-21T15:54:31Z</dc:date>
    </item>
  </channel>
</rss>

