CCTV Solution Creates Multiple Duplicate Conditions

674
3
08-15-2019 05:04 PM
KrystalPhaneuf2
Occasional Contributor

I'm running the CCTV Solution and for some reason it's creating 4 or more duplicate conditions.  In the original conditions table I can see there are only 10 conditions for inspection 4017 in the screenshot below. First image is the CCTV Conditions table that gets created, second is the original conditions table.  My continuous field is blank because we don't track that.  Any ideas why it may be creating so many duplicates?

Using ArcGIS Pro 2.4.1

0 Kudos
3 Replies
PaulLeBlanc1
Esri Contributor

I've not seen this before and I can't think of a reason what would cause this.

Could you share your data? You can email pleblanc@esri.com

0 Kudos
KrystalPhaneuf2
Occasional Contributor

Hi Paul,

Sure I will send you the files.

Also, another issue I came across and was able to fix in the ESRI solution script, the inspection_pk attribute is required to be a text field, however at line 520 of core.py, the script adds the inspection_pk field to the OUTPUT_LINE feature.  When it adds, it adds it as a LONG so this process changes the field type.  Then when it joins, the join does not work because it's trying to join a TEXT to a LONG.  So I changed line 520 to add the field as a TEXT field and it worked.  Here's a snippet of the section.

# Add count field for each condition.
# Add inspection ID field so that the entries can be uniquely identified.
# Add split flag.
arcpy.AddFields_management(in_table=self.output_line,
field_description=[(NUMBER_CONDITIONS, 'SHORT', 'Number of Conditions', '', ''),
(self.inspection_pk, 'TEXT', '', '', ''),  ## this was 'LONG'
(SPLIT_FLAG, 'SHORT', 'Line Inspected?', '', '')])

Test this with some other data and let me know if it's correct. Worked perfectly with mine.  Also, the issue of duplicates was happening before I edited the script so I know it's not a result of the edit.

I found a similar issue back in October and posted this but was able to figure out I needed to add inspection id (inspection_pk) as a numeric.  The tool at that time allowed either text or numeric fields.

Lastly, on the CCTV Manager tool reference in the Code Sample, the parameter "pipes=pipes" is wrong.  It gives an error and should be "pipe=pipes". 

Thanks!

Krystal

0 Kudos
PaulLeBlanc1
Esri Contributor

I'll take a look at the field type mismatch, that does seem strange.

I'll forward on the doc feedback, thanks!