How do I iterate .lyrx files in Model Builder to create .slpk?

553
2
10-24-2017 04:31 PM
StephenDanford1
New Contributor

Hello Atma,

My name is Stephen. For some time...since Portal for ArcGIS was available, I have been told that LiDAR could be published to the web. Until ArcGIS Pro ver 1.4, I have been unable to accomplish it. At that point (ver 10.5 of Portal did not have the Java 4.2 runtime but I was able to publish to ArcGIS Online. That is now all changed and I am able to publish Lidar to Portal and consume it in ArcGIS Pro and a Web Browser. The issue that I seem unable to over come is that I need to make a Model Using Model Builder that will iterate through a series of .lyrx files to create a corresponding .slpk for each. My workflow using Model Builder is as follows: .las files to .lasd to .lyrx (I have also been able to create tin files from each .lasd which is part of my goal) the problem that I am having is that I am unable to iterate through the .lyrx files that are written to disk to create a .slpk for each. My skills with Python at this point are far from adequate to be able to accomplish this. I thought that I would be able to export my Model to a Python script and adapt it but have found that is not possible yet to do so. Finally, the focused point that I am trying to find an answer to is: Is there a way to iterate through las files (.las) or las datasets (.lasd) or layer files (.lyrx) all of which I have been able to create and save on disk and finally create as Scene Layer Package File (.slpk) on disk for any of the previously mentioned file types? Preferably .lyrx because it provides for better control of the point cloud data. Also this is the only file type that i have been able to navigate to using the Create Scene Layer Package Tool from Model Builder and successfully create a .slpk file.

I working with ESRI analysts we have discovered a "bug" (BUG-000108966 ) with the tool. Still, I am having trouble understanding why that If I can iterate through the .lyrx files that I can not provide them as input the the Create Scene Layer Package Tool in Model Builder. At this point, I am trying to adapt your code from this article to accomplish this task. Any suggestions would be most helpful.

Thank you sincerely,

Stephen

0 Kudos
2 Replies
DanPatterson_Retired
MVP Emeritus

....your code... from this article....

All would be useful details if you can provide them

0 Kudos
StephenDanford1
New Contributor

Hello Dan,

It is nice to meet you.

When I saw that you teach Geomatics at Carleton, I thought “cool” and wondered…where is Carleton University?

Well, hello all the way from Fort Worth Texas to Ottawa Ontario.

My goal was to (In ArcGIS Pro):

Create .lasd

Then

Create tin

Then

Create .lyrx

Then finally

Create a scene layer package .slpk

All in one model in ArcGIS Pro.

Since I want to create (and I know this may sound odd but I have my reasons (maintain a maximum file size of 0.25gb or less per slpk)) one las dataset, one tin, one layer file and one scene layer package per las file.

We do Design Grade Mobile Lidar Mostly for Highway Projects and our point cloud is quite dense (about 0.05 to 0.1 US Survey Foot between returns). The data has proven to be verifiable using conventional GPS to the usually expected precision from Survey Quality equipment (something about like the size of a small hen egg.)

Everything worked fine with my model up to the point of creation of the scene layer packages.

I spoke with ESRI and in discussing the problem with them, found that there is a problem with Model builder but I knew that it is possible because I am able to select a single or multiple .lyrx files and make the scene layer package from a simple model. The problem is the way that the create scene layer package tool is working in model builder.

The documentation says that it can be done with las files or las datasets or layer files. I have only had success with layer files.

Ultimately I was able to find a workaround by collecting the values and iterating them to create a single scene layer package per layer file (.lyrx)

I have been able to come up with an OK workflow to automate the above steps using ArcGIS Pro and Model Builder and publish the Lidar Point Cloud and features collected from it to a 3D Web Scene our Portal for ArcGIS.

I see now that the root of my inabilities are that I have hardly any skills with Python.

And so begins my path to learning.

In years past I worked for the City of Arlington and did a pretty good bit of app development and programming.

(started using ArcInfo Workstation ver 5 in 1990 in conjunction with Oracle and the ESRI Info database engine and lots of AML with PL/SQL)

Now, I work for a Major Land Surveying firm in the Private Sector and it is hard to justify or find time to learn Python or any other languages. When I do get to write a little code and automate workflow, they think it is great but budgets and immediate deadlines seem to be more in the mind of my boss and it is difficult to make them see the benefits of automation and letting the machine do its job then the money will follow.

ArcGIS Pro at this time does not export Python Coder from Model builder.

My approach to learning Python is to follow the documentation and best results have been achieved by creating a workable model in the 32bit desktop product which does export to Python and then adapt that code to my needs.

I would be interested in your opinion of the merits of Python vs for instance C#

Sincere thanks for responding to my post and feel free to contact me anytime.

Best regards,

Stephen W. Danford, GISP

Gorrondona & Associates, Inc.

7524 Jack Newell Blvd. So.

Fort Worth, Texas 76118

817.496.1424 (p)

817.496.1768 (f)

0 Kudos