AnsweredAssumed Answered

Arcpy / Modelbuilder

Question asked by StevenHougaard on Jan 16, 2018
Latest reply on Feb 1, 2018 by xander_bakker

Greetings,

 

Let me start by saying, i know very little about GIS in general, so please bear with me. I am just the IT support guy that somehow got involved in some assignments for our GIS department, sorry for the long explanation in advance.

 

The GIS departments are looking for some tools to help ease the daily jobs, for instance simplifying the search function, so they can search for an address and zoom to said address, i have managed to fulfill this assignment with ArcToolbox and ArcPy and are now working on another one.

 

I have a ~50.000 rows database with ~25 columns / fields. There is 2 things i need from this, which is "ELAVSNAVN" (Which is similar to a company) and "MATRNR" (which is a lot number, not entirely sure that it is the correct english technical term). The MATRNR is unique to ELAVNSNAVN but not in general, IE. a MATRNR could be the same for 2 companies.

 

The assignment is similar to the first one i solved, however this needs to be done with dropdown boxes.

 

Top box will be populated with the unique values of ELAVSNAVN and then the bottom box will be populated with the unique values of MATRNR, like so:

 

So let's say we have the following database

    ELAVSNAVN     MATRNR

  1. Option 1         A
  2. Option 1         B
  3. Option 2         A
  4. Option 3         A
  5. Option 2         B
  6. Option 3         B
  7. Option 1         C

 

The top box would show Option 1, Option 2, Option 3 and the bottom box will be empty.

 

If i then choose Option 2, the bottom box will be populated with A and B, and i can then choose for instance B and it would then know it is row 5.

 

I have managed to make a python script and arctoolbox, that almost does this (ran into some unicode problems, but that's not the issue right now, can use a different column which is like the ID of the ELAVSNAVN for testing purposes), but it is done by making 2 lists and then combining into a dictionary, and while it works it kinda eats all resources, it feels like it keeps going through the entire database, multiple times. I think it's a horrible inefficient way of doing it. I think it can be done via SQL expressions somehow.

 

I have been looking into ModelBuilder, but i have a hard time finding info pertaining this exact issue.

 

Just looking for some pointers on what tools / direction you guys would go with this, as i am a tad stuck.

 

Using ArcMap / Catalog 10.3.1 if that is relevant.

Outcomes