Can you import multiple geocoded png files as point symbols?

633
15
Jump to solution
11-17-2021 06:12 AM
DavidZiegler
New Contributor III

I have a hundreds of company logo png files that I am trying to batch import as point symbols. I haven't had much luck batch importing them to XY points (seems you have to do it individually...way too many for this). 

However, could one geocode (associated XY coords) with the png files (via some software, or other) and then  import them as point symbols? 

0 Kudos
1 Solution

Accepted Solutions
JohannesLindner
MVP Regular Contributor

You could assign geotags to the logos and run GeotaggedPhotosToPoints, creating an attachment tables from the logos and then symbolize the points with the attachments (see last point of the list below).

This might be simpler and can be done completely in ArcGIS:

  • Input: Table (Excel/CSV/etc) with X, Y, LogoPath
    JohannesLindner_4-1637221174704.png
  • import table into ArcGIS Pro
  • right-click on the table -> Display XY Data -> save as point feature class
  • add field LogoData (BLOB)
  • read the logos into the feature class with this python script (run in ArcGIS Pro Python window)
with arcpy.da.UpdateCursor("NameOfLogoLayer", ["LogoPath", "LogoData"]) as cursor:
    for row in cursor:
        with open(row[0], "rb") as f:
            cursor.updateRow([row[0], f.read()])
  • symbolize the layer
    • Single Symbol
      JohannesLindner_1-1637220903978.png
    • Allow symbol property connections
      JohannesLindner_2-1637220954812.png
    • Picture Marker, map File to LogoData, set size
      JohannesLindner_5-1637221378139.png

       

Result:

JohannesLindner_3-1637221107529.png

 


Have a great day!
Johannes

View solution in original post

15 Replies
JoeBorgione
MVP Esteemed Contributor

How wide-spread geographically are you points?  You could georeference the images if you can figure out ground truth monuments.  Do this images have some sort of xy notation?

That should just about do it....
0 Kudos
DavidZiegler
New Contributor III

Joe, I have found programs that can assign lat-long (i.e. from an excel sheet with XY and png file columns) to each png file. 

0 Kudos
JohannesLindner
MVP Regular Contributor

You could assign geotags to the logos and run GeotaggedPhotosToPoints, creating an attachment tables from the logos and then symbolize the points with the attachments (see last point of the list below).

This might be simpler and can be done completely in ArcGIS:

  • Input: Table (Excel/CSV/etc) with X, Y, LogoPath
    JohannesLindner_4-1637221174704.png
  • import table into ArcGIS Pro
  • right-click on the table -> Display XY Data -> save as point feature class
  • add field LogoData (BLOB)
  • read the logos into the feature class with this python script (run in ArcGIS Pro Python window)
with arcpy.da.UpdateCursor("NameOfLogoLayer", ["LogoPath", "LogoData"]) as cursor:
    for row in cursor:
        with open(row[0], "rb") as f:
            cursor.updateRow([row[0], f.read()])
  • symbolize the layer
    • Single Symbol
      JohannesLindner_1-1637220903978.png
    • Allow symbol property connections
      JohannesLindner_2-1637220954812.png
    • Picture Marker, map File to LogoData, set size
      JohannesLindner_5-1637221378139.png

       

Result:

JohannesLindner_3-1637221107529.png

 


Have a great day!
Johannes
DavidZiegler
New Contributor III

I am going to try this. Thanks for providing this--I hope it works. I may come back to ask you questions. 

0 Kudos
DavidZiegler
New Contributor III

Ultimately, after several errors on my part, IT WORKED!

0 Kudos
DavidZiegler
New Contributor III
  • add field LogoData (BLOB)

[Johannes, what does this mean?]

0 Kudos
JohannesLindner
MVP Regular Contributor

@DavidZiegler Create a new field in the point feature class with the name "LogoData" and the field type BLOB (Binary Large OBject).

Fields of this type can store byte data, so everything you can think of. Images, PDFs, Excel, Word, music, video, etc.

We're going to use it to store the logo files directly in the feature class.


Have a great day!
Johannes
DavidZiegler
New Contributor III

Johannes has provided an effective path here to putting multiple company or other picture (png or other) logos on a map. I can't thank him enough. 

0 Kudos
DavidZiegler
New Contributor III

Johannes,

I put the code verbatim into the Python script window (found in analysis); but, how do I run it? I don't see a go, or run. 

0 Kudos