0

For a project I want to open another shapefile by clicking on a specific part of a shapefile. I am using Esri ArcGIS.

As a result I want to click with Hyperlink tool at the blue buffer (that was made along a stream Network, so that the Survey date for this SPECIFIC part get´s loaded in (each river has it´s own Survey Data).

I made use of some Python script parts of this post:

Hyperlink Script to Open Shapefile in ArcMap?

Here is what I got so far:

import os
def OpenLink ( [Hyperlink] ):

  dir_fc = r'C:(path of folder for shapefiles)      
  mxd = arcpy.mapping.MapDocument("CURRENT")
  df = arcpy.mapping.ListDataFrames(mxd)[0]
  newlayer = arcpy.mapping.Layer([Hyperlink])  
  arcpy.mapping.AddLayer(df, newlayer)   
  arcpy.RefreshActiveView()      

  return

I have a field called "Hyperlink" in the attribute table, where the path of each Survey date shapefile should be saved. In my posted script I have filled the path of an example for the whole Hyperlink field, to see if it´s working (it does for this specific example). Now I have to find a way, that I can fill the specific path in the Hyperlink field for each river and gets loaded in.

Things I need to do I think are:

  1. Find the path of the map mxd.filePath
  2. Subfolder with Survey data (each river)
  3. Path of map + subfolder + [Hyperlink]
  4. Put in new layer

Roundup: The buffers shapefile Attribute table should include the path of the reffering Survey data for each river. Use the Hyperlink tool to open the specific Survey data

I have attached a photo that shows my project:

enter image description here

  • 4
    What software produced those images? – Spacedman Sep 15 '19 at 15:17
  • 2
    Welcome to GIS.se! Could you edit your question to better describe what you want to do? Is there a database of other geometries you'd like to search and then automatically add as layers based on the coverage of a visible layer? And in which software do you want to view these layers? – Simbamangu Sep 15 '19 at 17:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.